@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
@@ -255,6 +255,13 @@ export declare const orgChartEdgeKeys: {
255
255
  /** Detail query keys */ readonly details: () => readonly ["orgchartedge", "detail"];
256
256
  /** Detail query key for specific item */ readonly detail: (id: string | number) => readonly ["orgchartedge", "detail", string | number];
257
257
  };
258
+ export declare const usageSnapshotKeys: {
259
+ /** All usageSnapshot queries */ readonly all: readonly ["usagesnapshot"];
260
+ /** List query keys */ readonly lists: () => readonly ["usagesnapshot", "list"];
261
+ /** List query key with variables */ readonly list: (variables?: object) => readonly ["usagesnapshot", "list", object];
262
+ /** Detail query keys */ readonly details: () => readonly ["usagesnapshot", "detail"];
263
+ /** Detail query key for specific item */ readonly detail: (id: string | number) => readonly ["usagesnapshot", "detail", string | number];
264
+ };
258
265
  export declare const orgMemberProfileKeys: {
259
266
  /** All orgMemberProfile queries */ readonly all: readonly ["orgmemberprofile"];
260
267
  /** List query keys */ readonly lists: () => readonly ["orgmemberprofile", "list"];
@@ -613,6 +620,13 @@ export declare const queryKeys: {
613
620
  /** Detail query keys */ readonly details: () => readonly ["orgchartedge", "detail"];
614
621
  /** Detail query key for specific item */ readonly detail: (id: string | number) => readonly ["orgchartedge", "detail", string | number];
615
622
  };
623
+ readonly usageSnapshot: {
624
+ /** All usageSnapshot queries */ readonly all: readonly ["usagesnapshot"];
625
+ /** List query keys */ readonly lists: () => readonly ["usagesnapshot", "list"];
626
+ /** List query key with variables */ readonly list: (variables?: object) => readonly ["usagesnapshot", "list", object];
627
+ /** Detail query keys */ readonly details: () => readonly ["usagesnapshot", "detail"];
628
+ /** Detail query key for specific item */ readonly detail: (id: string | number) => readonly ["usagesnapshot", "detail", string | number];
629
+ };
616
630
  readonly orgMemberProfile: {
617
631
  /** All orgMemberProfile queries */ readonly all: readonly ["orgmemberprofile"];
618
632
  /** List query keys */ readonly lists: () => readonly ["orgmemberprofile", "list"];
@@ -5,7 +5,7 @@
5
5
  * DO NOT EDIT - changes will be overwritten
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.queryKeys = exports.customQueryKeys = exports.orgMembershipKeys = exports.appMembershipKeys = exports.orgInviteKeys = exports.orgLimitKeys = exports.orgLimitAggregateKeys = exports.orgMembershipSettingKeys = exports.appInviteKeys = exports.appLimitKeys = exports.appLevelKeys = exports.orgMemberProfileKeys = exports.orgChartEdgeKeys = exports.orgGrantKeys = exports.orgLimitEventKeys = exports.appLimitEventKeys = exports.orgClaimedInviteKeys = exports.orgMembershipDefaultKeys = exports.appMembershipDefaultKeys = exports.appGrantKeys = exports.appClaimedInviteKeys = exports.orgChartEdgeGrantKeys = exports.orgLimitCreditKeys = exports.orgLimitDefaultKeys = exports.appLimitDefaultKeys = exports.membershipTypeKeys = exports.orgOwnerGrantKeys = exports.orgAdminGrantKeys = exports.orgLimitCapKeys = exports.appLimitCapKeys = exports.orgLimitCapsDefaultKeys = exports.appLimitCapsDefaultKeys = exports.appStepKeys = exports.appAchievementKeys = exports.appOwnerGrantKeys = exports.appAdminGrantKeys = exports.orgPermissionDefaultKeys = exports.appLimitCreditCodeKeys = exports.appPermissionDefaultKeys = exports.orgMemberKeys = exports.appLimitCreditKeys = exports.appLimitCreditCodeItemKeys = exports.appLimitCreditRedemptionKeys = exports.appLevelRequirementKeys = exports.orgPermissionKeys = exports.appPermissionKeys = exports.orgGetSubordinatesRecordKeys = exports.orgGetManagersRecordKeys = void 0;
8
+ exports.queryKeys = exports.customQueryKeys = exports.orgMembershipKeys = exports.appMembershipKeys = exports.orgInviteKeys = exports.orgLimitKeys = exports.orgLimitAggregateKeys = exports.orgMembershipSettingKeys = exports.appInviteKeys = exports.appLimitKeys = exports.appLevelKeys = exports.orgMemberProfileKeys = exports.usageSnapshotKeys = exports.orgChartEdgeKeys = exports.orgGrantKeys = exports.orgLimitEventKeys = exports.appLimitEventKeys = exports.orgClaimedInviteKeys = exports.orgMembershipDefaultKeys = exports.appMembershipDefaultKeys = exports.appGrantKeys = exports.appClaimedInviteKeys = exports.orgChartEdgeGrantKeys = exports.orgLimitCreditKeys = exports.orgLimitDefaultKeys = exports.appLimitDefaultKeys = exports.membershipTypeKeys = exports.orgOwnerGrantKeys = exports.orgAdminGrantKeys = exports.orgLimitCapKeys = exports.appLimitCapKeys = exports.orgLimitCapsDefaultKeys = exports.appLimitCapsDefaultKeys = exports.appStepKeys = exports.appAchievementKeys = exports.appOwnerGrantKeys = exports.appAdminGrantKeys = exports.orgPermissionDefaultKeys = exports.appLimitCreditCodeKeys = exports.appPermissionDefaultKeys = exports.orgMemberKeys = exports.appLimitCreditKeys = exports.appLimitCreditCodeItemKeys = exports.appLimitCreditRedemptionKeys = exports.appLevelRequirementKeys = exports.orgPermissionKeys = exports.appPermissionKeys = exports.orgGetSubordinatesRecordKeys = exports.orgGetManagersRecordKeys = void 0;
9
9
  // ============================================================================
10
10
  // This file provides a centralized, type-safe query key factory following
11
11
  // the lukemorales query-key-factory pattern for React Query.
@@ -271,6 +271,13 @@ exports.orgChartEdgeKeys = {
271
271
  /** Detail query keys */ details: () => [...exports.orgChartEdgeKeys.all, 'detail'],
272
272
  /** Detail query key for specific item */ detail: (id) => [...exports.orgChartEdgeKeys.details(), id],
273
273
  };
274
+ exports.usageSnapshotKeys = {
275
+ /** All usageSnapshot queries */ all: ['usagesnapshot'],
276
+ /** List query keys */ lists: () => [...exports.usageSnapshotKeys.all, 'list'],
277
+ /** List query key with variables */ list: (variables) => [...exports.usageSnapshotKeys.lists(), variables],
278
+ /** Detail query keys */ details: () => [...exports.usageSnapshotKeys.all, 'detail'],
279
+ /** Detail query key for specific item */ detail: (id) => [...exports.usageSnapshotKeys.details(), id],
280
+ };
274
281
  exports.orgMemberProfileKeys = {
275
282
  /** All orgMemberProfile queries */ all: ['orgmemberprofile'],
276
283
  /** List query keys */ lists: () => [...exports.orgMemberProfileKeys.all, 'list'],
@@ -416,6 +423,7 @@ exports.queryKeys = {
416
423
  orgLimitEvent: exports.orgLimitEventKeys,
417
424
  orgGrant: exports.orgGrantKeys,
418
425
  orgChartEdge: exports.orgChartEdgeKeys,
426
+ usageSnapshot: exports.usageSnapshotKeys,
419
427
  orgMemberProfile: exports.orgMemberProfileKeys,
420
428
  appLevel: exports.appLevelKeys,
421
429
  appLimit: exports.appLimitKeys,
@@ -35,6 +35,7 @@ import { AppLimitEventModel } from './models/appLimitEvent';
35
35
  import { OrgLimitEventModel } from './models/orgLimitEvent';
36
36
  import { OrgGrantModel } from './models/orgGrant';
37
37
  import { OrgChartEdgeModel } from './models/orgChartEdge';
38
+ import { UsageSnapshotModel } from './models/usageSnapshot';
38
39
  import { OrgMemberProfileModel } from './models/orgMemberProfile';
39
40
  import { AppLevelModel } from './models/appLevel';
40
41
  import { AppLimitModel } from './models/appLimit';
@@ -112,6 +113,7 @@ export declare function createClient(config: OrmClientConfig): {
112
113
  orgLimitEvent: OrgLimitEventModel;
113
114
  orgGrant: OrgGrantModel;
114
115
  orgChartEdge: OrgChartEdgeModel;
116
+ usageSnapshot: UsageSnapshotModel;
115
117
  orgMemberProfile: OrgMemberProfileModel;
116
118
  appLevel: AppLevelModel;
117
119
  appLimit: AppLimitModel;
@@ -58,6 +58,7 @@ const appLimitEvent_1 = require("./models/appLimitEvent");
58
58
  const orgLimitEvent_1 = require("./models/orgLimitEvent");
59
59
  const orgGrant_1 = require("./models/orgGrant");
60
60
  const orgChartEdge_1 = require("./models/orgChartEdge");
61
+ const usageSnapshot_1 = require("./models/usageSnapshot");
61
62
  const orgMemberProfile_1 = require("./models/orgMemberProfile");
62
63
  const appLevel_1 = require("./models/appLevel");
63
64
  const appLimit_1 = require("./models/appLimit");
@@ -142,6 +143,7 @@ function createClient(config) {
142
143
  orgLimitEvent: new orgLimitEvent_1.OrgLimitEventModel(client),
143
144
  orgGrant: new orgGrant_1.OrgGrantModel(client),
144
145
  orgChartEdge: new orgChartEdge_1.OrgChartEdgeModel(client),
146
+ usageSnapshot: new usageSnapshot_1.UsageSnapshotModel(client),
145
147
  orgMemberProfile: new orgMemberProfile_1.OrgMemberProfileModel(client),
146
148
  appLevel: new appLevel_1.AppLevelModel(client),
147
149
  appLimit: new appLimit_1.AppLimitModel(client),
@@ -661,6 +661,20 @@ export interface OrgChartEdge {
661
661
  /** Numeric seniority level for this position (higher = more senior) */
662
662
  positionLevel?: number | null;
663
663
  }
664
+ /** 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. */
665
+ export interface UsageSnapshot {
666
+ /** 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. */
667
+ databaseId?: string | null;
668
+ /** Identifier for the metric being measured (e.g. 'reads', 'writes', 'storage_bytes', 'compute_time_ms'). */
669
+ metricName?: string | null;
670
+ /** The measured value at the time of capture. Interpretation depends on metric_name (count, bytes, milliseconds, etc.). */
671
+ metricValue?: string | null;
672
+ /** Optional sub-metric breakdowns as key-value pairs (e.g. {"query_type": "select"} for reads). Empty object when no breakdown is needed. */
673
+ dimensions?: Record<string, unknown> | null;
674
+ /** When this snapshot was taken. Defaults to the current timestamp; the snapshot collector may override this for backdated imports. */
675
+ capturedAt?: string | null;
676
+ id: string;
677
+ }
664
678
  /** Per-membership profile information visible to other entity members (display name, email, title, bio, avatar) */
665
679
  export interface OrgMemberProfile {
666
680
  id: string;
@@ -1008,6 +1022,8 @@ export interface OrgGrantRelations {
1008
1022
  }
1009
1023
  export interface OrgChartEdgeRelations {
1010
1024
  }
1025
+ export interface UsageSnapshotRelations {
1026
+ }
1011
1027
  export interface OrgMemberProfileRelations {
1012
1028
  membership?: OrgMembership | null;
1013
1029
  }
@@ -1066,6 +1082,7 @@ export type AppLimitEventWithRelations = AppLimitEvent & AppLimitEventRelations;
1066
1082
  export type OrgLimitEventWithRelations = OrgLimitEvent & OrgLimitEventRelations;
1067
1083
  export type OrgGrantWithRelations = OrgGrant & OrgGrantRelations;
1068
1084
  export type OrgChartEdgeWithRelations = OrgChartEdge & OrgChartEdgeRelations;
1085
+ export type UsageSnapshotWithRelations = UsageSnapshot & UsageSnapshotRelations;
1069
1086
  export type OrgMemberProfileWithRelations = OrgMemberProfile & OrgMemberProfileRelations;
1070
1087
  export type AppLevelWithRelations = AppLevel & AppLevelRelations;
1071
1088
  export type AppLimitWithRelations = AppLimit & AppLimitRelations;
@@ -1393,6 +1410,14 @@ export type OrgChartEdgeSelect = {
1393
1410
  positionTitle?: boolean;
1394
1411
  positionLevel?: boolean;
1395
1412
  };
1413
+ export type UsageSnapshotSelect = {
1414
+ databaseId?: boolean;
1415
+ metricName?: boolean;
1416
+ metricValue?: boolean;
1417
+ dimensions?: boolean;
1418
+ capturedAt?: boolean;
1419
+ id?: boolean;
1420
+ };
1396
1421
  export type OrgMemberProfileSelect = {
1397
1422
  id?: boolean;
1398
1423
  createdAt?: boolean;
@@ -2252,6 +2277,26 @@ export interface OrgChartEdgeFilter {
2252
2277
  /** Negates the expression. */
2253
2278
  not?: OrgChartEdgeFilter;
2254
2279
  }
2280
+ export interface UsageSnapshotFilter {
2281
+ /** Filter by the object’s `databaseId` field. */
2282
+ databaseId?: UUIDFilter;
2283
+ /** Filter by the object’s `metricName` field. */
2284
+ metricName?: StringFilter;
2285
+ /** Filter by the object’s `metricValue` field. */
2286
+ metricValue?: BigIntFilter;
2287
+ /** Filter by the object’s `dimensions` field. */
2288
+ dimensions?: JSONFilter;
2289
+ /** Filter by the object’s `capturedAt` field. */
2290
+ capturedAt?: DatetimeFilter;
2291
+ /** Filter by the object’s `id` field. */
2292
+ id?: UUIDFilter;
2293
+ /** Checks for all expressions in this list. */
2294
+ and?: UsageSnapshotFilter[];
2295
+ /** Checks for any expressions in this list. */
2296
+ or?: UsageSnapshotFilter[];
2297
+ /** Negates the expression. */
2298
+ not?: UsageSnapshotFilter;
2299
+ }
2255
2300
  export interface OrgMemberProfileFilter {
2256
2301
  /** Filter by the object’s `id` field. */
2257
2302
  id?: UUIDFilter;
@@ -2628,6 +2673,7 @@ export type AppLimitEventOrderBy = 'NATURAL' | 'NAME_ASC' | 'NAME_DESC' | 'ACTOR
2628
2673
  export type OrgLimitEventOrderBy = 'NATURAL' | 'NAME_ASC' | 'NAME_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC' | 'EVENT_TYPE_ASC' | 'EVENT_TYPE_DESC' | 'DELTA_ASC' | 'DELTA_DESC' | 'NUM_BEFORE_ASC' | 'NUM_BEFORE_DESC' | 'NUM_AFTER_ASC' | 'NUM_AFTER_DESC' | 'MAX_AT_EVENT_ASC' | 'MAX_AT_EVENT_DESC' | 'REASON_ASC' | 'REASON_DESC';
2629
2674
  export type OrgGrantOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'PERMISSIONS_ASC' | 'PERMISSIONS_DESC' | 'IS_GRANT_ASC' | 'IS_GRANT_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC' | 'GRANTOR_ID_ASC' | 'GRANTOR_ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC';
2630
2675
  export type OrgChartEdgeOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC' | 'CHILD_ID_ASC' | 'CHILD_ID_DESC' | 'PARENT_ID_ASC' | 'PARENT_ID_DESC' | 'POSITION_TITLE_ASC' | 'POSITION_TITLE_DESC' | 'POSITION_LEVEL_ASC' | 'POSITION_LEVEL_DESC';
2676
+ 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';
2631
2677
  export type OrgMemberProfileOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'MEMBERSHIP_ID_ASC' | 'MEMBERSHIP_ID_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'DISPLAY_NAME_ASC' | 'DISPLAY_NAME_DESC' | 'EMAIL_ASC' | 'EMAIL_DESC' | 'TITLE_ASC' | 'TITLE_DESC' | 'BIO_ASC' | 'BIO_DESC' | 'PROFILE_PICTURE_ASC' | 'PROFILE_PICTURE_DESC';
2632
2678
  export type AppLevelOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'IMAGE_ASC' | 'IMAGE_DESC' | 'OWNER_ID_ASC' | 'OWNER_ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC';
2633
2679
  export type AppLimitOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'NUM_ASC' | 'NUM_DESC' | 'MAX_ASC' | 'MAX_DESC' | 'SOFT_MAX_ASC' | 'SOFT_MAX_DESC' | 'WINDOW_START_ASC' | 'WINDOW_START_DESC' | 'WINDOW_DURATION_ASC' | 'WINDOW_DURATION_DESC' | 'PLAN_MAX_ASC' | 'PLAN_MAX_DESC' | 'PURCHASED_CREDITS_ASC' | 'PURCHASED_CREDITS_DESC' | 'PERIOD_CREDITS_ASC' | 'PERIOD_CREDITS_DESC';
@@ -3492,6 +3538,32 @@ export interface DeleteOrgChartEdgeInput {
3492
3538
  clientMutationId?: string;
3493
3539
  id: string;
3494
3540
  }
3541
+ export interface CreateUsageSnapshotInput {
3542
+ clientMutationId?: string;
3543
+ usageSnapshot: {
3544
+ databaseId: string;
3545
+ metricName: string;
3546
+ metricValue?: string;
3547
+ dimensions?: Record<string, unknown>;
3548
+ capturedAt?: string;
3549
+ };
3550
+ }
3551
+ export interface UsageSnapshotPatch {
3552
+ databaseId?: string | null;
3553
+ metricName?: string | null;
3554
+ metricValue?: string | null;
3555
+ dimensions?: Record<string, unknown> | null;
3556
+ capturedAt?: string | null;
3557
+ }
3558
+ export interface UpdateUsageSnapshotInput {
3559
+ clientMutationId?: string;
3560
+ id: string;
3561
+ usageSnapshotPatch: UsageSnapshotPatch;
3562
+ }
3563
+ export interface DeleteUsageSnapshotInput {
3564
+ clientMutationId?: string;
3565
+ id: string;
3566
+ }
3495
3567
  export interface CreateOrgMemberProfileInput {
3496
3568
  clientMutationId?: string;
3497
3569
  orgMemberProfile: {
@@ -5978,6 +6050,51 @@ export type DeleteOrgChartEdgePayloadSelect = {
5978
6050
  select: OrgChartEdgeEdgeSelect;
5979
6051
  };
5980
6052
  };
6053
+ export interface CreateUsageSnapshotPayload {
6054
+ clientMutationId?: string | null;
6055
+ /** The `UsageSnapshot` that was created by this mutation. */
6056
+ usageSnapshot?: UsageSnapshot | null;
6057
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
6058
+ }
6059
+ export type CreateUsageSnapshotPayloadSelect = {
6060
+ clientMutationId?: boolean;
6061
+ usageSnapshot?: {
6062
+ select: UsageSnapshotSelect;
6063
+ };
6064
+ usageSnapshotEdge?: {
6065
+ select: UsageSnapshotEdgeSelect;
6066
+ };
6067
+ };
6068
+ export interface UpdateUsageSnapshotPayload {
6069
+ clientMutationId?: string | null;
6070
+ /** The `UsageSnapshot` that was updated by this mutation. */
6071
+ usageSnapshot?: UsageSnapshot | null;
6072
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
6073
+ }
6074
+ export type UpdateUsageSnapshotPayloadSelect = {
6075
+ clientMutationId?: boolean;
6076
+ usageSnapshot?: {
6077
+ select: UsageSnapshotSelect;
6078
+ };
6079
+ usageSnapshotEdge?: {
6080
+ select: UsageSnapshotEdgeSelect;
6081
+ };
6082
+ };
6083
+ export interface DeleteUsageSnapshotPayload {
6084
+ clientMutationId?: string | null;
6085
+ /** The `UsageSnapshot` that was deleted by this mutation. */
6086
+ usageSnapshot?: UsageSnapshot | null;
6087
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
6088
+ }
6089
+ export type DeleteUsageSnapshotPayloadSelect = {
6090
+ clientMutationId?: boolean;
6091
+ usageSnapshot?: {
6092
+ select: UsageSnapshotSelect;
6093
+ };
6094
+ usageSnapshotEdge?: {
6095
+ select: UsageSnapshotEdgeSelect;
6096
+ };
6097
+ };
5981
6098
  export interface CreateOrgMemberProfilePayload {
5982
6099
  clientMutationId?: string | null;
5983
6100
  /** The `OrgMemberProfile` that was created by this mutation. */
@@ -6829,6 +6946,18 @@ export type OrgChartEdgeEdgeSelect = {
6829
6946
  select: OrgChartEdgeSelect;
6830
6947
  };
6831
6948
  };
6949
+ /** A `UsageSnapshot` edge in the connection. */
6950
+ export interface UsageSnapshotEdge {
6951
+ cursor?: string | null;
6952
+ /** The `UsageSnapshot` at the end of the edge. */
6953
+ node?: UsageSnapshot | null;
6954
+ }
6955
+ export type UsageSnapshotEdgeSelect = {
6956
+ cursor?: boolean;
6957
+ node?: {
6958
+ select: UsageSnapshotSelect;
6959
+ };
6960
+ };
6832
6961
  /** A `OrgMemberProfile` edge in the connection. */
6833
6962
  export interface OrgMemberProfileEdge {
6834
6963
  cursor?: string | null;
@@ -39,6 +39,7 @@ export { AppLimitEventModel } from './appLimitEvent';
39
39
  export { OrgLimitEventModel } from './orgLimitEvent';
40
40
  export { OrgGrantModel } from './orgGrant';
41
41
  export { OrgChartEdgeModel } from './orgChartEdge';
42
+ export { UsageSnapshotModel } from './usageSnapshot';
42
43
  export { OrgMemberProfileModel } from './orgMemberProfile';
43
44
  export { AppLevelModel } from './appLevel';
44
45
  export { AppLimitModel } from './appLimit';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrgMembershipModel = exports.AppMembershipModel = exports.OrgInviteModel = exports.OrgLimitModel = exports.OrgLimitAggregateModel = exports.OrgMembershipSettingModel = exports.AppInviteModel = exports.AppLimitModel = exports.AppLevelModel = exports.OrgMemberProfileModel = exports.OrgChartEdgeModel = exports.OrgGrantModel = exports.OrgLimitEventModel = exports.AppLimitEventModel = exports.OrgClaimedInviteModel = exports.OrgMembershipDefaultModel = exports.AppMembershipDefaultModel = exports.AppGrantModel = exports.AppClaimedInviteModel = exports.OrgChartEdgeGrantModel = exports.OrgLimitCreditModel = exports.OrgLimitDefaultModel = exports.AppLimitDefaultModel = exports.MembershipTypeModel = exports.OrgOwnerGrantModel = exports.OrgAdminGrantModel = exports.OrgLimitCapModel = exports.AppLimitCapModel = exports.OrgLimitCapsDefaultModel = exports.AppLimitCapsDefaultModel = exports.AppStepModel = exports.AppAchievementModel = exports.AppOwnerGrantModel = exports.AppAdminGrantModel = exports.OrgPermissionDefaultModel = exports.AppLimitCreditCodeModel = exports.AppPermissionDefaultModel = exports.OrgMemberModel = exports.AppLimitCreditModel = exports.AppLimitCreditCodeItemModel = exports.AppLimitCreditRedemptionModel = exports.AppLevelRequirementModel = exports.OrgPermissionModel = exports.AppPermissionModel = exports.OrgGetSubordinatesRecordModel = exports.OrgGetManagersRecordModel = void 0;
3
+ exports.OrgMembershipModel = exports.AppMembershipModel = exports.OrgInviteModel = exports.OrgLimitModel = exports.OrgLimitAggregateModel = exports.OrgMembershipSettingModel = exports.AppInviteModel = exports.AppLimitModel = exports.AppLevelModel = exports.OrgMemberProfileModel = exports.UsageSnapshotModel = exports.OrgChartEdgeModel = exports.OrgGrantModel = exports.OrgLimitEventModel = exports.AppLimitEventModel = exports.OrgClaimedInviteModel = exports.OrgMembershipDefaultModel = exports.AppMembershipDefaultModel = exports.AppGrantModel = exports.AppClaimedInviteModel = exports.OrgChartEdgeGrantModel = exports.OrgLimitCreditModel = exports.OrgLimitDefaultModel = exports.AppLimitDefaultModel = exports.MembershipTypeModel = exports.OrgOwnerGrantModel = exports.OrgAdminGrantModel = exports.OrgLimitCapModel = exports.AppLimitCapModel = exports.OrgLimitCapsDefaultModel = exports.AppLimitCapsDefaultModel = exports.AppStepModel = exports.AppAchievementModel = exports.AppOwnerGrantModel = exports.AppAdminGrantModel = exports.OrgPermissionDefaultModel = exports.AppLimitCreditCodeModel = exports.AppPermissionDefaultModel = exports.OrgMemberModel = exports.AppLimitCreditModel = exports.AppLimitCreditCodeItemModel = exports.AppLimitCreditRedemptionModel = exports.AppLevelRequirementModel = exports.OrgPermissionModel = exports.AppPermissionModel = exports.OrgGetSubordinatesRecordModel = exports.OrgGetManagersRecordModel = void 0;
4
4
  /**
5
5
  * Models barrel export
6
6
  * @generated by @constructive-io/graphql-codegen
@@ -78,6 +78,8 @@ var orgGrant_1 = require("./orgGrant");
78
78
  Object.defineProperty(exports, "OrgGrantModel", { enumerable: true, get: function () { return orgGrant_1.OrgGrantModel; } });
79
79
  var orgChartEdge_1 = require("./orgChartEdge");
80
80
  Object.defineProperty(exports, "OrgChartEdgeModel", { enumerable: true, get: function () { return orgChartEdge_1.OrgChartEdgeModel; } });
81
+ var usageSnapshot_1 = require("./usageSnapshot");
82
+ Object.defineProperty(exports, "UsageSnapshotModel", { enumerable: true, get: function () { return usageSnapshot_1.UsageSnapshotModel; } });
81
83
  var orgMemberProfile_1 = require("./orgMemberProfile");
82
84
  Object.defineProperty(exports, "OrgMemberProfileModel", { enumerable: true, get: function () { return orgMemberProfile_1.OrgMemberProfileModel; } });
83
85
  var appLevel_1 = require("./appLevel");
@@ -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;
@@ -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 type { AppAchievement, AppAdminGrant, AppClaimedInvite, AppGrant, AppInvite, AppLevel, AppLevelRequirement, AppLimit, AppLimitCap, AppLimitCapsDefault, AppLimitCredit, AppLimitCreditCode, AppLimitCreditCodeItem, AppLimitCreditRedemption, AppLimitDefault, AppLimitEvent, AppMembership, AppMembershipDefault, AppOwnerGrant, AppPermission, AppPermissionDefault, AppStep, MembershipType, OrgAdminGrant, OrgChartEdge, OrgChartEdgeGrant, OrgClaimedInvite, OrgGetManagersRecord, OrgGetSubordinatesRecord, OrgGrant, OrgInvite, OrgLimit, OrgLimitAggregate, OrgLimitCap, OrgLimitCapsDefault, OrgLimitCredit, OrgLimitDefault, OrgLimitEvent, OrgMember, OrgMemberProfile, OrgMembership, OrgMembershipDefault, OrgMembershipSetting, OrgOwnerGrant, OrgPermission, OrgPermissionDefault, BigIntFilter, BitStringFilter, BooleanFilter, DatetimeFilter, IntFilter, StringFilter, UUIDFilter } from './types';
6
+ import type { AppAchievement, AppAdminGrant, AppClaimedInvite, AppGrant, AppInvite, AppLevel, AppLevelRequirement, AppLimit, AppLimitCap, AppLimitCapsDefault, AppLimitCredit, AppLimitCreditCode, AppLimitCreditCodeItem, AppLimitCreditRedemption, AppLimitDefault, AppLimitEvent, AppMembership, AppMembershipDefault, AppOwnerGrant, AppPermission, AppPermissionDefault, AppStep, MembershipType, OrgAdminGrant, OrgChartEdge, OrgChartEdgeGrant, OrgClaimedInvite, OrgGetManagersRecord, OrgGetSubordinatesRecord, OrgGrant, OrgInvite, OrgLimit, OrgLimitAggregate, OrgLimitCap, OrgLimitCapsDefault, OrgLimitCredit, OrgLimitDefault, OrgLimitEvent, OrgMember, OrgMemberProfile, OrgMembership, OrgMembershipDefault, OrgMembershipSetting, OrgOwnerGrant, OrgPermission, OrgPermissionDefault, UsageSnapshot, BigIntFilter, BitStringFilter, BooleanFilter, DatetimeFilter, IntFilter, JSONFilter, StringFilter, UUIDFilter } from './types';
7
7
  export type ConstructiveInternalTypeEmail = unknown;
8
8
  export type ConstructiveInternalTypeImage = unknown;
9
9
  /** Methods to use when ordering `AppLimitCredit`. */
@@ -74,6 +74,8 @@ export type OrgLimitEventOrderBy = 'NATURAL' | 'NAME_ASC' | 'NAME_DESC' | 'ACTOR
74
74
  export type OrgGrantOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'PERMISSIONS_ASC' | 'PERMISSIONS_DESC' | 'IS_GRANT_ASC' | 'IS_GRANT_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC' | 'GRANTOR_ID_ASC' | 'GRANTOR_ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC';
75
75
  /** Methods to use when ordering `OrgChartEdge`. */
76
76
  export type OrgChartEdgeOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC' | 'CHILD_ID_ASC' | 'CHILD_ID_DESC' | 'PARENT_ID_ASC' | 'PARENT_ID_DESC' | 'POSITION_TITLE_ASC' | 'POSITION_TITLE_DESC' | 'POSITION_LEVEL_ASC' | 'POSITION_LEVEL_DESC';
77
+ /** Methods to use when ordering `UsageSnapshot`. */
78
+ 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';
77
79
  /** Methods to use when ordering `OrgMemberProfile`. */
78
80
  export type OrgMemberProfileOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'MEMBERSHIP_ID_ASC' | 'MEMBERSHIP_ID_DESC' | 'ENTITY_ID_ASC' | 'ENTITY_ID_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'DISPLAY_NAME_ASC' | 'DISPLAY_NAME_DESC' | 'EMAIL_ASC' | 'EMAIL_DESC' | 'TITLE_ASC' | 'TITLE_DESC' | 'BIO_ASC' | 'BIO_DESC' | 'PROFILE_PICTURE_ASC' | 'PROFILE_PICTURE_DESC';
79
81
  /** Methods to use when ordering `AppLevel`. */
@@ -863,6 +865,27 @@ export interface OrgChartEdgeFilter {
863
865
  /** Negates the expression. */
864
866
  not?: OrgChartEdgeFilter;
865
867
  }
868
+ /** A filter to be used against `UsageSnapshot` object types. All fields are combined with a logical ‘and.’ */
869
+ export interface UsageSnapshotFilter {
870
+ /** Filter by the object’s `databaseId` field. */
871
+ databaseId?: UUIDFilter;
872
+ /** Filter by the object’s `metricName` field. */
873
+ metricName?: StringFilter;
874
+ /** Filter by the object’s `metricValue` field. */
875
+ metricValue?: BigIntFilter;
876
+ /** Filter by the object’s `dimensions` field. */
877
+ dimensions?: JSONFilter;
878
+ /** Filter by the object’s `capturedAt` field. */
879
+ capturedAt?: DatetimeFilter;
880
+ /** Filter by the object’s `id` field. */
881
+ id?: UUIDFilter;
882
+ /** Checks for all expressions in this list. */
883
+ and?: UsageSnapshotFilter[];
884
+ /** Checks for any expressions in this list. */
885
+ or?: UsageSnapshotFilter[];
886
+ /** Negates the expression. */
887
+ not?: UsageSnapshotFilter;
888
+ }
866
889
  /** A filter to be used against `OrgMemberProfile` object types. All fields are combined with a logical ‘and.’ */
867
890
  export interface OrgMemberProfileFilter {
868
891
  /** Filter by the object’s `id` field. */
@@ -1969,6 +1992,25 @@ export interface OrgChartEdgeInput {
1969
1992
  /** Numeric seniority level for this position (higher = more senior) */
1970
1993
  positionLevel?: number;
1971
1994
  }
1995
+ export interface CreateUsageSnapshotInput {
1996
+ clientMutationId?: string;
1997
+ /** The `UsageSnapshot` to be created by this mutation. */
1998
+ usageSnapshot: UsageSnapshotInput;
1999
+ }
2000
+ /** An input for mutations affecting `UsageSnapshot` */
2001
+ export interface UsageSnapshotInput {
2002
+ /** 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. */
2003
+ databaseId: string;
2004
+ /** Identifier for the metric being measured (e.g. 'reads', 'writes', 'storage_bytes', 'compute_time_ms'). */
2005
+ metricName: string;
2006
+ /** The measured value at the time of capture. Interpretation depends on metric_name (count, bytes, milliseconds, etc.). */
2007
+ metricValue?: string;
2008
+ /** Optional sub-metric breakdowns as key-value pairs (e.g. {"query_type": "select"} for reads). Empty object when no breakdown is needed. */
2009
+ dimensions?: unknown;
2010
+ /** When this snapshot was taken. Defaults to the current timestamp; the snapshot collector may override this for backdated imports. */
2011
+ capturedAt?: string;
2012
+ id?: string;
2013
+ }
1972
2014
  export interface CreateOrgMemberProfileInput {
1973
2015
  clientMutationId?: string;
1974
2016
  /** The `OrgMemberProfile` to be created by this mutation. */
@@ -2846,6 +2888,26 @@ export interface OrgChartEdgePatch {
2846
2888
  /** Numeric seniority level for this position (higher = more senior) */
2847
2889
  positionLevel?: number;
2848
2890
  }
2891
+ export interface UpdateUsageSnapshotInput {
2892
+ clientMutationId?: string;
2893
+ id: string;
2894
+ /** An object where the defined keys will be set on the `UsageSnapshot` being updated. */
2895
+ usageSnapshotPatch: UsageSnapshotPatch;
2896
+ }
2897
+ /** Represents an update to a `UsageSnapshot`. Fields that are set will be updated. */
2898
+ export interface UsageSnapshotPatch {
2899
+ /** 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. */
2900
+ databaseId?: string;
2901
+ /** Identifier for the metric being measured (e.g. 'reads', 'writes', 'storage_bytes', 'compute_time_ms'). */
2902
+ metricName?: string;
2903
+ /** The measured value at the time of capture. Interpretation depends on metric_name (count, bytes, milliseconds, etc.). */
2904
+ metricValue?: string;
2905
+ /** Optional sub-metric breakdowns as key-value pairs (e.g. {"query_type": "select"} for reads). Empty object when no breakdown is needed. */
2906
+ dimensions?: unknown;
2907
+ /** When this snapshot was taken. Defaults to the current timestamp; the snapshot collector may override this for backdated imports. */
2908
+ capturedAt?: string;
2909
+ id?: string;
2910
+ }
2849
2911
  export interface UpdateOrgMemberProfileInput {
2850
2912
  clientMutationId?: string;
2851
2913
  id: string;
@@ -3293,6 +3355,10 @@ export interface DeleteOrgChartEdgeInput {
3293
3355
  clientMutationId?: string;
3294
3356
  id: string;
3295
3357
  }
3358
+ export interface DeleteUsageSnapshotInput {
3359
+ clientMutationId?: string;
3360
+ id: string;
3361
+ }
3296
3362
  export interface DeleteOrgMemberProfileInput {
3297
3363
  clientMutationId?: string;
3298
3364
  id: string;
@@ -3594,6 +3660,13 @@ export interface OrgChartEdgeConnection {
3594
3660
  pageInfo: PageInfo;
3595
3661
  totalCount: number;
3596
3662
  }
3663
+ /** A connection to a list of `UsageSnapshot` values. */
3664
+ export interface UsageSnapshotConnection {
3665
+ nodes: UsageSnapshot[];
3666
+ edges: UsageSnapshotEdge[];
3667
+ pageInfo: PageInfo;
3668
+ totalCount: number;
3669
+ }
3597
3670
  /** A connection to a list of `OrgMemberProfile` values. */
3598
3671
  export interface OrgMemberProfileConnection {
3599
3672
  nodes: OrgMemberProfile[];
@@ -3878,6 +3951,12 @@ export interface CreateOrgChartEdgePayload {
3878
3951
  orgChartEdge?: OrgChartEdge | null;
3879
3952
  orgChartEdgeEdge?: OrgChartEdgeEdge | null;
3880
3953
  }
3954
+ export interface CreateUsageSnapshotPayload {
3955
+ clientMutationId?: string | null;
3956
+ /** The `UsageSnapshot` that was created by this mutation. */
3957
+ usageSnapshot?: UsageSnapshot | null;
3958
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
3959
+ }
3881
3960
  export interface CreateOrgMemberProfilePayload {
3882
3961
  clientMutationId?: string | null;
3883
3962
  /** The `OrgMemberProfile` that was created by this mutation. */
@@ -4130,6 +4209,12 @@ export interface UpdateOrgChartEdgePayload {
4130
4209
  orgChartEdge?: OrgChartEdge | null;
4131
4210
  orgChartEdgeEdge?: OrgChartEdgeEdge | null;
4132
4211
  }
4212
+ export interface UpdateUsageSnapshotPayload {
4213
+ clientMutationId?: string | null;
4214
+ /** The `UsageSnapshot` that was updated by this mutation. */
4215
+ usageSnapshot?: UsageSnapshot | null;
4216
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
4217
+ }
4133
4218
  export interface UpdateOrgMemberProfilePayload {
4134
4219
  clientMutationId?: string | null;
4135
4220
  /** The `OrgMemberProfile` that was updated by this mutation. */
@@ -4382,6 +4467,12 @@ export interface DeleteOrgChartEdgePayload {
4382
4467
  orgChartEdge?: OrgChartEdge | null;
4383
4468
  orgChartEdgeEdge?: OrgChartEdgeEdge | null;
4384
4469
  }
4470
+ export interface DeleteUsageSnapshotPayload {
4471
+ clientMutationId?: string | null;
4472
+ /** The `UsageSnapshot` that was deleted by this mutation. */
4473
+ usageSnapshot?: UsageSnapshot | null;
4474
+ usageSnapshotEdge?: UsageSnapshotEdge | null;
4475
+ }
4385
4476
  export interface DeleteOrgMemberProfilePayload {
4386
4477
  clientMutationId?: string | null;
4387
4478
  /** The `OrgMemberProfile` that was deleted by this mutation. */
@@ -4683,6 +4774,12 @@ export interface OrgChartEdgeEdge {
4683
4774
  /** The `OrgChartEdge` at the end of the edge. */
4684
4775
  node?: OrgChartEdge | null;
4685
4776
  }
4777
+ /** A `UsageSnapshot` edge in the connection. */
4778
+ export interface UsageSnapshotEdge {
4779
+ cursor?: string | null;
4780
+ /** The `UsageSnapshot` at the end of the edge. */
4781
+ node?: UsageSnapshot | null;
4782
+ }
4686
4783
  /** A `OrgMemberProfile` edge in the connection. */
4687
4784
  export interface OrgMemberProfileEdge {
4688
4785
  cursor?: string | null;