@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.
- package/admin/hooks/index.d.ts +1 -1
- package/admin/hooks/index.js +1 -1
- package/admin/hooks/invalidation.d.ts +6 -0
- package/admin/hooks/invalidation.js +16 -0
- package/admin/hooks/mutation-keys.d.ts +12 -0
- package/admin/hooks/mutation-keys.js +8 -1
- package/admin/hooks/mutations/index.d.ts +3 -0
- package/admin/hooks/mutations/index.js +3 -0
- package/admin/hooks/mutations/useCreateUsageSnapshotMutation.d.ts +34 -0
- package/admin/hooks/mutations/useCreateUsageSnapshotMutation.js +34 -0
- package/admin/hooks/mutations/useDeleteUsageSnapshotMutation.d.ts +38 -0
- package/admin/hooks/mutations/useDeleteUsageSnapshotMutation.js +39 -0
- package/admin/hooks/mutations/useUpdateUsageSnapshotMutation.d.ts +40 -0
- package/admin/hooks/mutations/useUpdateUsageSnapshotMutation.js +40 -0
- package/admin/hooks/queries/index.d.ts +2 -0
- package/admin/hooks/queries/index.js +2 -0
- package/admin/hooks/queries/useUsageSnapshotQuery.d.ts +65 -0
- package/admin/hooks/queries/useUsageSnapshotQuery.js +53 -0
- package/admin/hooks/queries/useUsageSnapshotsQuery.d.ts +69 -0
- package/admin/hooks/queries/useUsageSnapshotsQuery.js +38 -0
- package/admin/hooks/query-keys.d.ts +14 -0
- package/admin/hooks/query-keys.js +9 -1
- package/admin/orm/index.d.ts +2 -0
- package/admin/orm/index.js +2 -0
- package/admin/orm/input-types.d.ts +129 -0
- package/admin/orm/models/index.d.ts +1 -0
- package/admin/orm/models/index.js +3 -1
- package/admin/orm/models/usageSnapshot.d.ts +56 -0
- package/admin/orm/models/usageSnapshot.js +100 -0
- package/admin/schema-types.d.ts +98 -1
- package/admin/types.d.ts +8 -0
- package/esm/admin/hooks/index.d.ts +1 -1
- package/esm/admin/hooks/index.js +1 -1
- package/esm/admin/hooks/invalidation.d.ts +6 -0
- package/esm/admin/hooks/invalidation.js +17 -1
- package/esm/admin/hooks/mutation-keys.d.ts +12 -0
- package/esm/admin/hooks/mutation-keys.js +7 -0
- package/esm/admin/hooks/mutations/index.d.ts +3 -0
- package/esm/admin/hooks/mutations/index.js +3 -0
- package/esm/admin/hooks/mutations/useCreateUsageSnapshotMutation.d.ts +34 -0
- package/esm/admin/hooks/mutations/useCreateUsageSnapshotMutation.js +31 -0
- package/esm/admin/hooks/mutations/useDeleteUsageSnapshotMutation.d.ts +38 -0
- package/esm/admin/hooks/mutations/useDeleteUsageSnapshotMutation.js +36 -0
- package/esm/admin/hooks/mutations/useUpdateUsageSnapshotMutation.d.ts +40 -0
- package/esm/admin/hooks/mutations/useUpdateUsageSnapshotMutation.js +37 -0
- package/esm/admin/hooks/queries/index.d.ts +2 -0
- package/esm/admin/hooks/queries/index.js +2 -0
- package/esm/admin/hooks/queries/useUsageSnapshotQuery.d.ts +65 -0
- package/esm/admin/hooks/queries/useUsageSnapshotQuery.js +47 -0
- package/esm/admin/hooks/queries/useUsageSnapshotsQuery.d.ts +69 -0
- package/esm/admin/hooks/queries/useUsageSnapshotsQuery.js +32 -0
- package/esm/admin/hooks/query-keys.d.ts +14 -0
- package/esm/admin/hooks/query-keys.js +8 -0
- package/esm/admin/orm/index.d.ts +2 -0
- package/esm/admin/orm/index.js +2 -0
- package/esm/admin/orm/input-types.d.ts +129 -0
- package/esm/admin/orm/models/index.d.ts +1 -0
- package/esm/admin/orm/models/index.js +1 -0
- package/esm/admin/orm/models/usageSnapshot.d.ts +56 -0
- package/esm/admin/orm/models/usageSnapshot.js +96 -0
- package/esm/admin/schema-types.d.ts +98 -1
- package/esm/admin/types.d.ts +8 -0
- package/esm/public/hooks/index.d.ts +1 -1
- package/esm/public/hooks/index.js +1 -1
- package/esm/public/hooks/invalidation.d.ts +6 -0
- package/esm/public/hooks/invalidation.js +17 -1
- package/esm/public/hooks/mutation-keys.d.ts +12 -0
- package/esm/public/hooks/mutation-keys.js +7 -0
- package/esm/public/hooks/mutations/index.d.ts +3 -0
- package/esm/public/hooks/mutations/index.js +3 -0
- package/esm/public/hooks/mutations/useCreateUsageSnapshotMutation.d.ts +34 -0
- package/esm/public/hooks/mutations/useCreateUsageSnapshotMutation.js +31 -0
- package/esm/public/hooks/mutations/useDeleteUsageSnapshotMutation.d.ts +38 -0
- package/esm/public/hooks/mutations/useDeleteUsageSnapshotMutation.js +36 -0
- package/esm/public/hooks/mutations/useUpdateUsageSnapshotMutation.d.ts +40 -0
- package/esm/public/hooks/mutations/useUpdateUsageSnapshotMutation.js +37 -0
- package/esm/public/hooks/queries/index.d.ts +2 -0
- package/esm/public/hooks/queries/index.js +2 -0
- package/esm/public/hooks/queries/useUsageSnapshotQuery.d.ts +65 -0
- package/esm/public/hooks/queries/useUsageSnapshotQuery.js +47 -0
- package/esm/public/hooks/queries/useUsageSnapshotsQuery.d.ts +69 -0
- package/esm/public/hooks/queries/useUsageSnapshotsQuery.js +32 -0
- package/esm/public/hooks/query-keys.d.ts +14 -0
- package/esm/public/hooks/query-keys.js +8 -0
- package/esm/public/orm/index.d.ts +2 -0
- package/esm/public/orm/index.js +2 -0
- package/esm/public/orm/input-types.d.ts +129 -0
- package/esm/public/orm/models/index.d.ts +1 -0
- package/esm/public/orm/models/index.js +1 -0
- package/esm/public/orm/models/usageSnapshot.d.ts +56 -0
- package/esm/public/orm/models/usageSnapshot.js +96 -0
- package/esm/public/schema-types.d.ts +379 -282
- package/esm/public/types.d.ts +8 -0
- package/package.json +6 -6
- package/public/hooks/index.d.ts +1 -1
- package/public/hooks/index.js +1 -1
- package/public/hooks/invalidation.d.ts +6 -0
- package/public/hooks/invalidation.js +16 -0
- package/public/hooks/mutation-keys.d.ts +12 -0
- package/public/hooks/mutation-keys.js +9 -1
- package/public/hooks/mutations/index.d.ts +3 -0
- package/public/hooks/mutations/index.js +3 -0
- package/public/hooks/mutations/useCreateUsageSnapshotMutation.d.ts +34 -0
- package/public/hooks/mutations/useCreateUsageSnapshotMutation.js +34 -0
- package/public/hooks/mutations/useDeleteUsageSnapshotMutation.d.ts +38 -0
- package/public/hooks/mutations/useDeleteUsageSnapshotMutation.js +39 -0
- package/public/hooks/mutations/useUpdateUsageSnapshotMutation.d.ts +40 -0
- package/public/hooks/mutations/useUpdateUsageSnapshotMutation.js +40 -0
- package/public/hooks/queries/index.d.ts +2 -0
- package/public/hooks/queries/index.js +2 -0
- package/public/hooks/queries/useUsageSnapshotQuery.d.ts +65 -0
- package/public/hooks/queries/useUsageSnapshotQuery.js +53 -0
- package/public/hooks/queries/useUsageSnapshotsQuery.d.ts +69 -0
- package/public/hooks/queries/useUsageSnapshotsQuery.js +38 -0
- package/public/hooks/query-keys.d.ts +14 -0
- package/public/hooks/query-keys.js +10 -1
- package/public/orm/index.d.ts +2 -0
- package/public/orm/index.js +2 -0
- package/public/orm/input-types.d.ts +129 -0
- package/public/orm/models/index.d.ts +1 -0
- package/public/orm/models/index.js +3 -1
- package/public/orm/models/usageSnapshot.d.ts +56 -0
- package/public/orm/models/usageSnapshot.js +100 -0
- package/public/schema-types.d.ts +379 -282
- package/public/types.d.ts +8 -0
package/admin/types.d.ts
CHANGED
|
@@ -277,6 +277,14 @@ export interface OrgChartEdge {
|
|
|
277
277
|
positionTitle: string | null;
|
|
278
278
|
positionLevel: number | null;
|
|
279
279
|
}
|
|
280
|
+
export interface UsageSnapshot {
|
|
281
|
+
databaseId: string | null;
|
|
282
|
+
metricName: string | null;
|
|
283
|
+
metricValue: string | null;
|
|
284
|
+
dimensions: unknown | null;
|
|
285
|
+
capturedAt: string | null;
|
|
286
|
+
id: string | null;
|
|
287
|
+
}
|
|
280
288
|
export interface OrgMemberProfile {
|
|
281
289
|
id: string | null;
|
|
282
290
|
createdAt: string | null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* GraphQL SDK
|
|
3
3
|
* @generated by @constructive-io/graphql-codegen
|
|
4
4
|
*
|
|
5
|
-
* Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, AppPermission, OrgPermission, AppLevelRequirement, AppLimitCreditRedemption, AppLimitCreditCodeItem, AppLimitCredit, OrgMember, AppPermissionDefault, AppLimitCreditCode, OrgPermissionDefault, AppAdminGrant, AppOwnerGrant, AppAchievement, AppStep, AppLimitCapsDefault, OrgLimitCapsDefault, AppLimitCap, OrgLimitCap, OrgAdminGrant, OrgOwnerGrant, MembershipType, AppLimitDefault, OrgLimitDefault, OrgLimitCredit, OrgChartEdgeGrant, AppClaimedInvite, AppGrant, AppMembershipDefault, OrgMembershipDefault, OrgClaimedInvite, AppLimitEvent, OrgLimitEvent, OrgGrant, OrgChartEdge, OrgMemberProfile, AppLevel, AppLimit, AppInvite, OrgMembershipSetting, OrgLimitAggregate, OrgLimit, OrgInvite, AppMembership, OrgMembership
|
|
5
|
+
* Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, AppPermission, OrgPermission, AppLevelRequirement, AppLimitCreditRedemption, AppLimitCreditCodeItem, AppLimitCredit, OrgMember, AppPermissionDefault, AppLimitCreditCode, OrgPermissionDefault, AppAdminGrant, AppOwnerGrant, AppAchievement, AppStep, AppLimitCapsDefault, OrgLimitCapsDefault, AppLimitCap, OrgLimitCap, OrgAdminGrant, OrgOwnerGrant, MembershipType, AppLimitDefault, OrgLimitDefault, OrgLimitCredit, OrgChartEdgeGrant, AppClaimedInvite, AppGrant, AppMembershipDefault, OrgMembershipDefault, OrgClaimedInvite, AppLimitEvent, OrgLimitEvent, OrgGrant, OrgChartEdge, UsageSnapshot, OrgMemberProfile, AppLevel, AppLimit, AppInvite, OrgMembershipSetting, OrgLimitAggregate, OrgLimit, OrgInvite, AppMembership, OrgMembership
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
*
|
package/esm/admin/hooks/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* GraphQL SDK
|
|
3
3
|
* @generated by @constructive-io/graphql-codegen
|
|
4
4
|
*
|
|
5
|
-
* Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, AppPermission, OrgPermission, AppLevelRequirement, AppLimitCreditRedemption, AppLimitCreditCodeItem, AppLimitCredit, OrgMember, AppPermissionDefault, AppLimitCreditCode, OrgPermissionDefault, AppAdminGrant, AppOwnerGrant, AppAchievement, AppStep, AppLimitCapsDefault, OrgLimitCapsDefault, AppLimitCap, OrgLimitCap, OrgAdminGrant, OrgOwnerGrant, MembershipType, AppLimitDefault, OrgLimitDefault, OrgLimitCredit, OrgChartEdgeGrant, AppClaimedInvite, AppGrant, AppMembershipDefault, OrgMembershipDefault, OrgClaimedInvite, AppLimitEvent, OrgLimitEvent, OrgGrant, OrgChartEdge, OrgMemberProfile, AppLevel, AppLimit, AppInvite, OrgMembershipSetting, OrgLimitAggregate, OrgLimit, OrgInvite, AppMembership, OrgMembership
|
|
5
|
+
* Tables: OrgGetManagersRecord, OrgGetSubordinatesRecord, AppPermission, OrgPermission, AppLevelRequirement, AppLimitCreditRedemption, AppLimitCreditCodeItem, AppLimitCredit, OrgMember, AppPermissionDefault, AppLimitCreditCode, OrgPermissionDefault, AppAdminGrant, AppOwnerGrant, AppAchievement, AppStep, AppLimitCapsDefault, OrgLimitCapsDefault, AppLimitCap, OrgLimitCap, OrgAdminGrant, OrgOwnerGrant, MembershipType, AppLimitDefault, OrgLimitDefault, OrgLimitCredit, OrgChartEdgeGrant, AppClaimedInvite, AppGrant, AppMembershipDefault, OrgMembershipDefault, OrgClaimedInvite, AppLimitEvent, OrgLimitEvent, OrgGrant, OrgChartEdge, UsageSnapshot, OrgMemberProfile, AppLevel, AppLimit, AppInvite, OrgMembershipSetting, OrgLimitAggregate, OrgLimit, OrgInvite, AppMembership, OrgMembership
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
*
|
|
@@ -204,6 +204,11 @@ export declare const invalidate: {
|
|
|
204
204
|
/** Invalidate orgChartEdge list queries */ readonly lists: (queryClient: QueryClient) => Promise<void>;
|
|
205
205
|
/** Invalidate a specific orgChartEdge */ readonly detail: (queryClient: QueryClient, id: string | number) => Promise<void>;
|
|
206
206
|
};
|
|
207
|
+
/** Invalidate usageSnapshot queries */ readonly usageSnapshot: {
|
|
208
|
+
/** Invalidate all usageSnapshot queries */ readonly all: (queryClient: QueryClient) => Promise<void>;
|
|
209
|
+
/** Invalidate usageSnapshot list queries */ readonly lists: (queryClient: QueryClient) => Promise<void>;
|
|
210
|
+
/** Invalidate a specific usageSnapshot */ readonly detail: (queryClient: QueryClient, id: string | number) => Promise<void>;
|
|
211
|
+
};
|
|
207
212
|
/** Invalidate orgMemberProfile queries */ readonly orgMemberProfile: {
|
|
208
213
|
/** Invalidate all orgMemberProfile queries */ readonly all: (queryClient: QueryClient) => Promise<void>;
|
|
209
214
|
/** Invalidate orgMemberProfile list queries */ readonly lists: (queryClient: QueryClient) => Promise<void>;
|
|
@@ -303,6 +308,7 @@ export declare const remove: {
|
|
|
303
308
|
/** Remove orgLimitEvent from cache */ readonly orgLimitEvent: (queryClient: QueryClient, id: string | number) => void;
|
|
304
309
|
/** Remove orgGrant from cache */ readonly orgGrant: (queryClient: QueryClient, id: string | number) => void;
|
|
305
310
|
/** Remove orgChartEdge from cache */ readonly orgChartEdge: (queryClient: QueryClient, id: string | number) => void;
|
|
311
|
+
/** Remove usageSnapshot from cache */ readonly usageSnapshot: (queryClient: QueryClient, id: string | number) => void;
|
|
306
312
|
/** Remove orgMemberProfile from cache */ readonly orgMemberProfile: (queryClient: QueryClient, id: string | number) => void;
|
|
307
313
|
/** Remove appLevel from cache */ readonly appLevel: (queryClient: QueryClient, id: string | number) => void;
|
|
308
314
|
/** Remove appLimit from cache */ readonly appLimit: (queryClient: QueryClient, id: string | number) => void;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @generated by @constructive-io/graphql-codegen
|
|
4
4
|
* DO NOT EDIT - changes will be overwritten
|
|
5
5
|
*/
|
|
6
|
-
import { orgGetManagersRecordKeys, orgGetSubordinatesRecordKeys, appPermissionKeys, orgPermissionKeys, appLevelRequirementKeys, appLimitCreditRedemptionKeys, appLimitCreditCodeItemKeys, appLimitCreditKeys, orgMemberKeys, appPermissionDefaultKeys, appLimitCreditCodeKeys, orgPermissionDefaultKeys, appAdminGrantKeys, appOwnerGrantKeys, appAchievementKeys, appStepKeys, appLimitCapsDefaultKeys, orgLimitCapsDefaultKeys, appLimitCapKeys, orgLimitCapKeys, orgAdminGrantKeys, orgOwnerGrantKeys, membershipTypeKeys, appLimitDefaultKeys, orgLimitDefaultKeys, orgLimitCreditKeys, orgChartEdgeGrantKeys, appClaimedInviteKeys, appGrantKeys, appMembershipDefaultKeys, orgMembershipDefaultKeys, orgClaimedInviteKeys, appLimitEventKeys, orgLimitEventKeys, orgGrantKeys, orgChartEdgeKeys, orgMemberProfileKeys, appLevelKeys, appLimitKeys, appInviteKeys, orgMembershipSettingKeys, orgLimitAggregateKeys, orgLimitKeys, orgInviteKeys, appMembershipKeys, orgMembershipKeys, } from './query-keys';
|
|
6
|
+
import { orgGetManagersRecordKeys, orgGetSubordinatesRecordKeys, appPermissionKeys, orgPermissionKeys, appLevelRequirementKeys, appLimitCreditRedemptionKeys, appLimitCreditCodeItemKeys, appLimitCreditKeys, orgMemberKeys, appPermissionDefaultKeys, appLimitCreditCodeKeys, orgPermissionDefaultKeys, appAdminGrantKeys, appOwnerGrantKeys, appAchievementKeys, appStepKeys, appLimitCapsDefaultKeys, orgLimitCapsDefaultKeys, appLimitCapKeys, orgLimitCapKeys, orgAdminGrantKeys, orgOwnerGrantKeys, membershipTypeKeys, appLimitDefaultKeys, orgLimitDefaultKeys, orgLimitCreditKeys, orgChartEdgeGrantKeys, appClaimedInviteKeys, appGrantKeys, appMembershipDefaultKeys, orgMembershipDefaultKeys, orgClaimedInviteKeys, appLimitEventKeys, orgLimitEventKeys, orgGrantKeys, orgChartEdgeKeys, usageSnapshotKeys, orgMemberProfileKeys, appLevelKeys, appLimitKeys, appInviteKeys, orgMembershipSettingKeys, orgLimitAggregateKeys, orgLimitKeys, orgInviteKeys, appMembershipKeys, orgMembershipKeys, } from './query-keys';
|
|
7
7
|
/**
|
|
8
8
|
// ============================================================================
|
|
9
9
|
// Invalidation Helpers
|
|
@@ -420,6 +420,17 @@ export const invalidate = {
|
|
|
420
420
|
queryKey: orgChartEdgeKeys.detail(id),
|
|
421
421
|
}),
|
|
422
422
|
},
|
|
423
|
+
/** Invalidate usageSnapshot queries */ usageSnapshot: {
|
|
424
|
+
/** Invalidate all usageSnapshot queries */ all: (queryClient) => queryClient.invalidateQueries({
|
|
425
|
+
queryKey: usageSnapshotKeys.all,
|
|
426
|
+
}),
|
|
427
|
+
/** Invalidate usageSnapshot list queries */ lists: (queryClient) => queryClient.invalidateQueries({
|
|
428
|
+
queryKey: usageSnapshotKeys.lists(),
|
|
429
|
+
}),
|
|
430
|
+
/** Invalidate a specific usageSnapshot */ detail: (queryClient, id) => queryClient.invalidateQueries({
|
|
431
|
+
queryKey: usageSnapshotKeys.detail(id),
|
|
432
|
+
}),
|
|
433
|
+
},
|
|
423
434
|
/** Invalidate orgMemberProfile queries */ orgMemberProfile: {
|
|
424
435
|
/** Invalidate all orgMemberProfile queries */ all: (queryClient) => queryClient.invalidateQueries({
|
|
425
436
|
queryKey: orgMemberProfileKeys.all,
|
|
@@ -723,6 +734,11 @@ export const remove = {
|
|
|
723
734
|
queryKey: orgChartEdgeKeys.detail(id),
|
|
724
735
|
});
|
|
725
736
|
},
|
|
737
|
+
/** Remove usageSnapshot from cache */ usageSnapshot: (queryClient, id) => {
|
|
738
|
+
queryClient.removeQueries({
|
|
739
|
+
queryKey: usageSnapshotKeys.detail(id),
|
|
740
|
+
});
|
|
741
|
+
},
|
|
726
742
|
/** Remove orgMemberProfile from cache */ orgMemberProfile: (queryClient, id) => {
|
|
727
743
|
queryClient.removeQueries({
|
|
728
744
|
queryKey: orgMemberProfileKeys.detail(id),
|
|
@@ -219,6 +219,12 @@ export declare const orgChartEdgeMutationKeys: {
|
|
|
219
219
|
/** Update orgChartEdge mutation key */ readonly update: (id: string | number) => readonly ["mutation", "orgchartedge", "update", string | number];
|
|
220
220
|
/** Delete orgChartEdge mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "orgchartedge", "delete", string | number];
|
|
221
221
|
};
|
|
222
|
+
export declare const usageSnapshotMutationKeys: {
|
|
223
|
+
/** All usageSnapshot mutation keys */ readonly all: readonly ["mutation", "usagesnapshot"];
|
|
224
|
+
/** Create usageSnapshot mutation key */ readonly create: () => readonly ["mutation", "usagesnapshot", "create"];
|
|
225
|
+
/** Update usageSnapshot mutation key */ readonly update: (id: string | number) => readonly ["mutation", "usagesnapshot", "update", string | number];
|
|
226
|
+
/** Delete usageSnapshot mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "usagesnapshot", "delete", string | number];
|
|
227
|
+
};
|
|
222
228
|
export declare const orgMemberProfileMutationKeys: {
|
|
223
229
|
/** All orgMemberProfile mutation keys */ readonly all: readonly ["mutation", "orgmemberprofile"];
|
|
224
230
|
/** Create orgMemberProfile mutation key */ readonly create: () => readonly ["mutation", "orgmemberprofile", "create"];
|
|
@@ -523,6 +529,12 @@ export declare const mutationKeys: {
|
|
|
523
529
|
/** Update orgChartEdge mutation key */ readonly update: (id: string | number) => readonly ["mutation", "orgchartedge", "update", string | number];
|
|
524
530
|
/** Delete orgChartEdge mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "orgchartedge", "delete", string | number];
|
|
525
531
|
};
|
|
532
|
+
readonly usageSnapshot: {
|
|
533
|
+
/** All usageSnapshot mutation keys */ readonly all: readonly ["mutation", "usagesnapshot"];
|
|
534
|
+
/** Create usageSnapshot mutation key */ readonly create: () => readonly ["mutation", "usagesnapshot", "create"];
|
|
535
|
+
/** Update usageSnapshot mutation key */ readonly update: (id: string | number) => readonly ["mutation", "usagesnapshot", "update", string | number];
|
|
536
|
+
/** Delete usageSnapshot mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "usagesnapshot", "delete", string | number];
|
|
537
|
+
};
|
|
526
538
|
readonly orgMemberProfile: {
|
|
527
539
|
/** All orgMemberProfile mutation keys */ readonly all: readonly ["mutation", "orgmemberprofile"];
|
|
528
540
|
/** Create orgMemberProfile mutation key */ readonly create: () => readonly ["mutation", "orgmemberprofile", "create"];
|
|
@@ -240,6 +240,12 @@ export const orgChartEdgeMutationKeys = {
|
|
|
240
240
|
/** Update orgChartEdge mutation key */ update: (id) => ['mutation', 'orgchartedge', 'update', id],
|
|
241
241
|
/** Delete orgChartEdge mutation key */ delete: (id) => ['mutation', 'orgchartedge', 'delete', id],
|
|
242
242
|
};
|
|
243
|
+
export const usageSnapshotMutationKeys = {
|
|
244
|
+
/** All usageSnapshot mutation keys */ all: ['mutation', 'usagesnapshot'],
|
|
245
|
+
/** Create usageSnapshot mutation key */ create: () => ['mutation', 'usagesnapshot', 'create'],
|
|
246
|
+
/** Update usageSnapshot mutation key */ update: (id) => ['mutation', 'usagesnapshot', 'update', id],
|
|
247
|
+
/** Delete usageSnapshot mutation key */ delete: (id) => ['mutation', 'usagesnapshot', 'delete', id],
|
|
248
|
+
};
|
|
243
249
|
export const orgMemberProfileMutationKeys = {
|
|
244
250
|
/** All orgMemberProfile mutation keys */ all: ['mutation', 'orgmemberprofile'],
|
|
245
251
|
/** Create orgMemberProfile mutation key */ create: () => ['mutation', 'orgmemberprofile', 'create'],
|
|
@@ -373,6 +379,7 @@ export const mutationKeys = {
|
|
|
373
379
|
orgLimitEvent: orgLimitEventMutationKeys,
|
|
374
380
|
orgGrant: orgGrantMutationKeys,
|
|
375
381
|
orgChartEdge: orgChartEdgeMutationKeys,
|
|
382
|
+
usageSnapshot: usageSnapshotMutationKeys,
|
|
376
383
|
orgMemberProfile: orgMemberProfileMutationKeys,
|
|
377
384
|
appLevel: appLevelMutationKeys,
|
|
378
385
|
appLimit: appLimitMutationKeys,
|
|
@@ -103,6 +103,9 @@ export * from './useDeleteOrgGrantMutation';
|
|
|
103
103
|
export * from './useCreateOrgChartEdgeMutation';
|
|
104
104
|
export * from './useUpdateOrgChartEdgeMutation';
|
|
105
105
|
export * from './useDeleteOrgChartEdgeMutation';
|
|
106
|
+
export * from './useCreateUsageSnapshotMutation';
|
|
107
|
+
export * from './useUpdateUsageSnapshotMutation';
|
|
108
|
+
export * from './useDeleteUsageSnapshotMutation';
|
|
106
109
|
export * from './useCreateOrgMemberProfileMutation';
|
|
107
110
|
export * from './useUpdateOrgMemberProfileMutation';
|
|
108
111
|
export * from './useDeleteOrgMemberProfileMutation';
|
|
@@ -103,6 +103,9 @@ export * from './useDeleteOrgGrantMutation';
|
|
|
103
103
|
export * from './useCreateOrgChartEdgeMutation';
|
|
104
104
|
export * from './useUpdateOrgChartEdgeMutation';
|
|
105
105
|
export * from './useDeleteOrgChartEdgeMutation';
|
|
106
|
+
export * from './useCreateUsageSnapshotMutation';
|
|
107
|
+
export * from './useUpdateUsageSnapshotMutation';
|
|
108
|
+
export * from './useDeleteUsageSnapshotMutation';
|
|
106
109
|
export * from './useCreateOrgMemberProfileMutation';
|
|
107
110
|
export * from './useUpdateOrgMemberProfileMutation';
|
|
108
111
|
export * from './useDeleteOrgMemberProfileMutation';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
7
|
+
import type { UsageSnapshotSelect, UsageSnapshotWithRelations, CreateUsageSnapshotInput } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { UsageSnapshotSelect, UsageSnapshotWithRelations, CreateUsageSnapshotInput, } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useCreateUsageSnapshotMutation({
|
|
16
|
+
* selection: { fields: { id: true, name: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ name: 'New item' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useCreateUsageSnapshotMutation<S extends UsageSnapshotSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & UsageSnapshotSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
createUsageSnapshot: {
|
|
28
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, CreateUsageSnapshotInput['usageSnapshot']>, 'mutationFn'>): UseMutationResult<{
|
|
31
|
+
createUsageSnapshot: {
|
|
32
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
33
|
+
};
|
|
34
|
+
}, Error, CreateUsageSnapshotInput['usageSnapshot']>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
7
|
+
import { getClient } from '../client';
|
|
8
|
+
import { buildSelectionArgs } from '../selection';
|
|
9
|
+
import { usageSnapshotKeys } from '../query-keys';
|
|
10
|
+
import { usageSnapshotMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useCreateUsageSnapshotMutation(params) {
|
|
12
|
+
const args = buildSelectionArgs(params.selection);
|
|
13
|
+
const { selection: _selection, ...mutationOptions } = params ?? {};
|
|
14
|
+
void _selection;
|
|
15
|
+
const queryClient = useQueryClient();
|
|
16
|
+
return useMutation({
|
|
17
|
+
mutationKey: usageSnapshotMutationKeys.create(),
|
|
18
|
+
mutationFn: (data) => getClient()
|
|
19
|
+
.usageSnapshot.create({
|
|
20
|
+
data,
|
|
21
|
+
select: args.select,
|
|
22
|
+
})
|
|
23
|
+
.unwrap(),
|
|
24
|
+
onSuccess: () => {
|
|
25
|
+
queryClient.invalidateQueries({
|
|
26
|
+
queryKey: usageSnapshotKeys.lists(),
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
...mutationOptions,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
7
|
+
import type { UsageSnapshotSelect, UsageSnapshotWithRelations } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { UsageSnapshotSelect, UsageSnapshotWithRelations } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useDeleteUsageSnapshotMutation({
|
|
16
|
+
* selection: { fields: { id: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-to-delete' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDeleteUsageSnapshotMutation<S extends UsageSnapshotSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & UsageSnapshotSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
deleteUsageSnapshot: {
|
|
28
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
33
|
+
deleteUsageSnapshot: {
|
|
34
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
35
|
+
};
|
|
36
|
+
}, Error, {
|
|
37
|
+
id: string;
|
|
38
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
7
|
+
import { getClient } from '../client';
|
|
8
|
+
import { buildSelectionArgs } from '../selection';
|
|
9
|
+
import { usageSnapshotKeys } from '../query-keys';
|
|
10
|
+
import { usageSnapshotMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useDeleteUsageSnapshotMutation(params) {
|
|
12
|
+
const args = buildSelectionArgs(params.selection);
|
|
13
|
+
const { selection: _selection, ...mutationOptions } = params ?? {};
|
|
14
|
+
void _selection;
|
|
15
|
+
const queryClient = useQueryClient();
|
|
16
|
+
return useMutation({
|
|
17
|
+
mutationKey: usageSnapshotMutationKeys.all,
|
|
18
|
+
mutationFn: ({ id }) => getClient()
|
|
19
|
+
.usageSnapshot.delete({
|
|
20
|
+
where: {
|
|
21
|
+
id,
|
|
22
|
+
},
|
|
23
|
+
select: args.select,
|
|
24
|
+
})
|
|
25
|
+
.unwrap(),
|
|
26
|
+
onSuccess: (_, variables) => {
|
|
27
|
+
queryClient.removeQueries({
|
|
28
|
+
queryKey: usageSnapshotKeys.detail(variables.id),
|
|
29
|
+
});
|
|
30
|
+
queryClient.invalidateQueries({
|
|
31
|
+
queryKey: usageSnapshotKeys.lists(),
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
...mutationOptions,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
7
|
+
import type { UsageSnapshotSelect, UsageSnapshotWithRelations, UsageSnapshotPatch } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { UsageSnapshotSelect, UsageSnapshotWithRelations, UsageSnapshotPatch, } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useUpdateUsageSnapshotMutation({
|
|
16
|
+
* selection: { fields: { id: true, name: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-here', usageSnapshotPatch: { name: 'Updated' } });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useUpdateUsageSnapshotMutation<S extends UsageSnapshotSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & UsageSnapshotSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
updateUsageSnapshot: {
|
|
28
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
usageSnapshotPatch: UsageSnapshotPatch;
|
|
33
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
34
|
+
updateUsageSnapshot: {
|
|
35
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S>;
|
|
36
|
+
};
|
|
37
|
+
}, Error, {
|
|
38
|
+
id: string;
|
|
39
|
+
usageSnapshotPatch: UsageSnapshotPatch;
|
|
40
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
7
|
+
import { getClient } from '../client';
|
|
8
|
+
import { buildSelectionArgs } from '../selection';
|
|
9
|
+
import { usageSnapshotKeys } from '../query-keys';
|
|
10
|
+
import { usageSnapshotMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useUpdateUsageSnapshotMutation(params) {
|
|
12
|
+
const args = buildSelectionArgs(params.selection);
|
|
13
|
+
const { selection: _selection, ...mutationOptions } = params ?? {};
|
|
14
|
+
void _selection;
|
|
15
|
+
const queryClient = useQueryClient();
|
|
16
|
+
return useMutation({
|
|
17
|
+
mutationKey: usageSnapshotMutationKeys.all,
|
|
18
|
+
mutationFn: ({ id, usageSnapshotPatch, }) => getClient()
|
|
19
|
+
.usageSnapshot.update({
|
|
20
|
+
where: {
|
|
21
|
+
id,
|
|
22
|
+
},
|
|
23
|
+
data: usageSnapshotPatch,
|
|
24
|
+
select: args.select,
|
|
25
|
+
})
|
|
26
|
+
.unwrap(),
|
|
27
|
+
onSuccess: (_, variables) => {
|
|
28
|
+
queryClient.invalidateQueries({
|
|
29
|
+
queryKey: usageSnapshotKeys.detail(variables.id),
|
|
30
|
+
});
|
|
31
|
+
queryClient.invalidateQueries({
|
|
32
|
+
queryKey: usageSnapshotKeys.lists(),
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
...mutationOptions,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -71,6 +71,8 @@ export * from './useOrgGrantsQuery';
|
|
|
71
71
|
export * from './useOrgGrantQuery';
|
|
72
72
|
export * from './useOrgChartEdgesQuery';
|
|
73
73
|
export * from './useOrgChartEdgeQuery';
|
|
74
|
+
export * from './useUsageSnapshotsQuery';
|
|
75
|
+
export * from './useUsageSnapshotQuery';
|
|
74
76
|
export * from './useOrgMemberProfilesQuery';
|
|
75
77
|
export * from './useOrgMemberProfileQuery';
|
|
76
78
|
export * from './useAppLevelsQuery';
|
|
@@ -71,6 +71,8 @@ export * from './useOrgGrantsQuery';
|
|
|
71
71
|
export * from './useOrgGrantQuery';
|
|
72
72
|
export * from './useOrgChartEdgesQuery';
|
|
73
73
|
export * from './useOrgChartEdgeQuery';
|
|
74
|
+
export * from './useUsageSnapshotsQuery';
|
|
75
|
+
export * from './useUsageSnapshotQuery';
|
|
74
76
|
export * from './useOrgMemberProfilesQuery';
|
|
75
77
|
export * from './useOrgMemberProfileQuery';
|
|
76
78
|
export * from './useAppLevelsQuery';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
|
|
7
|
+
import type { UsageSnapshotSelect, UsageSnapshotWithRelations } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { UsageSnapshotSelect, UsageSnapshotWithRelations } from '../../orm/input-types';
|
|
10
|
+
/** Query key factory - re-exported from query-keys.ts */
|
|
11
|
+
export declare const usageSnapshotQueryKey: (id: string | number) => readonly ["usagesnapshot", "detail", string | number];
|
|
12
|
+
/**
|
|
13
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const { data, isLoading } = useUsageSnapshotQuery({
|
|
18
|
+
* id: 'some-id',
|
|
19
|
+
* selection: { fields: { id: true, name: true } },
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function useUsageSnapshotQuery<S extends UsageSnapshotSelect, TData = {
|
|
24
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S> | null;
|
|
25
|
+
}>(params: {
|
|
26
|
+
id: string;
|
|
27
|
+
selection: {
|
|
28
|
+
fields: S;
|
|
29
|
+
} & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
30
|
+
} & Omit<UseQueryOptions<{
|
|
31
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S> | null;
|
|
32
|
+
}, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
|
|
33
|
+
/**
|
|
34
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const data = await fetchUsageSnapshotQuery({
|
|
39
|
+
* id: 'some-id',
|
|
40
|
+
* selection: { fields: { id: true } },
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function fetchUsageSnapshotQuery<S extends UsageSnapshotSelect>(params: {
|
|
45
|
+
id: string;
|
|
46
|
+
selection: {
|
|
47
|
+
fields: S;
|
|
48
|
+
} & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
49
|
+
}): Promise<{
|
|
50
|
+
usageSnapshot: InferSelectResult<UsageSnapshotWithRelations, S> | null;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* await prefetchUsageSnapshotQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function prefetchUsageSnapshotQuery<S extends UsageSnapshotSelect>(queryClient: QueryClient, params: {
|
|
61
|
+
id: string;
|
|
62
|
+
selection: {
|
|
63
|
+
fields: S;
|
|
64
|
+
} & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
65
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { useQuery } from '@tanstack/react-query';
|
|
7
|
+
import { getClient } from '../client';
|
|
8
|
+
import { buildSelectionArgs } from '../selection';
|
|
9
|
+
import { usageSnapshotKeys } from '../query-keys';
|
|
10
|
+
/** Query key factory - re-exported from query-keys.ts */
|
|
11
|
+
export const usageSnapshotQueryKey = usageSnapshotKeys.detail;
|
|
12
|
+
export function useUsageSnapshotQuery(params) {
|
|
13
|
+
const args = buildSelectionArgs(params.selection);
|
|
14
|
+
const { selection: _selection, ...queryOptions } = params ?? {};
|
|
15
|
+
void _selection;
|
|
16
|
+
return useQuery({
|
|
17
|
+
queryKey: usageSnapshotKeys.detail(params.id),
|
|
18
|
+
queryFn: () => getClient()
|
|
19
|
+
.usageSnapshot.findOne({
|
|
20
|
+
id: params.id,
|
|
21
|
+
select: args.select,
|
|
22
|
+
})
|
|
23
|
+
.unwrap(),
|
|
24
|
+
...queryOptions,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export async function fetchUsageSnapshotQuery(params) {
|
|
28
|
+
const args = buildSelectionArgs(params.selection);
|
|
29
|
+
return getClient()
|
|
30
|
+
.usageSnapshot.findOne({
|
|
31
|
+
id: params.id,
|
|
32
|
+
select: args.select,
|
|
33
|
+
})
|
|
34
|
+
.unwrap();
|
|
35
|
+
}
|
|
36
|
+
export async function prefetchUsageSnapshotQuery(queryClient, params) {
|
|
37
|
+
const args = buildSelectionArgs(params.selection);
|
|
38
|
+
await queryClient.prefetchQuery({
|
|
39
|
+
queryKey: usageSnapshotKeys.detail(params.id),
|
|
40
|
+
queryFn: () => getClient()
|
|
41
|
+
.usageSnapshot.findOne({
|
|
42
|
+
id: params.id,
|
|
43
|
+
select: args.select,
|
|
44
|
+
})
|
|
45
|
+
.unwrap(),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
|
|
7
|
+
import type { ListSelectionConfig } from '../selection';
|
|
8
|
+
import type { UsageSnapshotSelect, UsageSnapshotWithRelations, UsageSnapshotFilter, UsageSnapshotOrderBy } from '../../orm/input-types';
|
|
9
|
+
import type { InferSelectResult, ConnectionResult, HookStrictSelect } from '../../orm/select-types';
|
|
10
|
+
export type { UsageSnapshotSelect, UsageSnapshotWithRelations, UsageSnapshotFilter, UsageSnapshotOrderBy, } from '../../orm/input-types';
|
|
11
|
+
/** Query key factory - re-exported from query-keys.ts */
|
|
12
|
+
export declare const usageSnapshotsQueryKey: (variables?: object) => readonly ["usagesnapshot", "list", object];
|
|
13
|
+
/**
|
|
14
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const { data, isLoading } = useUsageSnapshotsQuery({
|
|
19
|
+
* selection: {
|
|
20
|
+
* fields: { id: true, name: true },
|
|
21
|
+
* where: { name: { equalTo: "example" } },
|
|
22
|
+
* orderBy: ['CREATED_AT_DESC'],
|
|
23
|
+
* first: 10,
|
|
24
|
+
* },
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function useUsageSnapshotsQuery<S extends UsageSnapshotSelect, TData = {
|
|
29
|
+
usageSnapshots: ConnectionResult<InferSelectResult<UsageSnapshotWithRelations, S>>;
|
|
30
|
+
}>(params: {
|
|
31
|
+
selection: {
|
|
32
|
+
fields: S;
|
|
33
|
+
} & Omit<ListSelectionConfig<S, UsageSnapshotFilter, UsageSnapshotOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
34
|
+
} & Omit<UseQueryOptions<{
|
|
35
|
+
usageSnapshots: ConnectionResult<InferSelectResult<UsageSnapshotWithRelations, S>>;
|
|
36
|
+
}, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
|
|
37
|
+
/**
|
|
38
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const data = await fetchUsageSnapshotsQuery({
|
|
43
|
+
* selection: {
|
|
44
|
+
* fields: { id: true },
|
|
45
|
+
* first: 10,
|
|
46
|
+
* },
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function fetchUsageSnapshotsQuery<S extends UsageSnapshotSelect>(params: {
|
|
51
|
+
selection: {
|
|
52
|
+
fields: S;
|
|
53
|
+
} & Omit<ListSelectionConfig<S, UsageSnapshotFilter, UsageSnapshotOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
usageSnapshots: ConnectionResult<InferSelectResult<UsageSnapshotWithRelations, S>>;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* await prefetchUsageSnapshotsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function prefetchUsageSnapshotsQuery<S extends UsageSnapshotSelect>(queryClient: QueryClient, params: {
|
|
66
|
+
selection: {
|
|
67
|
+
fields: S;
|
|
68
|
+
} & Omit<ListSelectionConfig<S, UsageSnapshotFilter, UsageSnapshotOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, UsageSnapshotSelect>;
|
|
69
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Periodic snapshot of a single metric for a database. Collected by the snapshot_usage() cron job in constructive-limits. Each row records one metric measurement (e.g. reads, writes, storage_bytes) at a point in time, with optional dimensions for sub-metric breakdowns.
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { useQuery } from '@tanstack/react-query';
|
|
7
|
+
import { getClient } from '../client';
|
|
8
|
+
import { buildListSelectionArgs } from '../selection';
|
|
9
|
+
import { usageSnapshotKeys } from '../query-keys';
|
|
10
|
+
/** Query key factory - re-exported from query-keys.ts */
|
|
11
|
+
export const usageSnapshotsQueryKey = usageSnapshotKeys.list;
|
|
12
|
+
export function useUsageSnapshotsQuery(params) {
|
|
13
|
+
const args = buildListSelectionArgs(params.selection);
|
|
14
|
+
const { selection: _selection, ...queryOptions } = params ?? {};
|
|
15
|
+
void _selection;
|
|
16
|
+
return useQuery({
|
|
17
|
+
queryKey: usageSnapshotKeys.list(args),
|
|
18
|
+
queryFn: () => getClient().usageSnapshot.findMany(args).unwrap(),
|
|
19
|
+
...queryOptions,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export async function fetchUsageSnapshotsQuery(params) {
|
|
23
|
+
const args = buildListSelectionArgs(params.selection);
|
|
24
|
+
return getClient().usageSnapshot.findMany(args).unwrap();
|
|
25
|
+
}
|
|
26
|
+
export async function prefetchUsageSnapshotsQuery(queryClient, params) {
|
|
27
|
+
const args = buildListSelectionArgs(params.selection);
|
|
28
|
+
await queryClient.prefetchQuery({
|
|
29
|
+
queryKey: usageSnapshotKeys.list(args),
|
|
30
|
+
queryFn: () => getClient().usageSnapshot.findMany(args).unwrap(),
|
|
31
|
+
});
|
|
32
|
+
}
|