@constructive-io/react 0.18.9 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/admin/hooks/index.d.ts +1 -1
  2. package/admin/hooks/index.js +1 -1
  3. package/admin/hooks/invalidation.d.ts +6 -0
  4. package/admin/hooks/invalidation.js +16 -0
  5. package/admin/hooks/mutation-keys.d.ts +12 -0
  6. package/admin/hooks/mutation-keys.js +8 -1
  7. package/admin/hooks/mutations/index.d.ts +3 -0
  8. package/admin/hooks/mutations/index.js +3 -0
  9. package/admin/hooks/mutations/useCreateUsageSnapshotMutation.d.ts +34 -0
  10. package/admin/hooks/mutations/useCreateUsageSnapshotMutation.js +34 -0
  11. package/admin/hooks/mutations/useDeleteUsageSnapshotMutation.d.ts +38 -0
  12. package/admin/hooks/mutations/useDeleteUsageSnapshotMutation.js +39 -0
  13. package/admin/hooks/mutations/useUpdateUsageSnapshotMutation.d.ts +40 -0
  14. package/admin/hooks/mutations/useUpdateUsageSnapshotMutation.js +40 -0
  15. package/admin/hooks/queries/index.d.ts +2 -0
  16. package/admin/hooks/queries/index.js +2 -0
  17. package/admin/hooks/queries/useUsageSnapshotQuery.d.ts +65 -0
  18. package/admin/hooks/queries/useUsageSnapshotQuery.js +53 -0
  19. package/admin/hooks/queries/useUsageSnapshotsQuery.d.ts +69 -0
  20. package/admin/hooks/queries/useUsageSnapshotsQuery.js +38 -0
  21. package/admin/hooks/query-keys.d.ts +14 -0
  22. package/admin/hooks/query-keys.js +9 -1
  23. package/admin/orm/index.d.ts +2 -0
  24. package/admin/orm/index.js +2 -0
  25. package/admin/orm/input-types.d.ts +129 -0
  26. package/admin/orm/models/index.d.ts +1 -0
  27. package/admin/orm/models/index.js +3 -1
  28. package/admin/orm/models/usageSnapshot.d.ts +56 -0
  29. package/admin/orm/models/usageSnapshot.js +100 -0
  30. package/admin/schema-types.d.ts +98 -1
  31. package/admin/types.d.ts +8 -0
  32. package/esm/admin/hooks/index.d.ts +1 -1
  33. package/esm/admin/hooks/index.js +1 -1
  34. package/esm/admin/hooks/invalidation.d.ts +6 -0
  35. package/esm/admin/hooks/invalidation.js +17 -1
  36. package/esm/admin/hooks/mutation-keys.d.ts +12 -0
  37. package/esm/admin/hooks/mutation-keys.js +7 -0
  38. package/esm/admin/hooks/mutations/index.d.ts +3 -0
  39. package/esm/admin/hooks/mutations/index.js +3 -0
  40. package/esm/admin/hooks/mutations/useCreateUsageSnapshotMutation.d.ts +34 -0
  41. package/esm/admin/hooks/mutations/useCreateUsageSnapshotMutation.js +31 -0
  42. package/esm/admin/hooks/mutations/useDeleteUsageSnapshotMutation.d.ts +38 -0
  43. package/esm/admin/hooks/mutations/useDeleteUsageSnapshotMutation.js +36 -0
  44. package/esm/admin/hooks/mutations/useUpdateUsageSnapshotMutation.d.ts +40 -0
  45. package/esm/admin/hooks/mutations/useUpdateUsageSnapshotMutation.js +37 -0
  46. package/esm/admin/hooks/queries/index.d.ts +2 -0
  47. package/esm/admin/hooks/queries/index.js +2 -0
  48. package/esm/admin/hooks/queries/useUsageSnapshotQuery.d.ts +65 -0
  49. package/esm/admin/hooks/queries/useUsageSnapshotQuery.js +47 -0
  50. package/esm/admin/hooks/queries/useUsageSnapshotsQuery.d.ts +69 -0
  51. package/esm/admin/hooks/queries/useUsageSnapshotsQuery.js +32 -0
  52. package/esm/admin/hooks/query-keys.d.ts +14 -0
  53. package/esm/admin/hooks/query-keys.js +8 -0
  54. package/esm/admin/orm/index.d.ts +2 -0
  55. package/esm/admin/orm/index.js +2 -0
  56. package/esm/admin/orm/input-types.d.ts +129 -0
  57. package/esm/admin/orm/models/index.d.ts +1 -0
  58. package/esm/admin/orm/models/index.js +1 -0
  59. package/esm/admin/orm/models/usageSnapshot.d.ts +56 -0
  60. package/esm/admin/orm/models/usageSnapshot.js +96 -0
  61. package/esm/admin/schema-types.d.ts +98 -1
  62. package/esm/admin/types.d.ts +8 -0
  63. package/esm/public/hooks/index.d.ts +1 -1
  64. package/esm/public/hooks/index.js +1 -1
  65. package/esm/public/hooks/invalidation.d.ts +6 -0
  66. package/esm/public/hooks/invalidation.js +17 -1
  67. package/esm/public/hooks/mutation-keys.d.ts +12 -0
  68. package/esm/public/hooks/mutation-keys.js +7 -0
  69. package/esm/public/hooks/mutations/index.d.ts +3 -0
  70. package/esm/public/hooks/mutations/index.js +3 -0
  71. package/esm/public/hooks/mutations/useCreateUsageSnapshotMutation.d.ts +34 -0
  72. package/esm/public/hooks/mutations/useCreateUsageSnapshotMutation.js +31 -0
  73. package/esm/public/hooks/mutations/useDeleteUsageSnapshotMutation.d.ts +38 -0
  74. package/esm/public/hooks/mutations/useDeleteUsageSnapshotMutation.js +36 -0
  75. package/esm/public/hooks/mutations/useUpdateUsageSnapshotMutation.d.ts +40 -0
  76. package/esm/public/hooks/mutations/useUpdateUsageSnapshotMutation.js +37 -0
  77. package/esm/public/hooks/queries/index.d.ts +2 -0
  78. package/esm/public/hooks/queries/index.js +2 -0
  79. package/esm/public/hooks/queries/useUsageSnapshotQuery.d.ts +65 -0
  80. package/esm/public/hooks/queries/useUsageSnapshotQuery.js +47 -0
  81. package/esm/public/hooks/queries/useUsageSnapshotsQuery.d.ts +69 -0
  82. package/esm/public/hooks/queries/useUsageSnapshotsQuery.js +32 -0
  83. package/esm/public/hooks/query-keys.d.ts +14 -0
  84. package/esm/public/hooks/query-keys.js +8 -0
  85. package/esm/public/orm/index.d.ts +2 -0
  86. package/esm/public/orm/index.js +2 -0
  87. package/esm/public/orm/input-types.d.ts +129 -0
  88. package/esm/public/orm/models/index.d.ts +1 -0
  89. package/esm/public/orm/models/index.js +1 -0
  90. package/esm/public/orm/models/usageSnapshot.d.ts +56 -0
  91. package/esm/public/orm/models/usageSnapshot.js +96 -0
  92. package/esm/public/schema-types.d.ts +379 -282
  93. package/esm/public/types.d.ts +8 -0
  94. package/package.json +6 -6
  95. package/public/hooks/index.d.ts +1 -1
  96. package/public/hooks/index.js +1 -1
  97. package/public/hooks/invalidation.d.ts +6 -0
  98. package/public/hooks/invalidation.js +16 -0
  99. package/public/hooks/mutation-keys.d.ts +12 -0
  100. package/public/hooks/mutation-keys.js +9 -1
  101. package/public/hooks/mutations/index.d.ts +3 -0
  102. package/public/hooks/mutations/index.js +3 -0
  103. package/public/hooks/mutations/useCreateUsageSnapshotMutation.d.ts +34 -0
  104. package/public/hooks/mutations/useCreateUsageSnapshotMutation.js +34 -0
  105. package/public/hooks/mutations/useDeleteUsageSnapshotMutation.d.ts +38 -0
  106. package/public/hooks/mutations/useDeleteUsageSnapshotMutation.js +39 -0
  107. package/public/hooks/mutations/useUpdateUsageSnapshotMutation.d.ts +40 -0
  108. package/public/hooks/mutations/useUpdateUsageSnapshotMutation.js +40 -0
  109. package/public/hooks/queries/index.d.ts +2 -0
  110. package/public/hooks/queries/index.js +2 -0
  111. package/public/hooks/queries/useUsageSnapshotQuery.d.ts +65 -0
  112. package/public/hooks/queries/useUsageSnapshotQuery.js +53 -0
  113. package/public/hooks/queries/useUsageSnapshotsQuery.d.ts +69 -0
  114. package/public/hooks/queries/useUsageSnapshotsQuery.js +38 -0
  115. package/public/hooks/query-keys.d.ts +14 -0
  116. package/public/hooks/query-keys.js +10 -1
  117. package/public/orm/index.d.ts +2 -0
  118. package/public/orm/index.js +2 -0
  119. package/public/orm/input-types.d.ts +129 -0
  120. package/public/orm/models/index.d.ts +1 -0
  121. package/public/orm/models/index.js +3 -1
  122. package/public/orm/models/usageSnapshot.d.ts +56 -0
  123. package/public/orm/models/usageSnapshot.js +100 -0
  124. package/public/schema-types.d.ts +379 -282
  125. package/public/types.d.ts +8 -0
@@ -2,7 +2,7 @@
2
2
  * GraphQL SDK
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  *
5
- * Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, GetAllRecord, AppPermission, OrgPermission, Object, AppLevelRequirement, Database, Schema, Table, CheckConstraint, Field, SpatialRelation, Partition, ForeignKeyConstraint, FullTextSearch, Index, Policy, PrimaryKeyConstraint, TableGrant, Trigger, UniqueConstraint, View, ViewTable, ViewGrant, ViewRule, EmbeddingChunk, SecureTableProvision, RelationProvision, SessionSecretsModule, IdentityProvidersModule, RealtimeModule, SchemaGrant, DefaultPrivilege, Enum, Function, ApiSchema, ApiModule, Domain, SiteMetadatum, SiteModule, SiteTheme, CorsSetting, TriggerFunction, DatabaseTransfer, Api, Site, App, ApiSetting, ConnectedAccountsModule, CryptoAddressesModule, CryptoAuthModule, DefaultIdsModule, DenormalizedTableField, EmailsModule, EncryptedSecretsModule, InvitesModule, LevelsModule, LimitsModule, MembershipTypesModule, MembershipsModule, PermissionsModule, PhoneNumbersModule, ProfilesModule, SecretsModule, SessionsModule, UserAuthModule, UsersModule, Blueprint, BlueprintTemplate, BlueprintConstruction, StorageModule, EntityTypeProvision, WebauthnCredentialsModule, WebauthnAuthModule, NotificationsModule, DatabaseProvisionModule, AppAdminGrant, AppOwnerGrant, AppGrant, OrgMembership, OrgMember, OrgAdminGrant, OrgOwnerGrant, OrgMemberProfile, OrgGrant, OrgChartEdge, OrgChartEdgeGrant, OrgPermissionDefault, AppLimit, AppLimitCredit, AppLimitCreditCodeItem, AppLimitCreditRedemption, OrgLimit, OrgLimitCredit, OrgLimitAggregate, AppStep, AppAchievement, AppLevel, Email, PhoneNumber, CryptoAddress, WebauthnCredential, AppInvite, AppClaimedInvite, OrgInvite, OrgClaimedInvite, AuditLog, AgentThread, AgentMessage, AgentTask, RoleType, IdentityProvider, Ref, Store, AppPermissionDefault, AppLimitCreditCode, AppLimitCapsDefault, OrgLimitCapsDefault, AppLimitCap, OrgLimitCap, MembershipType, MigrateFile, DevicesModule, NodeTypeRegistry, AppLimitDefault, OrgLimitDefault, UserConnectedAccount, Commit, PubkeySetting, RateLimitsModule, AppMembershipDefault, OrgMembershipDefault, RlsSetting, AppLimitEvent, OrgLimitEvent, RlsModule, DatabaseSetting, PlansModule, SqlAction, BillingModule, AstMigration, User, OrgMembershipSetting, WebauthnSetting, AppMembership, BillingProviderModule, HierarchyModule
5
+ * Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, GetAllRecord, AppPermission, OrgPermission, Object, AppLevelRequirement, Database, Schema, Table, CheckConstraint, Field, SpatialRelation, Partition, ForeignKeyConstraint, FullTextSearch, Index, Policy, PrimaryKeyConstraint, TableGrant, Trigger, UniqueConstraint, View, ViewTable, ViewGrant, ViewRule, EmbeddingChunk, SecureTableProvision, RelationProvision, SessionSecretsModule, IdentityProvidersModule, RealtimeModule, SchemaGrant, DefaultPrivilege, Enum, Function, ApiSchema, ApiModule, Domain, SiteMetadatum, SiteModule, SiteTheme, CorsSetting, TriggerFunction, DatabaseTransfer, Api, Site, App, ApiSetting, ConnectedAccountsModule, CryptoAddressesModule, CryptoAuthModule, DefaultIdsModule, DenormalizedTableField, EmailsModule, EncryptedSecretsModule, InvitesModule, LevelsModule, LimitsModule, MembershipTypesModule, MembershipsModule, PermissionsModule, PhoneNumbersModule, ProfilesModule, SecretsModule, SessionsModule, UserAuthModule, UsersModule, Blueprint, BlueprintTemplate, BlueprintConstruction, StorageModule, EntityTypeProvision, WebauthnCredentialsModule, WebauthnAuthModule, NotificationsModule, DatabaseProvisionModule, AppAdminGrant, AppOwnerGrant, AppGrant, OrgMembership, OrgMember, OrgAdminGrant, OrgOwnerGrant, OrgMemberProfile, OrgGrant, OrgChartEdge, OrgChartEdgeGrant, OrgPermissionDefault, AppLimit, AppLimitCredit, AppLimitCreditCodeItem, AppLimitCreditRedemption, OrgLimit, OrgLimitCredit, OrgLimitAggregate, AppStep, AppAchievement, AppLevel, Email, PhoneNumber, CryptoAddress, WebauthnCredential, AppInvite, AppClaimedInvite, OrgInvite, OrgClaimedInvite, AuditLog, AgentThread, AgentMessage, AgentTask, RoleType, IdentityProvider, Ref, Store, AppPermissionDefault, AppLimitCreditCode, AppLimitCapsDefault, OrgLimitCapsDefault, AppLimitCap, OrgLimitCap, MembershipType, MigrateFile, DevicesModule, NodeTypeRegistry, AppLimitDefault, OrgLimitDefault, UserConnectedAccount, Commit, PubkeySetting, RateLimitsModule, UsageSnapshot, AppMembershipDefault, OrgMembershipDefault, RlsSetting, AppLimitEvent, OrgLimitEvent, RlsModule, DatabaseSetting, PlansModule, SqlAction, BillingModule, AstMigration, User, OrgMembershipSetting, WebauthnSetting, AppMembership, BillingProviderModule, HierarchyModule
6
6
  *
7
7
  * Usage:
8
8
  *
@@ -679,6 +679,11 @@ export declare const invalidate: {
679
679
  /** Invalidate rateLimitsModule list queries */ readonly lists: (queryClient: QueryClient) => Promise<void>;
680
680
  /** Invalidate a specific rateLimitsModule */ readonly detail: (queryClient: QueryClient, id: string | number) => Promise<void>;
681
681
  };
682
+ /** Invalidate usageSnapshot queries */ readonly usageSnapshot: {
683
+ /** Invalidate all usageSnapshot queries */ readonly all: (queryClient: QueryClient) => Promise<void>;
684
+ /** Invalidate usageSnapshot list queries */ readonly lists: (queryClient: QueryClient) => Promise<void>;
685
+ /** Invalidate a specific usageSnapshot */ readonly detail: (queryClient: QueryClient, id: string | number) => Promise<void>;
686
+ };
682
687
  /** Invalidate appMembershipDefault queries */ readonly appMembershipDefault: {
683
688
  /** Invalidate all appMembershipDefault queries */ readonly all: (queryClient: QueryClient) => Promise<void>;
684
689
  /** Invalidate appMembershipDefault list queries */ readonly lists: (queryClient: QueryClient) => Promise<void>;
@@ -908,6 +913,7 @@ export declare const remove: {
908
913
  /** Remove commit from cache */ readonly commit: (queryClient: QueryClient, id: string | number) => void;
909
914
  /** Remove pubkeySetting from cache */ readonly pubkeySetting: (queryClient: QueryClient, id: string | number) => void;
910
915
  /** Remove rateLimitsModule from cache */ readonly rateLimitsModule: (queryClient: QueryClient, id: string | number) => void;
916
+ /** Remove usageSnapshot from cache */ readonly usageSnapshot: (queryClient: QueryClient, id: string | number) => void;
911
917
  /** Remove appMembershipDefault from cache */ readonly appMembershipDefault: (queryClient: QueryClient, id: string | number) => void;
912
918
  /** Remove orgMembershipDefault from cache */ readonly orgMembershipDefault: (queryClient: QueryClient, id: string | number) => void;
913
919
  /** Remove rlsSetting from cache */ readonly rlsSetting: (queryClient: QueryClient, id: string | number) => void;
@@ -3,7 +3,7 @@
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
6
- import { orgGetManagersRecordKeys, orgGetSubordinatesRecordKeys, getAllRecordKeys, appPermissionKeys, orgPermissionKeys, objectKeys, appLevelRequirementKeys, databaseKeys, schemaKeys, tableKeys, checkConstraintKeys, fieldKeys, spatialRelationKeys, partitionKeys, foreignKeyConstraintKeys, fullTextSearchKeys, indexKeys, policyKeys, primaryKeyConstraintKeys, tableGrantKeys, triggerKeys, uniqueConstraintKeys, viewKeys, viewTableKeys, viewGrantKeys, viewRuleKeys, embeddingChunkKeys, secureTableProvisionKeys, relationProvisionKeys, sessionSecretsModuleKeys, identityProvidersModuleKeys, realtimeModuleKeys, schemaGrantKeys, defaultPrivilegeKeys, enumKeys, functionKeys, apiSchemaKeys, apiModuleKeys, domainKeys, siteMetadatumKeys, siteModuleKeys, siteThemeKeys, corsSettingKeys, triggerFunctionKeys, databaseTransferKeys, apiKeys, siteKeys, appKeys, apiSettingKeys, connectedAccountsModuleKeys, cryptoAddressesModuleKeys, cryptoAuthModuleKeys, defaultIdsModuleKeys, denormalizedTableFieldKeys, emailsModuleKeys, encryptedSecretsModuleKeys, invitesModuleKeys, levelsModuleKeys, limitsModuleKeys, membershipTypesModuleKeys, membershipsModuleKeys, permissionsModuleKeys, phoneNumbersModuleKeys, profilesModuleKeys, secretsModuleKeys, sessionsModuleKeys, userAuthModuleKeys, usersModuleKeys, blueprintKeys, blueprintTemplateKeys, blueprintConstructionKeys, storageModuleKeys, entityTypeProvisionKeys, webauthnCredentialsModuleKeys, webauthnAuthModuleKeys, notificationsModuleKeys, databaseProvisionModuleKeys, appAdminGrantKeys, appOwnerGrantKeys, appGrantKeys, orgMembershipKeys, orgMemberKeys, orgAdminGrantKeys, orgOwnerGrantKeys, orgMemberProfileKeys, orgGrantKeys, orgChartEdgeKeys, orgChartEdgeGrantKeys, orgPermissionDefaultKeys, appLimitKeys, appLimitCreditKeys, appLimitCreditCodeItemKeys, appLimitCreditRedemptionKeys, orgLimitKeys, orgLimitCreditKeys, orgLimitAggregateKeys, appStepKeys, appAchievementKeys, appLevelKeys, emailKeys, phoneNumberKeys, cryptoAddressKeys, webauthnCredentialKeys, appInviteKeys, appClaimedInviteKeys, orgInviteKeys, orgClaimedInviteKeys, auditLogKeys, agentThreadKeys, agentMessageKeys, agentTaskKeys, roleTypeKeys, identityProviderKeys, refKeys, storeKeys, appPermissionDefaultKeys, appLimitCreditCodeKeys, appLimitCapsDefaultKeys, orgLimitCapsDefaultKeys, appLimitCapKeys, orgLimitCapKeys, membershipTypeKeys, migrateFileKeys, devicesModuleKeys, nodeTypeRegistryKeys, appLimitDefaultKeys, orgLimitDefaultKeys, userConnectedAccountKeys, commitKeys, pubkeySettingKeys, rateLimitsModuleKeys, appMembershipDefaultKeys, orgMembershipDefaultKeys, rlsSettingKeys, appLimitEventKeys, orgLimitEventKeys, rlsModuleKeys, databaseSettingKeys, plansModuleKeys, sqlActionKeys, billingModuleKeys, astMigrationKeys, userKeys, orgMembershipSettingKeys, webauthnSettingKeys, appMembershipKeys, billingProviderModuleKeys, hierarchyModuleKeys, } from './query-keys';
6
+ import { orgGetManagersRecordKeys, orgGetSubordinatesRecordKeys, getAllRecordKeys, appPermissionKeys, orgPermissionKeys, objectKeys, appLevelRequirementKeys, databaseKeys, schemaKeys, tableKeys, checkConstraintKeys, fieldKeys, spatialRelationKeys, partitionKeys, foreignKeyConstraintKeys, fullTextSearchKeys, indexKeys, policyKeys, primaryKeyConstraintKeys, tableGrantKeys, triggerKeys, uniqueConstraintKeys, viewKeys, viewTableKeys, viewGrantKeys, viewRuleKeys, embeddingChunkKeys, secureTableProvisionKeys, relationProvisionKeys, sessionSecretsModuleKeys, identityProvidersModuleKeys, realtimeModuleKeys, schemaGrantKeys, defaultPrivilegeKeys, enumKeys, functionKeys, apiSchemaKeys, apiModuleKeys, domainKeys, siteMetadatumKeys, siteModuleKeys, siteThemeKeys, corsSettingKeys, triggerFunctionKeys, databaseTransferKeys, apiKeys, siteKeys, appKeys, apiSettingKeys, connectedAccountsModuleKeys, cryptoAddressesModuleKeys, cryptoAuthModuleKeys, defaultIdsModuleKeys, denormalizedTableFieldKeys, emailsModuleKeys, encryptedSecretsModuleKeys, invitesModuleKeys, levelsModuleKeys, limitsModuleKeys, membershipTypesModuleKeys, membershipsModuleKeys, permissionsModuleKeys, phoneNumbersModuleKeys, profilesModuleKeys, secretsModuleKeys, sessionsModuleKeys, userAuthModuleKeys, usersModuleKeys, blueprintKeys, blueprintTemplateKeys, blueprintConstructionKeys, storageModuleKeys, entityTypeProvisionKeys, webauthnCredentialsModuleKeys, webauthnAuthModuleKeys, notificationsModuleKeys, databaseProvisionModuleKeys, appAdminGrantKeys, appOwnerGrantKeys, appGrantKeys, orgMembershipKeys, orgMemberKeys, orgAdminGrantKeys, orgOwnerGrantKeys, orgMemberProfileKeys, orgGrantKeys, orgChartEdgeKeys, orgChartEdgeGrantKeys, orgPermissionDefaultKeys, appLimitKeys, appLimitCreditKeys, appLimitCreditCodeItemKeys, appLimitCreditRedemptionKeys, orgLimitKeys, orgLimitCreditKeys, orgLimitAggregateKeys, appStepKeys, appAchievementKeys, appLevelKeys, emailKeys, phoneNumberKeys, cryptoAddressKeys, webauthnCredentialKeys, appInviteKeys, appClaimedInviteKeys, orgInviteKeys, orgClaimedInviteKeys, auditLogKeys, agentThreadKeys, agentMessageKeys, agentTaskKeys, roleTypeKeys, identityProviderKeys, refKeys, storeKeys, appPermissionDefaultKeys, appLimitCreditCodeKeys, appLimitCapsDefaultKeys, orgLimitCapsDefaultKeys, appLimitCapKeys, orgLimitCapKeys, membershipTypeKeys, migrateFileKeys, devicesModuleKeys, nodeTypeRegistryKeys, appLimitDefaultKeys, orgLimitDefaultKeys, userConnectedAccountKeys, commitKeys, pubkeySettingKeys, rateLimitsModuleKeys, usageSnapshotKeys, appMembershipDefaultKeys, orgMembershipDefaultKeys, rlsSettingKeys, appLimitEventKeys, orgLimitEventKeys, rlsModuleKeys, databaseSettingKeys, plansModuleKeys, sqlActionKeys, billingModuleKeys, astMigrationKeys, userKeys, orgMembershipSettingKeys, webauthnSettingKeys, appMembershipKeys, billingProviderModuleKeys, hierarchyModuleKeys, } from './query-keys';
7
7
  /**
8
8
  // ============================================================================
9
9
  // Invalidation Helpers
@@ -1465,6 +1465,17 @@ export const invalidate = {
1465
1465
  queryKey: rateLimitsModuleKeys.detail(id),
1466
1466
  }),
1467
1467
  },
1468
+ /** Invalidate usageSnapshot queries */ usageSnapshot: {
1469
+ /** Invalidate all usageSnapshot queries */ all: (queryClient) => queryClient.invalidateQueries({
1470
+ queryKey: usageSnapshotKeys.all,
1471
+ }),
1472
+ /** Invalidate usageSnapshot list queries */ lists: (queryClient) => queryClient.invalidateQueries({
1473
+ queryKey: usageSnapshotKeys.lists(),
1474
+ }),
1475
+ /** Invalidate a specific usageSnapshot */ detail: (queryClient, id) => queryClient.invalidateQueries({
1476
+ queryKey: usageSnapshotKeys.detail(id),
1477
+ }),
1478
+ },
1468
1479
  /** Invalidate appMembershipDefault queries */ appMembershipDefault: {
1469
1480
  /** Invalidate all appMembershipDefault queries */ all: (queryClient) => queryClient.invalidateQueries({
1470
1481
  queryKey: appMembershipDefaultKeys.all,
@@ -2320,6 +2331,11 @@ export const remove = {
2320
2331
  queryKey: rateLimitsModuleKeys.detail(id),
2321
2332
  });
2322
2333
  },
2334
+ /** Remove usageSnapshot from cache */ usageSnapshot: (queryClient, id) => {
2335
+ queryClient.removeQueries({
2336
+ queryKey: usageSnapshotKeys.detail(id),
2337
+ });
2338
+ },
2323
2339
  /** Remove appMembershipDefault from cache */ appMembershipDefault: (queryClient, id) => {
2324
2340
  queryClient.removeQueries({
2325
2341
  queryKey: appMembershipDefaultKeys.detail(id),
@@ -789,6 +789,12 @@ export declare const rateLimitsModuleMutationKeys: {
789
789
  /** Update rateLimitsModule mutation key */ readonly update: (id: string | number) => readonly ["mutation", "ratelimitsmodule", "update", string | number];
790
790
  /** Delete rateLimitsModule mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "ratelimitsmodule", "delete", string | number];
791
791
  };
792
+ export declare const usageSnapshotMutationKeys: {
793
+ /** All usageSnapshot mutation keys */ readonly all: readonly ["mutation", "usagesnapshot"];
794
+ /** Create usageSnapshot mutation key */ readonly create: () => readonly ["mutation", "usagesnapshot", "create"];
795
+ /** Update usageSnapshot mutation key */ readonly update: (id: string | number) => readonly ["mutation", "usagesnapshot", "update", string | number];
796
+ /** Delete usageSnapshot mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "usagesnapshot", "delete", string | number];
797
+ };
792
798
  export declare const appMembershipDefaultMutationKeys: {
793
799
  /** All appMembershipDefault mutation keys */ readonly all: readonly ["mutation", "appmembershipdefault"];
794
800
  /** Create appMembershipDefault mutation key */ readonly create: () => readonly ["mutation", "appmembershipdefault", "create"];
@@ -1750,6 +1756,12 @@ export declare const mutationKeys: {
1750
1756
  /** Update rateLimitsModule mutation key */ readonly update: (id: string | number) => readonly ["mutation", "ratelimitsmodule", "update", string | number];
1751
1757
  /** Delete rateLimitsModule mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "ratelimitsmodule", "delete", string | number];
1752
1758
  };
1759
+ readonly usageSnapshot: {
1760
+ /** All usageSnapshot mutation keys */ readonly all: readonly ["mutation", "usagesnapshot"];
1761
+ /** Create usageSnapshot mutation key */ readonly create: () => readonly ["mutation", "usagesnapshot", "create"];
1762
+ /** Update usageSnapshot mutation key */ readonly update: (id: string | number) => readonly ["mutation", "usagesnapshot", "update", string | number];
1763
+ /** Delete usageSnapshot mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "usagesnapshot", "delete", string | number];
1764
+ };
1753
1765
  readonly appMembershipDefault: {
1754
1766
  /** All appMembershipDefault mutation keys */ readonly all: readonly ["mutation", "appmembershipdefault"];
1755
1767
  /** Create appMembershipDefault mutation key */ readonly create: () => readonly ["mutation", "appmembershipdefault", "create"];
@@ -837,6 +837,12 @@ export const rateLimitsModuleMutationKeys = {
837
837
  /** Update rateLimitsModule mutation key */ update: (id) => ['mutation', 'ratelimitsmodule', 'update', id],
838
838
  /** Delete rateLimitsModule mutation key */ delete: (id) => ['mutation', 'ratelimitsmodule', 'delete', id],
839
839
  };
840
+ export const usageSnapshotMutationKeys = {
841
+ /** All usageSnapshot mutation keys */ all: ['mutation', 'usagesnapshot'],
842
+ /** Create usageSnapshot mutation key */ create: () => ['mutation', 'usagesnapshot', 'create'],
843
+ /** Update usageSnapshot mutation key */ update: (id) => ['mutation', 'usagesnapshot', 'update', id],
844
+ /** Delete usageSnapshot mutation key */ delete: (id) => ['mutation', 'usagesnapshot', 'delete', id],
845
+ };
840
846
  export const appMembershipDefaultMutationKeys = {
841
847
  /** All appMembershipDefault mutation keys */ all: ['mutation', 'appmembershipdefault'],
842
848
  /** Create appMembershipDefault mutation key */ create: () => ['mutation', 'appmembershipdefault', 'create'],
@@ -1241,6 +1247,7 @@ export const mutationKeys = {
1241
1247
  commit: commitMutationKeys,
1242
1248
  pubkeySetting: pubkeySettingMutationKeys,
1243
1249
  rateLimitsModule: rateLimitsModuleMutationKeys,
1250
+ usageSnapshot: usageSnapshotMutationKeys,
1244
1251
  appMembershipDefault: appMembershipDefaultMutationKeys,
1245
1252
  orgMembershipDefault: orgMembershipDefaultMutationKeys,
1246
1253
  rlsSetting: rlsSettingMutationKeys,
@@ -384,6 +384,9 @@ export * from './useDeletePubkeySettingMutation';
384
384
  export * from './useCreateRateLimitsModuleMutation';
385
385
  export * from './useUpdateRateLimitsModuleMutation';
386
386
  export * from './useDeleteRateLimitsModuleMutation';
387
+ export * from './useCreateUsageSnapshotMutation';
388
+ export * from './useUpdateUsageSnapshotMutation';
389
+ export * from './useDeleteUsageSnapshotMutation';
387
390
  export * from './useCreateAppMembershipDefaultMutation';
388
391
  export * from './useUpdateAppMembershipDefaultMutation';
389
392
  export * from './useDeleteAppMembershipDefaultMutation';
@@ -384,6 +384,9 @@ export * from './useDeletePubkeySettingMutation';
384
384
  export * from './useCreateRateLimitsModuleMutation';
385
385
  export * from './useUpdateRateLimitsModuleMutation';
386
386
  export * from './useDeleteRateLimitsModuleMutation';
387
+ export * from './useCreateUsageSnapshotMutation';
388
+ export * from './useUpdateUsageSnapshotMutation';
389
+ export * from './useDeleteUsageSnapshotMutation';
387
390
  export * from './useCreateAppMembershipDefaultMutation';
388
391
  export * from './useUpdateAppMembershipDefaultMutation';
389
392
  export * from './useDeleteAppMembershipDefaultMutation';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
7
+ import type { UsageSnapshotSelect, UsageSnapshotWithRelations, CreateUsageSnapshotInput } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { UsageSnapshotSelect, UsageSnapshotWithRelations, CreateUsageSnapshotInput, } from '../../orm/input-types';
10
+ /**
11
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const { mutate, isPending } = useCreateUsageSnapshotMutation({
16
+ * selection: { fields: { id: true, name: true } },
17
+ * });
18
+ *
19
+ * mutate({ name: 'New item' });
20
+ * ```
21
+ */
22
+ export declare function useCreateUsageSnapshotMutation<S extends UsageSnapshotSelect>(params: {
23
+ selection: {
24
+ fields: S & UsageSnapshotSelect;
25
+ } & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
26
+ } & Omit<UseMutationOptions<{
27
+ createUsageSnapshot: {
28
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
29
+ };
30
+ }, Error, CreateUsageSnapshotInput['usageSnapshot']>, 'mutationFn'>): UseMutationResult<{
31
+ createUsageSnapshot: {
32
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
33
+ };
34
+ }, Error, CreateUsageSnapshotInput['usageSnapshot']>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
7
+ import { getClient } from '../client';
8
+ import { buildSelectionArgs } from '../selection';
9
+ import { usageSnapshotKeys } from '../query-keys';
10
+ import { usageSnapshotMutationKeys } from '../mutation-keys';
11
+ export function useCreateUsageSnapshotMutation(params) {
12
+ const args = buildSelectionArgs(params.selection);
13
+ const { selection: _selection, ...mutationOptions } = params ?? {};
14
+ void _selection;
15
+ const queryClient = useQueryClient();
16
+ return useMutation({
17
+ mutationKey: usageSnapshotMutationKeys.create(),
18
+ mutationFn: (data) => getClient()
19
+ .usageSnapshot.create({
20
+ data,
21
+ select: args.select,
22
+ })
23
+ .unwrap(),
24
+ onSuccess: () => {
25
+ queryClient.invalidateQueries({
26
+ queryKey: usageSnapshotKeys.lists(),
27
+ });
28
+ },
29
+ ...mutationOptions,
30
+ });
31
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
7
+ import type { UsageSnapshotSelect, UsageSnapshotWithRelations } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { UsageSnapshotSelect, UsageSnapshotWithRelations } from '../../orm/input-types';
10
+ /**
11
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const { mutate, isPending } = useDeleteUsageSnapshotMutation({
16
+ * selection: { fields: { id: true } },
17
+ * });
18
+ *
19
+ * mutate({ id: 'value-to-delete' });
20
+ * ```
21
+ */
22
+ export declare function useDeleteUsageSnapshotMutation<S extends UsageSnapshotSelect>(params: {
23
+ selection: {
24
+ fields: S & UsageSnapshotSelect;
25
+ } & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
26
+ } & Omit<UseMutationOptions<{
27
+ deleteUsageSnapshot: {
28
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
29
+ };
30
+ }, Error, {
31
+ id: string;
32
+ }>, 'mutationFn'>): UseMutationResult<{
33
+ deleteUsageSnapshot: {
34
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
35
+ };
36
+ }, Error, {
37
+ id: string;
38
+ }>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
7
+ import { getClient } from '../client';
8
+ import { buildSelectionArgs } from '../selection';
9
+ import { usageSnapshotKeys } from '../query-keys';
10
+ import { usageSnapshotMutationKeys } from '../mutation-keys';
11
+ export function useDeleteUsageSnapshotMutation(params) {
12
+ const args = buildSelectionArgs(params.selection);
13
+ const { selection: _selection, ...mutationOptions } = params ?? {};
14
+ void _selection;
15
+ const queryClient = useQueryClient();
16
+ return useMutation({
17
+ mutationKey: usageSnapshotMutationKeys.all,
18
+ mutationFn: ({ id }) => getClient()
19
+ .usageSnapshot.delete({
20
+ where: {
21
+ id,
22
+ },
23
+ select: args.select,
24
+ })
25
+ .unwrap(),
26
+ onSuccess: (_, variables) => {
27
+ queryClient.removeQueries({
28
+ queryKey: usageSnapshotKeys.detail(variables.id),
29
+ });
30
+ queryClient.invalidateQueries({
31
+ queryKey: usageSnapshotKeys.lists(),
32
+ });
33
+ },
34
+ ...mutationOptions,
35
+ });
36
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
7
+ import type { UsageSnapshotSelect, UsageSnapshotWithRelations, UsageSnapshotPatch } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { UsageSnapshotSelect, UsageSnapshotWithRelations, UsageSnapshotPatch, } from '../../orm/input-types';
10
+ /**
11
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const { mutate, isPending } = useUpdateUsageSnapshotMutation({
16
+ * selection: { fields: { id: true, name: true } },
17
+ * });
18
+ *
19
+ * mutate({ id: 'value-here', usageSnapshotPatch: { name: 'Updated' } });
20
+ * ```
21
+ */
22
+ export declare function useUpdateUsageSnapshotMutation<S extends UsageSnapshotSelect>(params: {
23
+ selection: {
24
+ fields: S & UsageSnapshotSelect;
25
+ } & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
26
+ } & Omit<UseMutationOptions<{
27
+ updateUsageSnapshot: {
28
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
29
+ };
30
+ }, Error, {
31
+ id: string;
32
+ usageSnapshotPatch: UsageSnapshotPatch;
33
+ }>, 'mutationFn'>): UseMutationResult<{
34
+ updateUsageSnapshot: {
35
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
36
+ };
37
+ }, Error, {
38
+ id: string;
39
+ usageSnapshotPatch: UsageSnapshotPatch;
40
+ }>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
7
+ import { getClient } from '../client';
8
+ import { buildSelectionArgs } from '../selection';
9
+ import { usageSnapshotKeys } from '../query-keys';
10
+ import { usageSnapshotMutationKeys } from '../mutation-keys';
11
+ export function useUpdateUsageSnapshotMutation(params) {
12
+ const args = buildSelectionArgs(params.selection);
13
+ const { selection: _selection, ...mutationOptions } = params ?? {};
14
+ void _selection;
15
+ const queryClient = useQueryClient();
16
+ return useMutation({
17
+ mutationKey: usageSnapshotMutationKeys.all,
18
+ mutationFn: ({ id, usageSnapshotPatch, }) => getClient()
19
+ .usageSnapshot.update({
20
+ where: {
21
+ id,
22
+ },
23
+ data: usageSnapshotPatch,
24
+ select: args.select,
25
+ })
26
+ .unwrap(),
27
+ onSuccess: (_, variables) => {
28
+ queryClient.invalidateQueries({
29
+ queryKey: usageSnapshotKeys.detail(variables.id),
30
+ });
31
+ queryClient.invalidateQueries({
32
+ queryKey: usageSnapshotKeys.lists(),
33
+ });
34
+ },
35
+ ...mutationOptions,
36
+ });
37
+ }
@@ -261,6 +261,8 @@ export * from './usePubkeySettingsQuery';
261
261
  export * from './usePubkeySettingQuery';
262
262
  export * from './useRateLimitsModulesQuery';
263
263
  export * from './useRateLimitsModuleQuery';
264
+ export * from './useUsageSnapshotsQuery';
265
+ export * from './useUsageSnapshotQuery';
264
266
  export * from './useAppMembershipDefaultsQuery';
265
267
  export * from './useAppMembershipDefaultQuery';
266
268
  export * from './useOrgMembershipDefaultsQuery';
@@ -261,6 +261,8 @@ export * from './usePubkeySettingsQuery';
261
261
  export * from './usePubkeySettingQuery';
262
262
  export * from './useRateLimitsModulesQuery';
263
263
  export * from './useRateLimitsModuleQuery';
264
+ export * from './useUsageSnapshotsQuery';
265
+ export * from './useUsageSnapshotQuery';
264
266
  export * from './useAppMembershipDefaultsQuery';
265
267
  export * from './useAppMembershipDefaultQuery';
266
268
  export * from './useOrgMembershipDefaultsQuery';
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
7
+ import type { UsageSnapshotSelect, UsageSnapshotWithRelations } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { UsageSnapshotSelect, UsageSnapshotWithRelations } from '../../orm/input-types';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export declare const usageSnapshotQueryKey: (id: string | number) => readonly ["usagesnapshot", "detail", string | number];
12
+ /**
13
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * const { data, isLoading } = useUsageSnapshotQuery({
18
+ * id: 'some-id',
19
+ * selection: { fields: { id: true, name: true } },
20
+ * });
21
+ * ```
22
+ */
23
+ export declare function useUsageSnapshotQuery<S extends UsageSnapshotSelect, TData = {
24
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S> | null;
25
+ }>(params: {
26
+ id: string;
27
+ selection: {
28
+ fields: S;
29
+ } & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
30
+ } & Omit<UseQueryOptions<{
31
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S> | null;
32
+ }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
33
+ /**
34
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const data = await fetchUsageSnapshotQuery({
39
+ * id: 'some-id',
40
+ * selection: { fields: { id: true } },
41
+ * });
42
+ * ```
43
+ */
44
+ export declare function fetchUsageSnapshotQuery<S extends UsageSnapshotSelect>(params: {
45
+ id: string;
46
+ selection: {
47
+ fields: S;
48
+ } & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
49
+ }): Promise<{
50
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S> | null;
51
+ }>;
52
+ /**
53
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * await prefetchUsageSnapshotQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } });
58
+ * ```
59
+ */
60
+ export declare function prefetchUsageSnapshotQuery<S extends UsageSnapshotSelect>(queryClient: QueryClient, params: {
61
+ id: string;
62
+ selection: {
63
+ fields: S;
64
+ } & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
65
+ }): Promise<void>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { useQuery } from '@tanstack/react-query';
7
+ import { getClient } from '../client';
8
+ import { buildSelectionArgs } from '../selection';
9
+ import { usageSnapshotKeys } from '../query-keys';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export const usageSnapshotQueryKey = usageSnapshotKeys.detail;
12
+ export function useUsageSnapshotQuery(params) {
13
+ const args = buildSelectionArgs(params.selection);
14
+ const { selection: _selection, ...queryOptions } = params ?? {};
15
+ void _selection;
16
+ return useQuery({
17
+ queryKey: usageSnapshotKeys.detail(params.id),
18
+ queryFn: () => getClient()
19
+ .usageSnapshot.findOne({
20
+ id: params.id,
21
+ select: args.select,
22
+ })
23
+ .unwrap(),
24
+ ...queryOptions,
25
+ });
26
+ }
27
+ export async function fetchUsageSnapshotQuery(params) {
28
+ const args = buildSelectionArgs(params.selection);
29
+ return getClient()
30
+ .usageSnapshot.findOne({
31
+ id: params.id,
32
+ select: args.select,
33
+ })
34
+ .unwrap();
35
+ }
36
+ export async function prefetchUsageSnapshotQuery(queryClient, params) {
37
+ const args = buildSelectionArgs(params.selection);
38
+ await queryClient.prefetchQuery({
39
+ queryKey: usageSnapshotKeys.detail(params.id),
40
+ queryFn: () => getClient()
41
+ .usageSnapshot.findOne({
42
+ id: params.id,
43
+ select: args.select,
44
+ })
45
+ .unwrap(),
46
+ });
47
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
7
+ import type { ListSelectionConfig } from '../selection';
8
+ import type { UsageSnapshotSelect, UsageSnapshotWithRelations, UsageSnapshotFilter, UsageSnapshotOrderBy } from '../../orm/input-types';
9
+ import type { InferSelectResult, ConnectionResult, HookStrictSelect } from '../../orm/select-types';
10
+ export type { UsageSnapshotSelect, UsageSnapshotWithRelations, UsageSnapshotFilter, UsageSnapshotOrderBy, } from '../../orm/input-types';
11
+ /** Query key factory - re-exported from query-keys.ts */
12
+ export declare const usageSnapshotsQueryKey: (variables?: object) => readonly ["usagesnapshot", "list", object];
13
+ /**
14
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const { data, isLoading } = useUsageSnapshotsQuery({
19
+ * selection: {
20
+ * fields: { id: true, name: true },
21
+ * where: { name: { equalTo: "example" } },
22
+ * orderBy: ['CREATED_AT_DESC'],
23
+ * first: 10,
24
+ * },
25
+ * });
26
+ * ```
27
+ */
28
+ export declare function useUsageSnapshotsQuery<S extends UsageSnapshotSelect, TData = {
29
+ usageSnapshots: ConnectionResult<InferSelectResult<UsageSnapshotWithRelations, S>>;
30
+ }>(params: {
31
+ selection: {
32
+ fields: S;
33
+ } & Omit<ListSelectionConfig<S, UsageSnapshotFilter, UsageSnapshotOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
34
+ } & Omit<UseQueryOptions<{
35
+ usageSnapshots: ConnectionResult<InferSelectResult<UsageSnapshotWithRelations, S>>;
36
+ }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
37
+ /**
38
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const data = await fetchUsageSnapshotsQuery({
43
+ * selection: {
44
+ * fields: { id: true },
45
+ * first: 10,
46
+ * },
47
+ * });
48
+ * ```
49
+ */
50
+ export declare function fetchUsageSnapshotsQuery<S extends UsageSnapshotSelect>(params: {
51
+ selection: {
52
+ fields: S;
53
+ } & Omit<ListSelectionConfig<S, UsageSnapshotFilter, UsageSnapshotOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
54
+ }): Promise<{
55
+ usageSnapshots: ConnectionResult<InferSelectResult<UsageSnapshotWithRelations, S>>;
56
+ }>;
57
+ /**
58
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * await prefetchUsageSnapshotsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } });
63
+ * ```
64
+ */
65
+ export declare function prefetchUsageSnapshotsQuery<S extends UsageSnapshotSelect>(queryClient: QueryClient, params: {
66
+ selection: {
67
+ fields: S;
68
+ } & Omit<ListSelectionConfig<S, UsageSnapshotFilter, UsageSnapshotOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
69
+ }): Promise<void>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { useQuery } from '@tanstack/react-query';
7
+ import { getClient } from '../client';
8
+ import { buildListSelectionArgs } from '../selection';
9
+ import { usageSnapshotKeys } from '../query-keys';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export const usageSnapshotsQueryKey = usageSnapshotKeys.list;
12
+ export function useUsageSnapshotsQuery(params) {
13
+ const args = buildListSelectionArgs(params.selection);
14
+ const { selection: _selection, ...queryOptions } = params ?? {};
15
+ void _selection;
16
+ return useQuery({
17
+ queryKey: usageSnapshotKeys.list(args),
18
+ queryFn: () => getClient().usageSnapshot.findMany(args).unwrap(),
19
+ ...queryOptions,
20
+ });
21
+ }
22
+ export async function fetchUsageSnapshotsQuery(params) {
23
+ const args = buildListSelectionArgs(params.selection);
24
+ return getClient().usageSnapshot.findMany(args).unwrap();
25
+ }
26
+ export async function prefetchUsageSnapshotsQuery(queryClient, params) {
27
+ const args = buildListSelectionArgs(params.selection);
28
+ await queryClient.prefetchQuery({
29
+ queryKey: usageSnapshotKeys.list(args),
30
+ queryFn: () => getClient().usageSnapshot.findMany(args).unwrap(),
31
+ });
32
+ }