@constructive-io/react 0.18.9 → 0.19.0

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
@@ -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,38 @@
1
+ "use strict";
2
+ /**
3
+ * 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.
4
+ * @generated by @constructive-io/graphql-codegen
5
+ * DO NOT EDIT - changes will be overwritten
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.usageSnapshotsQueryKey = void 0;
9
+ exports.useUsageSnapshotsQuery = useUsageSnapshotsQuery;
10
+ exports.fetchUsageSnapshotsQuery = fetchUsageSnapshotsQuery;
11
+ exports.prefetchUsageSnapshotsQuery = prefetchUsageSnapshotsQuery;
12
+ const react_query_1 = require("@tanstack/react-query");
13
+ const client_1 = require("../client");
14
+ const selection_1 = require("../selection");
15
+ const query_keys_1 = require("../query-keys");
16
+ /** Query key factory - re-exported from query-keys.ts */
17
+ exports.usageSnapshotsQueryKey = query_keys_1.usageSnapshotKeys.list;
18
+ function useUsageSnapshotsQuery(params) {
19
+ const args = (0, selection_1.buildListSelectionArgs)(params.selection);
20
+ const { selection: _selection, ...queryOptions } = params ?? {};
21
+ void _selection;
22
+ return (0, react_query_1.useQuery)({
23
+ queryKey: query_keys_1.usageSnapshotKeys.list(args),
24
+ queryFn: () => (0, client_1.getClient)().usageSnapshot.findMany(args).unwrap(),
25
+ ...queryOptions,
26
+ });
27
+ }
28
+ async function fetchUsageSnapshotsQuery(params) {
29
+ const args = (0, selection_1.buildListSelectionArgs)(params.selection);
30
+ return (0, client_1.getClient)().usageSnapshot.findMany(args).unwrap();
31
+ }
32
+ async function prefetchUsageSnapshotsQuery(queryClient, params) {
33
+ const args = (0, selection_1.buildListSelectionArgs)(params.selection);
34
+ await queryClient.prefetchQuery({
35
+ queryKey: query_keys_1.usageSnapshotKeys.list(args),
36
+ queryFn: () => (0, client_1.getClient)().usageSnapshot.findMany(args).unwrap(),
37
+ });
38
+ }
@@ -920,6 +920,13 @@ export declare const rateLimitsModuleKeys: {
920
920
  /** Detail query keys */ readonly details: () => readonly ["ratelimitsmodule", "detail"];
921
921
  /** Detail query key for specific item */ readonly detail: (id: string | number) => readonly ["ratelimitsmodule", "detail", string | number];
922
922
  };
923
+ export declare const usageSnapshotKeys: {
924
+ /** All usageSnapshot queries */ readonly all: readonly ["usagesnapshot"];
925
+ /** List query keys */ readonly lists: () => readonly ["usagesnapshot", "list"];
926
+ /** List query key with variables */ readonly list: (variables?: object) => readonly ["usagesnapshot", "list", object];
927
+ /** Detail query keys */ readonly details: () => readonly ["usagesnapshot", "detail"];
928
+ /** Detail query key for specific item */ readonly detail: (id: string | number) => readonly ["usagesnapshot", "detail", string | number];
929
+ };
923
930
  export declare const appMembershipDefaultKeys: {
924
931
  /** All appMembershipDefault queries */ readonly all: readonly ["appmembershipdefault"];
925
932
  /** List query keys */ readonly lists: () => readonly ["appmembershipdefault", "list"];
@@ -2003,6 +2010,13 @@ export declare const queryKeys: {
2003
2010
  /** Detail query keys */ readonly details: () => readonly ["ratelimitsmodule", "detail"];
2004
2011
  /** Detail query key for specific item */ readonly detail: (id: string | number) => readonly ["ratelimitsmodule", "detail", string | number];
2005
2012
  };
2013
+ readonly usageSnapshot: {
2014
+ /** All usageSnapshot queries */ readonly all: readonly ["usagesnapshot"];
2015
+ /** List query keys */ readonly lists: () => readonly ["usagesnapshot", "list"];
2016
+ /** List query key with variables */ readonly list: (variables?: object) => readonly ["usagesnapshot", "list", object];
2017
+ /** Detail query keys */ readonly details: () => readonly ["usagesnapshot", "detail"];
2018
+ /** Detail query key for specific item */ readonly detail: (id: string | number) => readonly ["usagesnapshot", "detail", string | number];
2019
+ };
2006
2020
  readonly appMembershipDefault: {
2007
2021
  /** All appMembershipDefault queries */ readonly all: readonly ["appmembershipdefault"];
2008
2022
  /** List query keys */ readonly lists: () => readonly ["appmembershipdefault", "list"];
@@ -7,7 +7,8 @@
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.connectedAccountsModuleKeys = exports.apiSettingKeys = exports.appKeys = exports.siteKeys = exports.apiKeys = exports.databaseTransferKeys = exports.triggerFunctionKeys = exports.corsSettingKeys = exports.siteThemeKeys = exports.siteModuleKeys = exports.siteMetadatumKeys = exports.domainKeys = exports.apiModuleKeys = exports.apiSchemaKeys = exports.functionKeys = exports.enumKeys = exports.defaultPrivilegeKeys = exports.schemaGrantKeys = exports.realtimeModuleKeys = exports.identityProvidersModuleKeys = exports.sessionSecretsModuleKeys = exports.relationProvisionKeys = exports.secureTableProvisionKeys = exports.embeddingChunkKeys = exports.viewRuleKeys = exports.viewGrantKeys = exports.viewTableKeys = exports.viewKeys = exports.uniqueConstraintKeys = exports.triggerKeys = exports.tableGrantKeys = exports.primaryKeyConstraintKeys = exports.policyKeys = exports.indexKeys = exports.fullTextSearchKeys = exports.foreignKeyConstraintKeys = exports.partitionKeys = exports.spatialRelationKeys = exports.fieldKeys = exports.checkConstraintKeys = exports.tableKeys = exports.schemaKeys = exports.databaseKeys = exports.appLevelRequirementKeys = exports.objectKeys = exports.orgPermissionKeys = exports.appPermissionKeys = exports.getAllRecordKeys = exports.orgGetSubordinatesRecordKeys = exports.orgGetManagersRecordKeys = void 0;
9
9
  exports.emailKeys = exports.appLevelKeys = exports.appAchievementKeys = exports.appStepKeys = exports.orgLimitAggregateKeys = exports.orgLimitCreditKeys = exports.orgLimitKeys = exports.appLimitCreditRedemptionKeys = exports.appLimitCreditCodeItemKeys = exports.appLimitCreditKeys = exports.appLimitKeys = exports.orgPermissionDefaultKeys = exports.orgChartEdgeGrantKeys = exports.orgChartEdgeKeys = exports.orgGrantKeys = exports.orgMemberProfileKeys = exports.orgOwnerGrantKeys = exports.orgAdminGrantKeys = exports.orgMemberKeys = exports.orgMembershipKeys = exports.appGrantKeys = exports.appOwnerGrantKeys = exports.appAdminGrantKeys = exports.databaseProvisionModuleKeys = exports.notificationsModuleKeys = exports.webauthnAuthModuleKeys = exports.webauthnCredentialsModuleKeys = exports.entityTypeProvisionKeys = exports.storageModuleKeys = exports.blueprintConstructionKeys = exports.blueprintTemplateKeys = exports.blueprintKeys = exports.usersModuleKeys = exports.userAuthModuleKeys = exports.sessionsModuleKeys = exports.secretsModuleKeys = exports.profilesModuleKeys = exports.phoneNumbersModuleKeys = exports.permissionsModuleKeys = exports.membershipsModuleKeys = exports.membershipTypesModuleKeys = exports.limitsModuleKeys = exports.levelsModuleKeys = exports.invitesModuleKeys = exports.encryptedSecretsModuleKeys = exports.emailsModuleKeys = exports.denormalizedTableFieldKeys = exports.defaultIdsModuleKeys = exports.cryptoAuthModuleKeys = exports.cryptoAddressesModuleKeys = void 0;
10
- exports.queryKeys = exports.customQueryKeys = exports.hierarchyModuleKeys = exports.billingProviderModuleKeys = exports.appMembershipKeys = exports.webauthnSettingKeys = exports.orgMembershipSettingKeys = exports.userKeys = exports.astMigrationKeys = exports.billingModuleKeys = exports.sqlActionKeys = exports.plansModuleKeys = exports.databaseSettingKeys = exports.rlsModuleKeys = exports.orgLimitEventKeys = exports.appLimitEventKeys = exports.rlsSettingKeys = exports.orgMembershipDefaultKeys = exports.appMembershipDefaultKeys = exports.rateLimitsModuleKeys = exports.pubkeySettingKeys = exports.commitKeys = exports.userConnectedAccountKeys = exports.orgLimitDefaultKeys = exports.appLimitDefaultKeys = exports.nodeTypeRegistryKeys = exports.devicesModuleKeys = exports.migrateFileKeys = exports.membershipTypeKeys = exports.orgLimitCapKeys = exports.appLimitCapKeys = exports.orgLimitCapsDefaultKeys = exports.appLimitCapsDefaultKeys = exports.appLimitCreditCodeKeys = exports.appPermissionDefaultKeys = exports.storeKeys = exports.refKeys = exports.identityProviderKeys = exports.roleTypeKeys = exports.agentTaskKeys = exports.agentMessageKeys = exports.agentThreadKeys = exports.auditLogKeys = exports.orgClaimedInviteKeys = exports.orgInviteKeys = exports.appClaimedInviteKeys = exports.appInviteKeys = exports.webauthnCredentialKeys = exports.cryptoAddressKeys = exports.phoneNumberKeys = void 0;
10
+ exports.customQueryKeys = exports.hierarchyModuleKeys = exports.billingProviderModuleKeys = exports.appMembershipKeys = exports.webauthnSettingKeys = exports.orgMembershipSettingKeys = exports.userKeys = exports.astMigrationKeys = exports.billingModuleKeys = exports.sqlActionKeys = exports.plansModuleKeys = exports.databaseSettingKeys = exports.rlsModuleKeys = exports.orgLimitEventKeys = exports.appLimitEventKeys = exports.rlsSettingKeys = exports.orgMembershipDefaultKeys = exports.appMembershipDefaultKeys = exports.usageSnapshotKeys = exports.rateLimitsModuleKeys = exports.pubkeySettingKeys = exports.commitKeys = exports.userConnectedAccountKeys = exports.orgLimitDefaultKeys = exports.appLimitDefaultKeys = exports.nodeTypeRegistryKeys = exports.devicesModuleKeys = exports.migrateFileKeys = exports.membershipTypeKeys = exports.orgLimitCapKeys = exports.appLimitCapKeys = exports.orgLimitCapsDefaultKeys = exports.appLimitCapsDefaultKeys = exports.appLimitCreditCodeKeys = exports.appPermissionDefaultKeys = exports.storeKeys = exports.refKeys = exports.identityProviderKeys = exports.roleTypeKeys = exports.agentTaskKeys = exports.agentMessageKeys = exports.agentThreadKeys = exports.auditLogKeys = exports.orgClaimedInviteKeys = exports.orgInviteKeys = exports.appClaimedInviteKeys = exports.appInviteKeys = exports.webauthnCredentialKeys = exports.cryptoAddressKeys = exports.phoneNumberKeys = void 0;
11
+ exports.queryKeys = void 0;
11
12
  // ============================================================================
12
13
  // This file provides a centralized, type-safe query key factory following
13
14
  // the lukemorales query-key-factory pattern for React Query.
@@ -938,6 +939,13 @@ exports.rateLimitsModuleKeys = {
938
939
  /** Detail query keys */ details: () => [...exports.rateLimitsModuleKeys.all, 'detail'],
939
940
  /** Detail query key for specific item */ detail: (id) => [...exports.rateLimitsModuleKeys.details(), id],
940
941
  };
942
+ exports.usageSnapshotKeys = {
943
+ /** All usageSnapshot queries */ all: ['usagesnapshot'],
944
+ /** List query keys */ lists: () => [...exports.usageSnapshotKeys.all, 'list'],
945
+ /** List query key with variables */ list: (variables) => [...exports.usageSnapshotKeys.lists(), variables],
946
+ /** Detail query keys */ details: () => [...exports.usageSnapshotKeys.all, 'detail'],
947
+ /** Detail query key for specific item */ detail: (id) => [...exports.usageSnapshotKeys.details(), id],
948
+ };
941
949
  exports.appMembershipDefaultKeys = {
942
950
  /** All appMembershipDefault queries */ all: ['appmembershipdefault'],
943
951
  /** List query keys */ lists: () => [...exports.appMembershipDefaultKeys.all, 'list'],
@@ -1238,6 +1246,7 @@ exports.queryKeys = {
1238
1246
  commit: exports.commitKeys,
1239
1247
  pubkeySetting: exports.pubkeySettingKeys,
1240
1248
  rateLimitsModule: exports.rateLimitsModuleKeys,
1249
+ usageSnapshot: exports.usageSnapshotKeys,
1241
1250
  appMembershipDefault: exports.appMembershipDefaultKeys,
1242
1251
  orgMembershipDefault: exports.orgMembershipDefaultKeys,
1243
1252
  rlsSetting: exports.rlsSettingKeys,
@@ -130,6 +130,7 @@ import { UserConnectedAccountModel } from './models/userConnectedAccount';
130
130
  import { CommitModel } from './models/commit';
131
131
  import { PubkeySettingModel } from './models/pubkeySetting';
132
132
  import { RateLimitsModuleModel } from './models/rateLimitsModule';
133
+ import { UsageSnapshotModel } from './models/usageSnapshot';
133
134
  import { AppMembershipDefaultModel } from './models/appMembershipDefault';
134
135
  import { OrgMembershipDefaultModel } from './models/orgMembershipDefault';
135
136
  import { RlsSettingModel } from './models/rlsSetting';
@@ -309,6 +310,7 @@ export declare function createClient(config: OrmClientConfig): {
309
310
  commit: CommitModel;
310
311
  pubkeySetting: PubkeySettingModel;
311
312
  rateLimitsModule: RateLimitsModuleModel;
313
+ usageSnapshot: UsageSnapshotModel;
312
314
  appMembershipDefault: AppMembershipDefaultModel;
313
315
  orgMembershipDefault: OrgMembershipDefaultModel;
314
316
  rlsSetting: RlsSettingModel;
@@ -153,6 +153,7 @@ const userConnectedAccount_1 = require("./models/userConnectedAccount");
153
153
  const commit_1 = require("./models/commit");
154
154
  const pubkeySetting_1 = require("./models/pubkeySetting");
155
155
  const rateLimitsModule_1 = require("./models/rateLimitsModule");
156
+ const usageSnapshot_1 = require("./models/usageSnapshot");
156
157
  const appMembershipDefault_1 = require("./models/appMembershipDefault");
157
158
  const orgMembershipDefault_1 = require("./models/orgMembershipDefault");
158
159
  const rlsSetting_1 = require("./models/rlsSetting");
@@ -339,6 +340,7 @@ function createClient(config) {
339
340
  commit: new commit_1.CommitModel(client),
340
341
  pubkeySetting: new pubkeySetting_1.PubkeySettingModel(client),
341
342
  rateLimitsModule: new rateLimitsModule_1.RateLimitsModuleModel(client),
343
+ usageSnapshot: new usageSnapshot_1.UsageSnapshotModel(client),
342
344
  appMembershipDefault: new appMembershipDefault_1.AppMembershipDefaultModel(client),
343
345
  orgMembershipDefault: new orgMembershipDefault_1.OrgMembershipDefaultModel(client),
344
346
  rlsSetting: new rlsSetting_1.RlsSettingModel(client),
@@ -2521,6 +2521,20 @@ export interface RateLimitsModule {
2521
2521
  ipRateLimitsTable?: string | null;
2522
2522
  rateLimitsTable?: string | null;
2523
2523
  }
2524
+ /** 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. */
2525
+ export interface UsageSnapshot {
2526
+ /** The database this snapshot belongs to. References metaschema_public.database.id but declared without an FK constraint — the snapshot collector runs in a platform context where the FK would add overhead without value. */
2527
+ databaseId?: string | null;
2528
+ /** Identifier for the metric being measured (e.g. 'reads', 'writes', 'storage_bytes', 'compute_time_ms'). */
2529
+ metricName?: string | null;
2530
+ /** The measured value at the time of capture. Interpretation depends on metric_name (count, bytes, milliseconds, etc.). */
2531
+ metricValue?: string | null;
2532
+ /** Optional sub-metric breakdowns as key-value pairs (e.g. {"query_type": "select"} for reads). Empty object when no breakdown is needed. */
2533
+ dimensions?: Record<string, unknown> | null;
2534
+ /** When this snapshot was taken. Defaults to the current timestamp; the snapshot collector may override this for backdated imports. */
2535
+ capturedAt?: string | null;
2536
+ id: string;
2537
+ }
2524
2538
  /** Default membership settings per entity, controlling initial approval and verification state for new members */
2525
2539
  export interface AppMembershipDefault {
2526
2540
  id: string;
@@ -3628,6 +3642,8 @@ export interface RateLimitsModuleRelations {
3628
3642
  rateLimitsTableByRateLimitsTableId?: Table | null;
3629
3643
  schema?: Schema | null;
3630
3644
  }
3645
+ export interface UsageSnapshotRelations {
3646
+ }
3631
3647
  export interface AppMembershipDefaultRelations {
3632
3648
  }
3633
3649
  export interface OrgMembershipDefaultRelations {
@@ -3917,6 +3933,7 @@ export type UserConnectedAccountWithRelations = UserConnectedAccount & UserConne
3917
3933
  export type CommitWithRelations = Commit & CommitRelations;
3918
3934
  export type PubkeySettingWithRelations = PubkeySetting & PubkeySettingRelations;
3919
3935
  export type RateLimitsModuleWithRelations = RateLimitsModule & RateLimitsModuleRelations;
3936
+ export type UsageSnapshotWithRelations = UsageSnapshot & UsageSnapshotRelations;
3920
3937
  export type AppMembershipDefaultWithRelations = AppMembershipDefault & AppMembershipDefaultRelations;
3921
3938
  export type OrgMembershipDefaultWithRelations = OrgMembershipDefault & OrgMembershipDefaultRelations;
3922
3939
  export type RlsSettingWithRelations = RlsSetting & RlsSettingRelations;
@@ -7330,6 +7347,14 @@ export type RateLimitsModuleSelect = {
7330
7347
  select: SchemaSelect;
7331
7348
  };
7332
7349
  };
7350
+ export type UsageSnapshotSelect = {
7351
+ databaseId?: boolean;
7352
+ metricName?: boolean;
7353
+ metricValue?: boolean;
7354
+ dimensions?: boolean;
7355
+ capturedAt?: boolean;
7356
+ id?: boolean;
7357
+ };
7333
7358
  export type AppMembershipDefaultSelect = {
7334
7359
  id?: boolean;
7335
7360
  createdAt?: boolean;
@@ -13088,6 +13113,26 @@ export interface RateLimitsModuleFilter {
13088
13113
  /** Filter by the object’s `schema` relation. */
13089
13114
  schema?: SchemaFilter;
13090
13115
  }
13116
+ export interface UsageSnapshotFilter {
13117
+ /** Filter by the object’s `databaseId` field. */
13118
+ databaseId?: UUIDFilter;
13119
+ /** Filter by the object’s `metricName` field. */
13120
+ metricName?: StringFilter;
13121
+ /** Filter by the object’s `metricValue` field. */
13122
+ metricValue?: BigIntFilter;
13123
+ /** Filter by the object’s `dimensions` field. */
13124
+ dimensions?: JSONFilter;
13125
+ /** Filter by the object’s `capturedAt` field. */
13126
+ capturedAt?: DatetimeFilter;
13127
+ /** Filter by the object’s `id` field. */
13128
+ id?: UUIDFilter;
13129
+ /** Checks for all expressions in this list. */
13130
+ and?: UsageSnapshotFilter[];
13131
+ /** Checks for any expressions in this list. */
13132
+ or?: UsageSnapshotFilter[];
13133
+ /** Negates the expression. */
13134
+ not?: UsageSnapshotFilter;
13135
+ }
13091
13136
  export interface AppMembershipDefaultFilter {
13092
13137
  /** Filter by the object’s `id` field. */
13093
13138
  id?: UUIDFilter;
@@ -14206,6 +14251,7 @@ export type UserConnectedAccountOrderBy = 'NATURAL' | 'ID_ASC' | 'ID_DESC' | 'OW
14206
14251
  export type CommitOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'MESSAGE_ASC' | 'MESSAGE_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'STORE_ID_ASC' | 'STORE_ID_DESC' | 'PARENT_IDS_ASC' | 'PARENT_IDS_DESC' | 'AUTHOR_ID_ASC' | 'AUTHOR_ID_DESC' | 'COMMITTER_ID_ASC' | 'COMMITTER_ID_DESC' | 'TREE_ID_ASC' | 'TREE_ID_DESC' | 'DATE_ASC' | 'DATE_DESC';
14207
14252
  export type PubkeySettingOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'SCHEMA_ID_ASC' | 'SCHEMA_ID_DESC' | 'CRYPTO_NETWORK_ASC' | 'CRYPTO_NETWORK_DESC' | 'USER_FIELD_ASC' | 'USER_FIELD_DESC' | 'SIGN_UP_WITH_KEY_FUNCTION_ID_ASC' | 'SIGN_UP_WITH_KEY_FUNCTION_ID_DESC' | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_ASC' | 'SIGN_IN_REQUEST_CHALLENGE_FUNCTION_ID_DESC' | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_ASC' | 'SIGN_IN_RECORD_FAILURE_FUNCTION_ID_DESC' | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_ASC' | 'SIGN_IN_WITH_CHALLENGE_FUNCTION_ID_DESC';
14208
14253
  export type RateLimitsModuleOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'SCHEMA_ID_ASC' | 'SCHEMA_ID_DESC' | 'RATE_LIMIT_SETTINGS_TABLE_ID_ASC' | 'RATE_LIMIT_SETTINGS_TABLE_ID_DESC' | 'IP_RATE_LIMITS_TABLE_ID_ASC' | 'IP_RATE_LIMITS_TABLE_ID_DESC' | 'RATE_LIMITS_TABLE_ID_ASC' | 'RATE_LIMITS_TABLE_ID_DESC' | 'RATE_LIMIT_SETTINGS_TABLE_ASC' | 'RATE_LIMIT_SETTINGS_TABLE_DESC' | 'IP_RATE_LIMITS_TABLE_ASC' | 'IP_RATE_LIMITS_TABLE_DESC' | 'RATE_LIMITS_TABLE_ASC' | 'RATE_LIMITS_TABLE_DESC';
14254
+ export type UsageSnapshotOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'METRIC_NAME_ASC' | 'METRIC_NAME_DESC' | 'METRIC_VALUE_ASC' | 'METRIC_VALUE_DESC' | 'DIMENSIONS_ASC' | 'DIMENSIONS_DESC' | 'CAPTURED_AT_ASC' | 'CAPTURED_AT_DESC' | 'ID_ASC' | 'ID_DESC';
14209
14255
  export type AppMembershipDefaultOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'CREATED_BY_ASC' | 'CREATED_BY_DESC' | 'UPDATED_BY_ASC' | 'UPDATED_BY_DESC' | 'IS_APPROVED_ASC' | 'IS_APPROVED_DESC' | 'IS_VERIFIED_ASC' | 'IS_VERIFIED_DESC';
14210
14256
  export type OrgMembershipDefaultOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'CREATED_BY_ASC' | 'CREATED_BY_DESC' | 'UPDATED_BY_ASC' | 'UPDATED_BY_DESC' | 'IS_APPROVED_ASC' | 'IS_APPROVED_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC';
14211
14257
  export type RlsSettingOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'AUTHENTICATE_SCHEMA_ID_ASC' | 'AUTHENTICATE_SCHEMA_ID_DESC' | 'ROLE_SCHEMA_ID_ASC' | 'ROLE_SCHEMA_ID_DESC' | 'AUTHENTICATE_FUNCTION_ID_ASC' | 'AUTHENTICATE_FUNCTION_ID_DESC' | 'AUTHENTICATE_STRICT_FUNCTION_ID_ASC' | 'AUTHENTICATE_STRICT_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' | 'CURRENT_IP_ADDRESS_FUNCTION_ID_ASC' | 'CURRENT_IP_ADDRESS_FUNCTION_ID_DESC';
@@ -18427,6 +18473,32 @@ export interface DeleteRateLimitsModuleInput {
18427
18473
  clientMutationId?: string;
18428
18474
  id: string;
18429
18475
  }
18476
+ export interface CreateUsageSnapshotInput {
18477
+ clientMutationId?: string;
18478
+ usageSnapshot: {
18479
+ databaseId: string;
18480
+ metricName: string;
18481
+ metricValue?: string;
18482
+ dimensions?: Record<string, unknown>;
18483
+ capturedAt?: string;
18484
+ };
18485
+ }
18486
+ export interface UsageSnapshotPatch {
18487
+ databaseId?: string | null;
18488
+ metricName?: string | null;
18489
+ metricValue?: string | null;
18490
+ dimensions?: Record<string, unknown> | null;
18491
+ capturedAt?: string | null;
18492
+ }
18493
+ export interface UpdateUsageSnapshotInput {
18494
+ clientMutationId?: string;
18495
+ id: string;
18496
+ usageSnapshotPatch: UsageSnapshotPatch;
18497
+ }
18498
+ export interface DeleteUsageSnapshotInput {
18499
+ clientMutationId?: string;
18500
+ id: string;
18501
+ }
18430
18502
  export interface CreateAppMembershipDefaultInput {
18431
18503
  clientMutationId?: string;
18432
18504
  appMembershipDefault: {
@@ -33570,6 +33642,51 @@ export type DeleteRateLimitsModulePayloadSelect = {
33570
33642
  select: RateLimitsModuleEdgeSelect;
33571
33643
  };
33572
33644
  };
33645
+ export interface CreateUsageSnapshotPayload {
33646
+ clientMutationId?: string | null;
33647
+ /** The `UsageSnapshot` that was created by this mutation. */
33648
+ usageSnapshot?: UsageSnapshot | null;
33649
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
33650
+ }
33651
+ export type CreateUsageSnapshotPayloadSelect = {
33652
+ clientMutationId?: boolean;
33653
+ usageSnapshot?: {
33654
+ select: UsageSnapshotSelect;
33655
+ };
33656
+ usageSnapshotEdge?: {
33657
+ select: UsageSnapshotEdgeSelect;
33658
+ };
33659
+ };
33660
+ export interface UpdateUsageSnapshotPayload {
33661
+ clientMutationId?: string | null;
33662
+ /** The `UsageSnapshot` that was updated by this mutation. */
33663
+ usageSnapshot?: UsageSnapshot | null;
33664
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
33665
+ }
33666
+ export type UpdateUsageSnapshotPayloadSelect = {
33667
+ clientMutationId?: boolean;
33668
+ usageSnapshot?: {
33669
+ select: UsageSnapshotSelect;
33670
+ };
33671
+ usageSnapshotEdge?: {
33672
+ select: UsageSnapshotEdgeSelect;
33673
+ };
33674
+ };
33675
+ export interface DeleteUsageSnapshotPayload {
33676
+ clientMutationId?: string | null;
33677
+ /** The `UsageSnapshot` that was deleted by this mutation. */
33678
+ usageSnapshot?: UsageSnapshot | null;
33679
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
33680
+ }
33681
+ export type DeleteUsageSnapshotPayloadSelect = {
33682
+ clientMutationId?: boolean;
33683
+ usageSnapshot?: {
33684
+ select: UsageSnapshotSelect;
33685
+ };
33686
+ usageSnapshotEdge?: {
33687
+ select: UsageSnapshotEdgeSelect;
33688
+ };
33689
+ };
33573
33690
  export interface CreateAppMembershipDefaultPayload {
33574
33691
  clientMutationId?: string | null;
33575
33692
  /** The `AppMembershipDefault` that was created by this mutation. */
@@ -35836,6 +35953,18 @@ export type RateLimitsModuleEdgeSelect = {
35836
35953
  select: RateLimitsModuleSelect;
35837
35954
  };
35838
35955
  };
35956
+ /** A `UsageSnapshot` edge in the connection. */
35957
+ export interface UsageSnapshotEdge {
35958
+ cursor?: string | null;
35959
+ /** The `UsageSnapshot` at the end of the edge. */
35960
+ node?: UsageSnapshot | null;
35961
+ }
35962
+ export type UsageSnapshotEdgeSelect = {
35963
+ cursor?: boolean;
35964
+ node?: {
35965
+ select: UsageSnapshotSelect;
35966
+ };
35967
+ };
35839
35968
  /** A `AppMembershipDefault` edge in the connection. */
35840
35969
  export interface AppMembershipDefaultEdge {
35841
35970
  cursor?: string | null;
@@ -134,6 +134,7 @@ export { UserConnectedAccountModel } from './userConnectedAccount';
134
134
  export { CommitModel } from './commit';
135
135
  export { PubkeySettingModel } from './pubkeySetting';
136
136
  export { RateLimitsModuleModel } from './rateLimitsModule';
137
+ export { UsageSnapshotModel } from './usageSnapshot';
137
138
  export { AppMembershipDefaultModel } from './appMembershipDefault';
138
139
  export { OrgMembershipDefaultModel } from './orgMembershipDefault';
139
140
  export { RlsSettingModel } from './rlsSetting';
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConnectedAccountsModuleModel = exports.ApiSettingModel = exports.AppModel = exports.SiteModel = exports.ApiModel = exports.DatabaseTransferModel = exports.TriggerFunctionModel = exports.CorsSettingModel = exports.SiteThemeModel = exports.SiteModuleModel = exports.SiteMetadatumModel = exports.DomainModel = exports.ApiModuleModel = exports.ApiSchemaModel = exports.FunctionModel = exports.EnumModel = exports.DefaultPrivilegeModel = exports.SchemaGrantModel = exports.RealtimeModuleModel = exports.IdentityProvidersModuleModel = exports.SessionSecretsModuleModel = exports.RelationProvisionModel = exports.SecureTableProvisionModel = exports.EmbeddingChunkModel = exports.ViewRuleModel = exports.ViewGrantModel = exports.ViewTableModel = exports.ViewModel = exports.UniqueConstraintModel = exports.TriggerModel = exports.TableGrantModel = exports.PrimaryKeyConstraintModel = exports.PolicyModel = exports.IndexModel = exports.FullTextSearchModel = exports.ForeignKeyConstraintModel = exports.PartitionModel = exports.SpatialRelationModel = exports.FieldModel = exports.CheckConstraintModel = exports.TableModel = exports.SchemaModel = exports.DatabaseModel = exports.AppLevelRequirementModel = exports.ObjectModel = exports.OrgPermissionModel = exports.AppPermissionModel = exports.GetAllRecordModel = exports.OrgGetSubordinatesRecordModel = exports.OrgGetManagersRecordModel = void 0;
4
4
  exports.EmailModel = exports.AppLevelModel = exports.AppAchievementModel = exports.AppStepModel = exports.OrgLimitAggregateModel = exports.OrgLimitCreditModel = exports.OrgLimitModel = exports.AppLimitCreditRedemptionModel = exports.AppLimitCreditCodeItemModel = exports.AppLimitCreditModel = exports.AppLimitModel = exports.OrgPermissionDefaultModel = exports.OrgChartEdgeGrantModel = exports.OrgChartEdgeModel = exports.OrgGrantModel = exports.OrgMemberProfileModel = exports.OrgOwnerGrantModel = exports.OrgAdminGrantModel = exports.OrgMemberModel = exports.OrgMembershipModel = exports.AppGrantModel = exports.AppOwnerGrantModel = exports.AppAdminGrantModel = exports.DatabaseProvisionModuleModel = exports.NotificationsModuleModel = exports.WebauthnAuthModuleModel = exports.WebauthnCredentialsModuleModel = exports.EntityTypeProvisionModel = exports.StorageModuleModel = exports.BlueprintConstructionModel = exports.BlueprintTemplateModel = exports.BlueprintModel = exports.UsersModuleModel = exports.UserAuthModuleModel = exports.SessionsModuleModel = exports.SecretsModuleModel = exports.ProfilesModuleModel = exports.PhoneNumbersModuleModel = exports.PermissionsModuleModel = exports.MembershipsModuleModel = exports.MembershipTypesModuleModel = exports.LimitsModuleModel = exports.LevelsModuleModel = exports.InvitesModuleModel = exports.EncryptedSecretsModuleModel = exports.EmailsModuleModel = exports.DenormalizedTableFieldModel = exports.DefaultIdsModuleModel = exports.CryptoAuthModuleModel = exports.CryptoAddressesModuleModel = void 0;
5
- exports.HierarchyModuleModel = exports.BillingProviderModuleModel = exports.AppMembershipModel = exports.WebauthnSettingModel = exports.OrgMembershipSettingModel = exports.UserModel = exports.AstMigrationModel = exports.BillingModuleModel = exports.SqlActionModel = exports.PlansModuleModel = exports.DatabaseSettingModel = exports.RlsModuleModel = exports.OrgLimitEventModel = exports.AppLimitEventModel = exports.RlsSettingModel = exports.OrgMembershipDefaultModel = exports.AppMembershipDefaultModel = exports.RateLimitsModuleModel = exports.PubkeySettingModel = exports.CommitModel = exports.UserConnectedAccountModel = exports.OrgLimitDefaultModel = exports.AppLimitDefaultModel = exports.NodeTypeRegistryModel = exports.DevicesModuleModel = exports.MigrateFileModel = exports.MembershipTypeModel = exports.OrgLimitCapModel = exports.AppLimitCapModel = exports.OrgLimitCapsDefaultModel = exports.AppLimitCapsDefaultModel = exports.AppLimitCreditCodeModel = exports.AppPermissionDefaultModel = exports.StoreModel = exports.RefModel = exports.IdentityProviderModel = exports.RoleTypeModel = exports.AgentTaskModel = exports.AgentMessageModel = exports.AgentThreadModel = exports.AuditLogModel = exports.OrgClaimedInviteModel = exports.OrgInviteModel = exports.AppClaimedInviteModel = exports.AppInviteModel = exports.WebauthnCredentialModel = exports.CryptoAddressModel = exports.PhoneNumberModel = void 0;
5
+ exports.HierarchyModuleModel = exports.BillingProviderModuleModel = exports.AppMembershipModel = exports.WebauthnSettingModel = exports.OrgMembershipSettingModel = exports.UserModel = exports.AstMigrationModel = exports.BillingModuleModel = exports.SqlActionModel = exports.PlansModuleModel = exports.DatabaseSettingModel = exports.RlsModuleModel = exports.OrgLimitEventModel = exports.AppLimitEventModel = exports.RlsSettingModel = exports.OrgMembershipDefaultModel = exports.AppMembershipDefaultModel = exports.UsageSnapshotModel = exports.RateLimitsModuleModel = exports.PubkeySettingModel = exports.CommitModel = exports.UserConnectedAccountModel = exports.OrgLimitDefaultModel = exports.AppLimitDefaultModel = exports.NodeTypeRegistryModel = exports.DevicesModuleModel = exports.MigrateFileModel = exports.MembershipTypeModel = exports.OrgLimitCapModel = exports.AppLimitCapModel = exports.OrgLimitCapsDefaultModel = exports.AppLimitCapsDefaultModel = exports.AppLimitCreditCodeModel = exports.AppPermissionDefaultModel = exports.StoreModel = exports.RefModel = exports.IdentityProviderModel = exports.RoleTypeModel = exports.AgentTaskModel = exports.AgentMessageModel = exports.AgentThreadModel = exports.AuditLogModel = exports.OrgClaimedInviteModel = exports.OrgInviteModel = exports.AppClaimedInviteModel = exports.AppInviteModel = exports.WebauthnCredentialModel = exports.CryptoAddressModel = exports.PhoneNumberModel = void 0;
6
6
  /**
7
7
  * Models barrel export
8
8
  * @generated by @constructive-io/graphql-codegen
@@ -270,6 +270,8 @@ var pubkeySetting_1 = require("./pubkeySetting");
270
270
  Object.defineProperty(exports, "PubkeySettingModel", { enumerable: true, get: function () { return pubkeySetting_1.PubkeySettingModel; } });
271
271
  var rateLimitsModule_1 = require("./rateLimitsModule");
272
272
  Object.defineProperty(exports, "RateLimitsModuleModel", { enumerable: true, get: function () { return rateLimitsModule_1.RateLimitsModuleModel; } });
273
+ var usageSnapshot_1 = require("./usageSnapshot");
274
+ Object.defineProperty(exports, "UsageSnapshotModel", { enumerable: true, get: function () { return usageSnapshot_1.UsageSnapshotModel; } });
273
275
  var appMembershipDefault_1 = require("./appMembershipDefault");
274
276
  Object.defineProperty(exports, "AppMembershipDefaultModel", { enumerable: true, get: function () { return appMembershipDefault_1.AppMembershipDefaultModel; } });
275
277
  var orgMembershipDefault_1 = require("./orgMembershipDefault");
@@ -0,0 +1,56 @@
1
+ /**
2
+ * UsageSnapshot model for ORM client
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { OrmClient } from '../client';
7
+ import { QueryBuilder } from '../query-builder';
8
+ import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types';
9
+ import type { UsageSnapshotWithRelations, UsageSnapshotSelect, UsageSnapshotFilter, UsageSnapshotOrderBy, CreateUsageSnapshotInput, UsageSnapshotPatch } from '../input-types';
10
+ export declare class UsageSnapshotModel {
11
+ private client;
12
+ constructor(client: OrmClient);
13
+ findMany<S extends UsageSnapshotSelect>(args: FindManyArgs<S, UsageSnapshotFilter, UsageSnapshotOrderBy> & {
14
+ select: S;
15
+ } & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
16
+ usageSnapshots: ConnectionResult<InferSelectResult<UsageSnapshotWithRelations, S>>;
17
+ }>;
18
+ findFirst<S extends UsageSnapshotSelect>(args: FindFirstArgs<S, UsageSnapshotFilter> & {
19
+ select: S;
20
+ } & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
21
+ usageSnapshots: {
22
+ nodes: InferSelectResult<UsageSnapshotWithRelations, S>[];
23
+ };
24
+ }>;
25
+ findOne<S extends UsageSnapshotSelect>(args: {
26
+ id: string;
27
+ select: S;
28
+ } & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
29
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S> | null;
30
+ }>;
31
+ create<S extends UsageSnapshotSelect>(args: CreateArgs<S, CreateUsageSnapshotInput['usageSnapshot']> & {
32
+ select: S;
33
+ } & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
34
+ createUsageSnapshot: {
35
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
36
+ };
37
+ }>;
38
+ update<S extends UsageSnapshotSelect>(args: UpdateArgs<S, {
39
+ id: string;
40
+ }, UsageSnapshotPatch> & {
41
+ select: S;
42
+ } & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
43
+ updateUsageSnapshot: {
44
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
45
+ };
46
+ }>;
47
+ delete<S extends UsageSnapshotSelect>(args: DeleteArgs<{
48
+ id: string;
49
+ }, S> & {
50
+ select: S;
51
+ } & StrictSelect<S, UsageSnapshotSelect>): QueryBuilder<{
52
+ deleteUsageSnapshot: {
53
+ usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
54
+ };
55
+ }>;
56
+ }
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UsageSnapshotModel = void 0;
4
+ const query_builder_1 = require("../query-builder");
5
+ const input_types_1 = require("../input-types");
6
+ class UsageSnapshotModel {
7
+ client;
8
+ constructor(client) {
9
+ this.client = client;
10
+ }
11
+ findMany(args) {
12
+ const { document, variables } = (0, query_builder_1.buildFindManyDocument)('UsageSnapshot', 'usageSnapshots', args.select, {
13
+ where: args?.where,
14
+ orderBy: args?.orderBy,
15
+ first: args?.first,
16
+ last: args?.last,
17
+ after: args?.after,
18
+ before: args?.before,
19
+ offset: args?.offset,
20
+ }, 'UsageSnapshotFilter', 'UsageSnapshotOrderBy', input_types_1.connectionFieldsMap);
21
+ return new query_builder_1.QueryBuilder({
22
+ client: this.client,
23
+ operation: 'query',
24
+ operationName: 'UsageSnapshot',
25
+ fieldName: 'usageSnapshots',
26
+ document,
27
+ variables,
28
+ });
29
+ }
30
+ findFirst(args) {
31
+ const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('UsageSnapshot', 'usageSnapshots', args.select, {
32
+ where: args?.where,
33
+ }, 'UsageSnapshotFilter', input_types_1.connectionFieldsMap);
34
+ return new query_builder_1.QueryBuilder({
35
+ client: this.client,
36
+ operation: 'query',
37
+ operationName: 'UsageSnapshot',
38
+ fieldName: 'usageSnapshots',
39
+ document,
40
+ variables,
41
+ });
42
+ }
43
+ findOne(args) {
44
+ const { document, variables } = (0, query_builder_1.buildFindManyDocument)('UsageSnapshot', 'usageSnapshots', args.select, {
45
+ where: {
46
+ id: {
47
+ equalTo: args.id,
48
+ },
49
+ },
50
+ first: 1,
51
+ }, 'UsageSnapshotFilter', 'UsageSnapshotOrderBy', input_types_1.connectionFieldsMap);
52
+ return new query_builder_1.QueryBuilder({
53
+ client: this.client,
54
+ operation: 'query',
55
+ operationName: 'UsageSnapshot',
56
+ fieldName: 'usageSnapshot',
57
+ document,
58
+ variables,
59
+ transform: (data) => ({
60
+ usageSnapshot: data.usageSnapshots?.nodes?.[0] ?? null,
61
+ }),
62
+ });
63
+ }
64
+ create(args) {
65
+ const { document, variables } = (0, query_builder_1.buildCreateDocument)('UsageSnapshot', 'createUsageSnapshot', 'usageSnapshot', args.select, args.data, 'CreateUsageSnapshotInput', input_types_1.connectionFieldsMap);
66
+ return new query_builder_1.QueryBuilder({
67
+ client: this.client,
68
+ operation: 'mutation',
69
+ operationName: 'UsageSnapshot',
70
+ fieldName: 'createUsageSnapshot',
71
+ document,
72
+ variables,
73
+ });
74
+ }
75
+ update(args) {
76
+ const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('UsageSnapshot', 'updateUsageSnapshot', 'usageSnapshot', args.select, args.where.id, args.data, 'UpdateUsageSnapshotInput', 'id', 'usageSnapshotPatch', input_types_1.connectionFieldsMap);
77
+ return new query_builder_1.QueryBuilder({
78
+ client: this.client,
79
+ operation: 'mutation',
80
+ operationName: 'UsageSnapshot',
81
+ fieldName: 'updateUsageSnapshot',
82
+ document,
83
+ variables,
84
+ });
85
+ }
86
+ delete(args) {
87
+ const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('UsageSnapshot', 'deleteUsageSnapshot', 'usageSnapshot', {
88
+ id: args.where.id,
89
+ }, 'DeleteUsageSnapshotInput', args.select, input_types_1.connectionFieldsMap);
90
+ return new query_builder_1.QueryBuilder({
91
+ client: this.client,
92
+ operation: 'mutation',
93
+ operationName: 'UsageSnapshot',
94
+ fieldName: 'deleteUsageSnapshot',
95
+ document,
96
+ variables,
97
+ });
98
+ }
99
+ }
100
+ exports.UsageSnapshotModel = UsageSnapshotModel;