@constructive-io/react 0.10.16 → 0.10.18

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 (161) hide show
  1. package/esm/public/hooks/index.d.ts +1 -1
  2. package/esm/public/hooks/index.js +1 -1
  3. package/esm/public/hooks/invalidation.d.ts +24 -12
  4. package/esm/public/hooks/invalidation.js +65 -33
  5. package/esm/public/hooks/mutation-keys.d.ts +64 -30
  6. package/esm/public/hooks/mutation-keys.js +55 -23
  7. package/esm/public/hooks/mutations/index.d.ts +16 -5
  8. package/esm/public/hooks/mutations/index.js +16 -5
  9. package/esm/public/hooks/mutations/useCreateBlueprintConstructionMutation.d.ts +34 -0
  10. package/esm/public/hooks/mutations/useCreateBlueprintConstructionMutation.js +31 -0
  11. package/esm/public/hooks/mutations/useCreateBlueprintMutation.d.ts +2 -2
  12. package/esm/public/hooks/mutations/useCreateBlueprintMutation.js +1 -1
  13. package/esm/public/hooks/mutations/useCreateSecureTableProvisionMutation.d.ts +2 -2
  14. package/esm/public/hooks/mutations/useCreateSecureTableProvisionMutation.js +1 -1
  15. package/esm/public/hooks/mutations/useCreateStorageModuleMutation.d.ts +34 -0
  16. package/esm/public/hooks/mutations/useCreateStorageModuleMutation.js +31 -0
  17. package/esm/public/hooks/mutations/useDeleteBlueprintConstructionMutation.d.ts +38 -0
  18. package/esm/public/hooks/mutations/useDeleteBlueprintConstructionMutation.js +36 -0
  19. package/esm/public/hooks/mutations/useDeleteBlueprintMutation.d.ts +2 -2
  20. package/esm/public/hooks/mutations/useDeleteBlueprintMutation.js +1 -1
  21. package/esm/public/hooks/mutations/useDeleteSecureTableProvisionMutation.d.ts +2 -2
  22. package/esm/public/hooks/mutations/useDeleteSecureTableProvisionMutation.js +1 -1
  23. package/esm/public/hooks/mutations/useDeleteStorageModuleMutation.d.ts +38 -0
  24. package/esm/public/hooks/mutations/useDeleteStorageModuleMutation.js +36 -0
  25. package/esm/public/hooks/mutations/useProvisionFullTextSearchMutation.d.ts +20 -0
  26. package/esm/public/hooks/mutations/useProvisionFullTextSearchMutation.js +23 -0
  27. package/esm/public/hooks/mutations/useProvisionIndexMutation.d.ts +20 -0
  28. package/esm/public/hooks/mutations/useProvisionIndexMutation.js +23 -0
  29. package/esm/public/hooks/mutations/useProvisionRelationMutation.d.ts +20 -0
  30. package/esm/public/hooks/mutations/useProvisionRelationMutation.js +23 -0
  31. package/esm/public/hooks/mutations/useProvisionTableMutation.d.ts +20 -0
  32. package/esm/public/hooks/mutations/useProvisionTableMutation.js +23 -0
  33. package/esm/public/hooks/mutations/useProvisionUniqueConstraintMutation.d.ts +20 -0
  34. package/esm/public/hooks/mutations/useProvisionUniqueConstraintMutation.js +23 -0
  35. package/esm/public/hooks/mutations/useUpdateBlueprintConstructionMutation.d.ts +40 -0
  36. package/esm/public/hooks/mutations/useUpdateBlueprintConstructionMutation.js +37 -0
  37. package/esm/public/hooks/mutations/useUpdateBlueprintMutation.d.ts +2 -2
  38. package/esm/public/hooks/mutations/useUpdateBlueprintMutation.js +1 -1
  39. package/esm/public/hooks/mutations/useUpdateSecureTableProvisionMutation.d.ts +2 -2
  40. package/esm/public/hooks/mutations/useUpdateSecureTableProvisionMutation.js +1 -1
  41. package/esm/public/hooks/mutations/useUpdateStorageModuleMutation.d.ts +40 -0
  42. package/esm/public/hooks/mutations/useUpdateStorageModuleMutation.js +37 -0
  43. package/esm/public/hooks/queries/index.d.ts +8 -3
  44. package/esm/public/hooks/queries/index.js +8 -3
  45. package/esm/public/hooks/queries/useBlueprintConstructionQuery.d.ts +65 -0
  46. package/esm/public/hooks/queries/useBlueprintConstructionQuery.js +47 -0
  47. package/esm/public/hooks/queries/useBlueprintConstructionsQuery.d.ts +69 -0
  48. package/esm/public/hooks/queries/useBlueprintConstructionsQuery.js +32 -0
  49. package/esm/public/hooks/queries/useBlueprintQuery.d.ts +4 -4
  50. package/esm/public/hooks/queries/useBlueprintQuery.js +1 -1
  51. package/esm/public/hooks/queries/useBlueprintsQuery.d.ts +4 -4
  52. package/esm/public/hooks/queries/useBlueprintsQuery.js +1 -1
  53. package/esm/public/hooks/queries/useResolveBlueprintTableQuery.d.ts +53 -0
  54. package/esm/public/hooks/queries/useResolveBlueprintTableQuery.js +47 -0
  55. package/esm/public/hooks/queries/useSecureTableProvisionQuery.d.ts +4 -4
  56. package/esm/public/hooks/queries/useSecureTableProvisionQuery.js +1 -1
  57. package/esm/public/hooks/queries/useSecureTableProvisionsQuery.d.ts +4 -4
  58. package/esm/public/hooks/queries/useSecureTableProvisionsQuery.js +1 -1
  59. package/esm/public/hooks/queries/useStorageModuleQuery.d.ts +65 -0
  60. package/esm/public/hooks/queries/useStorageModuleQuery.js +47 -0
  61. package/esm/public/hooks/queries/useStorageModulesQuery.d.ts +69 -0
  62. package/esm/public/hooks/queries/useStorageModulesQuery.js +32 -0
  63. package/esm/public/hooks/query-keys.d.ts +58 -28
  64. package/esm/public/hooks/query-keys.js +33 -16
  65. package/esm/public/orm/index.d.ts +53 -19
  66. package/esm/public/orm/index.js +8 -4
  67. package/esm/public/orm/input-types.d.ts +886 -249
  68. package/esm/public/orm/input-types.js +5 -0
  69. package/esm/public/orm/models/blueprintConstruction.d.ts +56 -0
  70. package/esm/public/orm/models/blueprintConstruction.js +96 -0
  71. package/esm/public/orm/models/index.d.ts +4 -2
  72. package/esm/public/orm/models/index.js +4 -2
  73. package/esm/public/orm/models/storageModule.d.ts +56 -0
  74. package/esm/public/orm/models/storageModule.js +96 -0
  75. package/esm/public/orm/mutation/index.d.ts +86 -26
  76. package/esm/public/orm/mutation/index.js +96 -36
  77. package/esm/public/orm/query/index.d.ts +16 -0
  78. package/esm/public/orm/query/index.js +28 -0
  79. package/esm/public/schema-types.d.ts +990 -645
  80. package/esm/public/types.d.ts +42 -18
  81. package/package.json +3 -3
  82. package/public/hooks/index.d.ts +1 -1
  83. package/public/hooks/index.js +1 -1
  84. package/public/hooks/invalidation.d.ts +24 -12
  85. package/public/hooks/invalidation.js +64 -32
  86. package/public/hooks/mutation-keys.d.ts +64 -30
  87. package/public/hooks/mutation-keys.js +58 -26
  88. package/public/hooks/mutations/index.d.ts +16 -5
  89. package/public/hooks/mutations/index.js +16 -5
  90. package/public/hooks/mutations/useCreateBlueprintConstructionMutation.d.ts +34 -0
  91. package/public/hooks/mutations/useCreateBlueprintConstructionMutation.js +34 -0
  92. package/public/hooks/mutations/useCreateBlueprintMutation.d.ts +2 -2
  93. package/public/hooks/mutations/useCreateBlueprintMutation.js +1 -1
  94. package/public/hooks/mutations/useCreateSecureTableProvisionMutation.d.ts +2 -2
  95. package/public/hooks/mutations/useCreateSecureTableProvisionMutation.js +1 -1
  96. package/public/hooks/mutations/useCreateStorageModuleMutation.d.ts +34 -0
  97. package/public/hooks/mutations/useCreateStorageModuleMutation.js +34 -0
  98. package/public/hooks/mutations/useDeleteBlueprintConstructionMutation.d.ts +38 -0
  99. package/public/hooks/mutations/useDeleteBlueprintConstructionMutation.js +39 -0
  100. package/public/hooks/mutations/useDeleteBlueprintMutation.d.ts +2 -2
  101. package/public/hooks/mutations/useDeleteBlueprintMutation.js +1 -1
  102. package/public/hooks/mutations/useDeleteSecureTableProvisionMutation.d.ts +2 -2
  103. package/public/hooks/mutations/useDeleteSecureTableProvisionMutation.js +1 -1
  104. package/public/hooks/mutations/useDeleteStorageModuleMutation.d.ts +38 -0
  105. package/public/hooks/mutations/useDeleteStorageModuleMutation.js +39 -0
  106. package/public/hooks/mutations/useProvisionFullTextSearchMutation.d.ts +20 -0
  107. package/public/hooks/mutations/useProvisionFullTextSearchMutation.js +26 -0
  108. package/public/hooks/mutations/useProvisionIndexMutation.d.ts +20 -0
  109. package/public/hooks/mutations/useProvisionIndexMutation.js +26 -0
  110. package/public/hooks/mutations/useProvisionRelationMutation.d.ts +20 -0
  111. package/public/hooks/mutations/useProvisionRelationMutation.js +26 -0
  112. package/public/hooks/mutations/useProvisionTableMutation.d.ts +20 -0
  113. package/public/hooks/mutations/useProvisionTableMutation.js +26 -0
  114. package/public/hooks/mutations/useProvisionUniqueConstraintMutation.d.ts +20 -0
  115. package/public/hooks/mutations/useProvisionUniqueConstraintMutation.js +26 -0
  116. package/public/hooks/mutations/useUpdateBlueprintConstructionMutation.d.ts +40 -0
  117. package/public/hooks/mutations/useUpdateBlueprintConstructionMutation.js +40 -0
  118. package/public/hooks/mutations/useUpdateBlueprintMutation.d.ts +2 -2
  119. package/public/hooks/mutations/useUpdateBlueprintMutation.js +1 -1
  120. package/public/hooks/mutations/useUpdateSecureTableProvisionMutation.d.ts +2 -2
  121. package/public/hooks/mutations/useUpdateSecureTableProvisionMutation.js +1 -1
  122. package/public/hooks/mutations/useUpdateStorageModuleMutation.d.ts +40 -0
  123. package/public/hooks/mutations/useUpdateStorageModuleMutation.js +40 -0
  124. package/public/hooks/queries/index.d.ts +8 -3
  125. package/public/hooks/queries/index.js +8 -3
  126. package/public/hooks/queries/useBlueprintConstructionQuery.d.ts +65 -0
  127. package/public/hooks/queries/useBlueprintConstructionQuery.js +53 -0
  128. package/public/hooks/queries/useBlueprintConstructionsQuery.d.ts +69 -0
  129. package/public/hooks/queries/useBlueprintConstructionsQuery.js +38 -0
  130. package/public/hooks/queries/useBlueprintQuery.d.ts +4 -4
  131. package/public/hooks/queries/useBlueprintQuery.js +1 -1
  132. package/public/hooks/queries/useBlueprintsQuery.d.ts +4 -4
  133. package/public/hooks/queries/useBlueprintsQuery.js +1 -1
  134. package/public/hooks/queries/useResolveBlueprintTableQuery.d.ts +53 -0
  135. package/public/hooks/queries/useResolveBlueprintTableQuery.js +53 -0
  136. package/public/hooks/queries/useSecureTableProvisionQuery.d.ts +4 -4
  137. package/public/hooks/queries/useSecureTableProvisionQuery.js +1 -1
  138. package/public/hooks/queries/useSecureTableProvisionsQuery.d.ts +4 -4
  139. package/public/hooks/queries/useSecureTableProvisionsQuery.js +1 -1
  140. package/public/hooks/queries/useStorageModuleQuery.d.ts +65 -0
  141. package/public/hooks/queries/useStorageModuleQuery.js +53 -0
  142. package/public/hooks/queries/useStorageModulesQuery.d.ts +69 -0
  143. package/public/hooks/queries/useStorageModulesQuery.js +38 -0
  144. package/public/hooks/query-keys.d.ts +58 -28
  145. package/public/hooks/query-keys.js +36 -19
  146. package/public/orm/index.d.ts +53 -19
  147. package/public/orm/index.js +8 -4
  148. package/public/orm/input-types.d.ts +886 -249
  149. package/public/orm/input-types.js +5 -0
  150. package/public/orm/models/blueprintConstruction.d.ts +56 -0
  151. package/public/orm/models/blueprintConstruction.js +100 -0
  152. package/public/orm/models/index.d.ts +4 -2
  153. package/public/orm/models/index.js +11 -7
  154. package/public/orm/models/storageModule.d.ts +56 -0
  155. package/public/orm/models/storageModule.js +100 -0
  156. package/public/orm/mutation/index.d.ts +86 -26
  157. package/public/orm/mutation/index.js +96 -36
  158. package/public/orm/query/index.d.ts +16 -0
  159. package/public/orm/query/index.js +28 -0
  160. package/public/schema-types.d.ts +990 -645
  161. package/public/types.d.ts +42 -18
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
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 { BlueprintConstructionSelect, BlueprintConstructionWithRelations } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { BlueprintConstructionSelect, BlueprintConstructionWithRelations, } from '../../orm/input-types';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export declare const blueprintConstructionQueryKey: (id: string | number) => readonly ["blueprintconstruction", "detail", string | number];
12
+ /**
13
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * const { data, isLoading } = useBlueprintConstructionQuery({
18
+ * id: 'some-id',
19
+ * selection: { fields: { id: true, name: true } },
20
+ * });
21
+ * ```
22
+ */
23
+ export declare function useBlueprintConstructionQuery<S extends BlueprintConstructionSelect, TData = {
24
+ blueprintConstruction: InferSelectResult<BlueprintConstructionWithRelations, S> | null;
25
+ }>(params: {
26
+ id: string;
27
+ selection: {
28
+ fields: S;
29
+ } & HookStrictSelect<NoInfer<S>, BlueprintConstructionSelect>;
30
+ } & Omit<UseQueryOptions<{
31
+ blueprintConstruction: InferSelectResult<BlueprintConstructionWithRelations, S> | null;
32
+ }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
33
+ /**
34
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const data = await fetchBlueprintConstructionQuery({
39
+ * id: 'some-id',
40
+ * selection: { fields: { id: true } },
41
+ * });
42
+ * ```
43
+ */
44
+ export declare function fetchBlueprintConstructionQuery<S extends BlueprintConstructionSelect>(params: {
45
+ id: string;
46
+ selection: {
47
+ fields: S;
48
+ } & HookStrictSelect<NoInfer<S>, BlueprintConstructionSelect>;
49
+ }): Promise<{
50
+ blueprintConstruction: InferSelectResult<BlueprintConstructionWithRelations, S> | null;
51
+ }>;
52
+ /**
53
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * await prefetchBlueprintConstructionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } });
58
+ * ```
59
+ */
60
+ export declare function prefetchBlueprintConstructionQuery<S extends BlueprintConstructionSelect>(queryClient: QueryClient, params: {
61
+ id: string;
62
+ selection: {
63
+ fields: S;
64
+ } & HookStrictSelect<NoInfer<S>, BlueprintConstructionSelect>;
65
+ }): Promise<void>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
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 { blueprintConstructionKeys } from '../query-keys';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export const blueprintConstructionQueryKey = blueprintConstructionKeys.detail;
12
+ export function useBlueprintConstructionQuery(params) {
13
+ const args = buildSelectionArgs(params.selection);
14
+ const { selection: _selection, ...queryOptions } = params ?? {};
15
+ void _selection;
16
+ return useQuery({
17
+ queryKey: blueprintConstructionKeys.detail(params.id),
18
+ queryFn: () => getClient()
19
+ .blueprintConstruction.findOne({
20
+ id: params.id,
21
+ select: args.select,
22
+ })
23
+ .unwrap(),
24
+ ...queryOptions,
25
+ });
26
+ }
27
+ export async function fetchBlueprintConstructionQuery(params) {
28
+ const args = buildSelectionArgs(params.selection);
29
+ return getClient()
30
+ .blueprintConstruction.findOne({
31
+ id: params.id,
32
+ select: args.select,
33
+ })
34
+ .unwrap();
35
+ }
36
+ export async function prefetchBlueprintConstructionQuery(queryClient, params) {
37
+ const args = buildSelectionArgs(params.selection);
38
+ await queryClient.prefetchQuery({
39
+ queryKey: blueprintConstructionKeys.detail(params.id),
40
+ queryFn: () => getClient()
41
+ .blueprintConstruction.findOne({
42
+ id: params.id,
43
+ select: args.select,
44
+ })
45
+ .unwrap(),
46
+ });
47
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
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 { BlueprintConstructionSelect, BlueprintConstructionWithRelations, BlueprintConstructionFilter, BlueprintConstructionOrderBy } from '../../orm/input-types';
9
+ import type { InferSelectResult, ConnectionResult, HookStrictSelect } from '../../orm/select-types';
10
+ export type { BlueprintConstructionSelect, BlueprintConstructionWithRelations, BlueprintConstructionFilter, BlueprintConstructionOrderBy, } from '../../orm/input-types';
11
+ /** Query key factory - re-exported from query-keys.ts */
12
+ export declare const blueprintConstructionsQueryKey: (variables?: object) => readonly ["blueprintconstruction", "list", object];
13
+ /**
14
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const { data, isLoading } = useBlueprintConstructionsQuery({
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 useBlueprintConstructionsQuery<S extends BlueprintConstructionSelect, TData = {
29
+ blueprintConstructions: ConnectionResult<InferSelectResult<BlueprintConstructionWithRelations, S>>;
30
+ }>(params: {
31
+ selection: {
32
+ fields: S;
33
+ } & Omit<ListSelectionConfig<S, BlueprintConstructionFilter, BlueprintConstructionOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, BlueprintConstructionSelect>;
34
+ } & Omit<UseQueryOptions<{
35
+ blueprintConstructions: ConnectionResult<InferSelectResult<BlueprintConstructionWithRelations, S>>;
36
+ }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
37
+ /**
38
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const data = await fetchBlueprintConstructionsQuery({
43
+ * selection: {
44
+ * fields: { id: true },
45
+ * first: 10,
46
+ * },
47
+ * });
48
+ * ```
49
+ */
50
+ export declare function fetchBlueprintConstructionsQuery<S extends BlueprintConstructionSelect>(params: {
51
+ selection: {
52
+ fields: S;
53
+ } & Omit<ListSelectionConfig<S, BlueprintConstructionFilter, BlueprintConstructionOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, BlueprintConstructionSelect>;
54
+ }): Promise<{
55
+ blueprintConstructions: ConnectionResult<InferSelectResult<BlueprintConstructionWithRelations, S>>;
56
+ }>;
57
+ /**
58
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * await prefetchBlueprintConstructionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } });
63
+ * ```
64
+ */
65
+ export declare function prefetchBlueprintConstructionsQuery<S extends BlueprintConstructionSelect>(queryClient: QueryClient, params: {
66
+ selection: {
67
+ fields: S;
68
+ } & Omit<ListSelectionConfig<S, BlueprintConstructionFilter, BlueprintConstructionOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, BlueprintConstructionSelect>;
69
+ }): Promise<void>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
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 { blueprintConstructionKeys } from '../query-keys';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export const blueprintConstructionsQueryKey = blueprintConstructionKeys.list;
12
+ export function useBlueprintConstructionsQuery(params) {
13
+ const args = buildListSelectionArgs(params.selection);
14
+ const { selection: _selection, ...queryOptions } = params ?? {};
15
+ void _selection;
16
+ return useQuery({
17
+ queryKey: blueprintConstructionKeys.list(args),
18
+ queryFn: () => getClient().blueprintConstruction.findMany(args).unwrap(),
19
+ ...queryOptions,
20
+ });
21
+ }
22
+ export async function fetchBlueprintConstructionsQuery(params) {
23
+ const args = buildListSelectionArgs(params.selection);
24
+ return getClient().blueprintConstruction.findMany(args).unwrap();
25
+ }
26
+ export async function prefetchBlueprintConstructionsQuery(queryClient, params) {
27
+ const args = buildListSelectionArgs(params.selection);
28
+ await queryClient.prefetchQuery({
29
+ queryKey: blueprintConstructionKeys.list(args),
30
+ queryFn: () => getClient().blueprintConstruction.findMany(args).unwrap(),
31
+ });
32
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
2
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -10,7 +10,7 @@ export type { BlueprintSelect, BlueprintWithRelations } from '../../orm/input-ty
10
10
  /** Query key factory - re-exported from query-keys.ts */
11
11
  export declare const blueprintQueryKey: (id: string | number) => readonly ["blueprint", "detail", string | number];
12
12
  /**
13
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
13
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
14
14
  *
15
15
  * @example
16
16
  * ```tsx
@@ -31,7 +31,7 @@ export declare function useBlueprintQuery<S extends BlueprintSelect, TData = {
31
31
  blueprint: InferSelectResult<BlueprintWithRelations, S> | null;
32
32
  }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
33
33
  /**
34
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
34
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
35
35
  *
36
36
  * @example
37
37
  * ```ts
@@ -50,7 +50,7 @@ export declare function fetchBlueprintQuery<S extends BlueprintSelect>(params: {
50
50
  blueprint: InferSelectResult<BlueprintWithRelations, S> | null;
51
51
  }>;
52
52
  /**
53
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
53
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
54
54
  *
55
55
  * @example
56
56
  * ```ts
@@ -1,5 +1,5 @@
1
1
  /**
2
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
2
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
2
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -11,7 +11,7 @@ export type { BlueprintSelect, BlueprintWithRelations, BlueprintFilter, Blueprin
11
11
  /** Query key factory - re-exported from query-keys.ts */
12
12
  export declare const blueprintsQueryKey: (variables?: object) => readonly ["blueprint", "list", object];
13
13
  /**
14
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
14
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
15
15
  *
16
16
  * @example
17
17
  * ```tsx
@@ -35,7 +35,7 @@ export declare function useBlueprintsQuery<S extends BlueprintSelect, TData = {
35
35
  blueprints: ConnectionResult<InferSelectResult<BlueprintWithRelations, S>>;
36
36
  }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
37
37
  /**
38
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
38
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
39
39
  *
40
40
  * @example
41
41
  * ```ts
@@ -55,7 +55,7 @@ export declare function fetchBlueprintsQuery<S extends BlueprintSelect>(params:
55
55
  blueprints: ConnectionResult<InferSelectResult<BlueprintWithRelations, S>>;
56
56
  }>;
57
57
  /**
58
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
58
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
59
59
  *
60
60
  * @example
61
61
  * ```ts
@@ -1,5 +1,5 @@
1
1
  /**
2
- * An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.
2
+ * An owned, editable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition at any time. Execute it with construct_blueprint() which creates a separate blueprint_construction record to track the build.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Custom query hook for resolveBlueprintTable
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 { ResolveBlueprintTableVariables } from '../../orm/query';
8
+ export type { ResolveBlueprintTableVariables } from '../../orm/query';
9
+ /** Query key factory - re-exported from query-keys.ts */
10
+ export declare const resolveBlueprintTableQueryKey: (variables?: object) => readonly ["resolveBlueprintTable", object];
11
+ /**
12
+ * Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * const { data, isLoading } = useResolveBlueprintTableQuery({ variables: { databaseId, tableName, schemaName, tableMap, defaultSchemaId } });
17
+ *
18
+ * if (data?.resolveBlueprintTable) {
19
+ * console.log(data.resolveBlueprintTable);
20
+ * }
21
+ * ```
22
+ */
23
+ export declare function useResolveBlueprintTableQuery<TData = {
24
+ resolveBlueprintTable: string | null;
25
+ }>(params?: {
26
+ variables?: ResolveBlueprintTableVariables;
27
+ } & Omit<UseQueryOptions<{
28
+ resolveBlueprintTable: string | null;
29
+ }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
30
+ /**
31
+ * Fetch resolveBlueprintTable without React hooks
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const data = await fetchResolveBlueprintTableQuery({ variables: { databaseId, tableName, schemaName, tableMap, defaultSchemaId } });
36
+ * ```
37
+ */
38
+ export declare function fetchResolveBlueprintTableQuery(params?: {
39
+ variables?: ResolveBlueprintTableVariables;
40
+ }): Promise<{
41
+ resolveBlueprintTable: string | null;
42
+ }>;
43
+ /**
44
+ * Prefetch resolveBlueprintTable for SSR or cache warming
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * await prefetchResolveBlueprintTableQuery(queryClient, { variables: { databaseId, tableName, schemaName, tableMap, defaultSchemaId } });
49
+ * ```
50
+ */
51
+ export declare function prefetchResolveBlueprintTableQuery(queryClient: QueryClient, params?: {
52
+ variables?: ResolveBlueprintTableVariables;
53
+ }): Promise<void>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Custom query hook for resolveBlueprintTable
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 { customQueryKeys } from '../query-keys';
9
+ /** Query key factory - re-exported from query-keys.ts */
10
+ export const resolveBlueprintTableQueryKey = customQueryKeys.resolveBlueprintTable;
11
+ export function useResolveBlueprintTableQuery(params) {
12
+ const variables = params?.variables ?? {};
13
+ const { variables: _variables, ...queryOptions } = params ?? {};
14
+ void _variables;
15
+ return useQuery({
16
+ queryKey: resolveBlueprintTableQueryKey(variables),
17
+ queryFn: () => getClient().query.resolveBlueprintTable(variables).unwrap(),
18
+ ...queryOptions,
19
+ });
20
+ }
21
+ /**
22
+ * Fetch resolveBlueprintTable without React hooks
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const data = await fetchResolveBlueprintTableQuery({ variables: { databaseId, tableName, schemaName, tableMap, defaultSchemaId } });
27
+ * ```
28
+ */
29
+ export async function fetchResolveBlueprintTableQuery(params) {
30
+ const variables = params?.variables ?? {};
31
+ return getClient().query.resolveBlueprintTable(variables).unwrap();
32
+ }
33
+ /**
34
+ * Prefetch resolveBlueprintTable for SSR or cache warming
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * await prefetchResolveBlueprintTableQuery(queryClient, { variables: { databaseId, tableName, schemaName, tableMap, defaultSchemaId } });
39
+ * ```
40
+ */
41
+ export async function prefetchResolveBlueprintTableQuery(queryClient, params) {
42
+ const variables = params?.variables ?? {};
43
+ await queryClient.prefetchQuery({
44
+ queryKey: resolveBlueprintTableQueryKey(variables),
45
+ queryFn: () => getClient().query.resolveBlueprintTable(variables).unwrap(),
46
+ });
47
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
2
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -10,7 +10,7 @@ export type { SecureTableProvisionSelect, SecureTableProvisionWithRelations, } f
10
10
  /** Query key factory - re-exported from query-keys.ts */
11
11
  export declare const secureTableProvisionQueryKey: (id: string | number) => readonly ["securetableprovision", "detail", string | number];
12
12
  /**
13
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
13
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
14
14
  *
15
15
  * @example
16
16
  * ```tsx
@@ -31,7 +31,7 @@ export declare function useSecureTableProvisionQuery<S extends SecureTableProvis
31
31
  secureTableProvision: InferSelectResult<SecureTableProvisionWithRelations, S> | null;
32
32
  }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
33
33
  /**
34
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
34
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
35
35
  *
36
36
  * @example
37
37
  * ```ts
@@ -50,7 +50,7 @@ export declare function fetchSecureTableProvisionQuery<S extends SecureTableProv
50
50
  secureTableProvision: InferSelectResult<SecureTableProvisionWithRelations, S> | null;
51
51
  }>;
52
52
  /**
53
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
53
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
54
54
  *
55
55
  * @example
56
56
  * ```ts
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
2
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
2
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -11,7 +11,7 @@ export type { SecureTableProvisionSelect, SecureTableProvisionWithRelations, Sec
11
11
  /** Query key factory - re-exported from query-keys.ts */
12
12
  export declare const secureTableProvisionsQueryKey: (variables?: object) => readonly ["securetableprovision", "list", object];
13
13
  /**
14
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
14
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
15
15
  *
16
16
  * @example
17
17
  * ```tsx
@@ -35,7 +35,7 @@ export declare function useSecureTableProvisionsQuery<S extends SecureTableProvi
35
35
  secureTableProvisions: ConnectionResult<InferSelectResult<SecureTableProvisionWithRelations, S>>;
36
36
  }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
37
37
  /**
38
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
38
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
39
39
  *
40
40
  * @example
41
41
  * ```ts
@@ -55,7 +55,7 @@ export declare function fetchSecureTableProvisionsQuery<S extends SecureTablePro
55
55
  secureTableProvisions: ConnectionResult<InferSelectResult<SecureTableProvisionWithRelations, S>>;
56
56
  }>;
57
57
  /**
58
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
58
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
59
59
  *
60
60
  * @example
61
61
  * ```ts
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via node_type, (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
2
+ * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grant_privileges, (3) create RLS policies via policy_type. Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Single item query hook for StorageModule
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 { StorageModuleSelect, StorageModuleWithRelations } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { StorageModuleSelect, StorageModuleWithRelations } from '../../orm/input-types';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export declare const storageModuleQueryKey: (id: string | number) => readonly ["storagemodule", "detail", string | number];
12
+ /**
13
+ * Query hook for fetching a single StorageModule
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * const { data, isLoading } = useStorageModuleQuery({
18
+ * id: 'some-id',
19
+ * selection: { fields: { id: true, name: true } },
20
+ * });
21
+ * ```
22
+ */
23
+ export declare function useStorageModuleQuery<S extends StorageModuleSelect, TData = {
24
+ storageModule: InferSelectResult<StorageModuleWithRelations, S> | null;
25
+ }>(params: {
26
+ id: string;
27
+ selection: {
28
+ fields: S;
29
+ } & HookStrictSelect<NoInfer<S>, StorageModuleSelect>;
30
+ } & Omit<UseQueryOptions<{
31
+ storageModule: InferSelectResult<StorageModuleWithRelations, S> | null;
32
+ }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
33
+ /**
34
+ * Fetch a single StorageModule without React hooks
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const data = await fetchStorageModuleQuery({
39
+ * id: 'some-id',
40
+ * selection: { fields: { id: true } },
41
+ * });
42
+ * ```
43
+ */
44
+ export declare function fetchStorageModuleQuery<S extends StorageModuleSelect>(params: {
45
+ id: string;
46
+ selection: {
47
+ fields: S;
48
+ } & HookStrictSelect<NoInfer<S>, StorageModuleSelect>;
49
+ }): Promise<{
50
+ storageModule: InferSelectResult<StorageModuleWithRelations, S> | null;
51
+ }>;
52
+ /**
53
+ * Prefetch a single StorageModule for SSR or cache warming
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * await prefetchStorageModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } });
58
+ * ```
59
+ */
60
+ export declare function prefetchStorageModuleQuery<S extends StorageModuleSelect>(queryClient: QueryClient, params: {
61
+ id: string;
62
+ selection: {
63
+ fields: S;
64
+ } & HookStrictSelect<NoInfer<S>, StorageModuleSelect>;
65
+ }): Promise<void>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Single item query hook for StorageModule
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 { storageModuleKeys } from '../query-keys';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export const storageModuleQueryKey = storageModuleKeys.detail;
12
+ export function useStorageModuleQuery(params) {
13
+ const args = buildSelectionArgs(params.selection);
14
+ const { selection: _selection, ...queryOptions } = params ?? {};
15
+ void _selection;
16
+ return useQuery({
17
+ queryKey: storageModuleKeys.detail(params.id),
18
+ queryFn: () => getClient()
19
+ .storageModule.findOne({
20
+ id: params.id,
21
+ select: args.select,
22
+ })
23
+ .unwrap(),
24
+ ...queryOptions,
25
+ });
26
+ }
27
+ export async function fetchStorageModuleQuery(params) {
28
+ const args = buildSelectionArgs(params.selection);
29
+ return getClient()
30
+ .storageModule.findOne({
31
+ id: params.id,
32
+ select: args.select,
33
+ })
34
+ .unwrap();
35
+ }
36
+ export async function prefetchStorageModuleQuery(queryClient, params) {
37
+ const args = buildSelectionArgs(params.selection);
38
+ await queryClient.prefetchQuery({
39
+ queryKey: storageModuleKeys.detail(params.id),
40
+ queryFn: () => getClient()
41
+ .storageModule.findOne({
42
+ id: params.id,
43
+ select: args.select,
44
+ })
45
+ .unwrap(),
46
+ });
47
+ }