@constructive-io/react 0.7.2 → 0.8.1
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/README.md +0 -8
- package/admin/orm/input-types.d.ts +33 -127
- package/admin/schema-types.d.ts +20 -110
- package/admin/types.d.ts +0 -19
- package/auth/hooks/index.d.ts +1 -1
- package/auth/hooks/index.js +1 -1
- package/auth/hooks/invalidation.d.ts +16 -16
- package/auth/hooks/invalidation.js +33 -33
- package/auth/hooks/mutation-keys.d.ts +32 -32
- package/auth/hooks/mutation-keys.js +20 -20
- package/auth/hooks/mutations/index.d.ts +9 -9
- package/auth/hooks/mutations/index.js +9 -9
- package/auth/hooks/queries/index.d.ts +6 -6
- package/auth/hooks/queries/index.js +6 -6
- package/auth/hooks/query-keys.d.ts +38 -38
- package/auth/hooks/query-keys.js +23 -23
- package/auth/orm/index.d.ts +6 -6
- package/auth/orm/index.js +6 -6
- package/auth/orm/input-types.d.ts +279 -327
- package/auth/orm/input-types.js +9 -1
- package/auth/orm/models/index.d.ts +3 -3
- package/auth/orm/models/index.js +7 -7
- package/auth/schema-types.d.ts +276 -188
- package/auth/types.d.ts +14 -24
- package/esm/admin/orm/input-types.d.ts +33 -127
- package/esm/admin/schema-types.d.ts +20 -110
- package/esm/admin/types.d.ts +0 -19
- package/esm/auth/hooks/index.d.ts +1 -1
- package/esm/auth/hooks/index.js +1 -1
- package/esm/auth/hooks/invalidation.d.ts +16 -16
- package/esm/auth/hooks/invalidation.js +34 -34
- package/esm/auth/hooks/mutation-keys.d.ts +32 -32
- package/esm/auth/hooks/mutation-keys.js +19 -19
- package/esm/auth/hooks/mutations/index.d.ts +9 -9
- package/esm/auth/hooks/mutations/index.js +9 -9
- package/esm/auth/hooks/queries/index.d.ts +6 -6
- package/esm/auth/hooks/queries/index.js +6 -6
- package/esm/auth/hooks/query-keys.d.ts +38 -38
- package/esm/auth/hooks/query-keys.js +22 -22
- package/esm/auth/orm/index.d.ts +6 -6
- package/esm/auth/orm/index.js +6 -6
- package/esm/auth/orm/input-types.d.ts +279 -327
- package/esm/auth/orm/input-types.js +9 -1
- package/esm/auth/orm/models/index.d.ts +3 -3
- package/esm/auth/orm/models/index.js +3 -3
- package/esm/auth/schema-types.d.ts +276 -188
- package/esm/auth/types.d.ts +14 -24
- package/esm/index.d.ts +5 -1
- package/esm/index.js +5 -1
- package/esm/objects/orm/input-types.d.ts +17 -48
- package/esm/objects/schema-types.d.ts +3 -37
- package/esm/objects/types.d.ts +0 -6
- package/esm/public/hooks/index.d.ts +1 -1
- package/esm/public/hooks/index.js +1 -1
- package/esm/public/hooks/invalidation.d.ts +77 -53
- package/esm/public/hooks/invalidation.js +202 -138
- package/esm/public/hooks/mutation-keys.d.ts +180 -122
- package/esm/public/hooks/mutation-keys.js +129 -86
- package/esm/public/hooks/mutations/index.d.ts +50 -33
- package/esm/public/hooks/mutations/index.js +50 -33
- package/esm/public/hooks/mutations/useAcceptDatabaseTransferMutation.d.ts +20 -0
- package/esm/public/hooks/mutations/useAcceptDatabaseTransferMutation.js +23 -0
- package/esm/public/hooks/mutations/useCancelDatabaseTransferMutation.d.ts +20 -0
- package/esm/public/hooks/mutations/useCancelDatabaseTransferMutation.js +23 -0
- package/esm/public/hooks/mutations/useConstructBlueprintMutation.d.ts +20 -0
- package/esm/public/hooks/mutations/useConstructBlueprintMutation.js +23 -0
- package/esm/public/hooks/mutations/useCopyTemplateToBlueprintMutation.d.ts +20 -0
- package/esm/public/hooks/mutations/useCopyTemplateToBlueprintMutation.js +23 -0
- package/esm/public/hooks/mutations/useCreateBlueprintMutation.d.ts +34 -0
- package/esm/public/hooks/mutations/useCreateBlueprintMutation.js +31 -0
- package/esm/public/hooks/mutations/useCreateBlueprintTemplateMutation.d.ts +34 -0
- package/esm/public/hooks/mutations/useCreateBlueprintTemplateMutation.js +31 -0
- package/esm/public/hooks/mutations/useCreateDatabaseTransferMutation.d.ts +34 -0
- package/esm/public/hooks/mutations/useCreateDatabaseTransferMutation.js +31 -0
- package/esm/public/hooks/mutations/useCreateEmbeddingChunkMutation.d.ts +34 -0
- package/esm/public/hooks/mutations/useCreateEmbeddingChunkMutation.js +31 -0
- package/esm/public/hooks/mutations/useCreateEnumMutation.d.ts +34 -0
- package/esm/public/hooks/mutations/{useCreateUuidModuleMutation.js → useCreateEnumMutation.js} +7 -7
- package/esm/public/hooks/mutations/useDeleteBlueprintMutation.d.ts +38 -0
- package/esm/public/hooks/mutations/useDeleteBlueprintMutation.js +36 -0
- package/esm/public/hooks/mutations/useDeleteBlueprintTemplateMutation.d.ts +38 -0
- package/esm/public/hooks/mutations/useDeleteBlueprintTemplateMutation.js +36 -0
- package/esm/public/hooks/mutations/useDeleteDatabaseTransferMutation.d.ts +38 -0
- package/esm/public/hooks/mutations/useDeleteDatabaseTransferMutation.js +36 -0
- package/esm/public/hooks/mutations/useDeleteEmbeddingChunkMutation.d.ts +38 -0
- package/esm/public/hooks/mutations/useDeleteEmbeddingChunkMutation.js +36 -0
- package/esm/public/hooks/mutations/useDeleteEnumMutation.d.ts +38 -0
- package/esm/public/hooks/mutations/{useDeleteUuidModuleMutation.js → useDeleteEnumMutation.js} +8 -8
- package/esm/public/hooks/mutations/useRejectDatabaseTransferMutation.d.ts +20 -0
- package/esm/public/hooks/mutations/useRejectDatabaseTransferMutation.js +23 -0
- package/esm/public/hooks/mutations/useUpdateBlueprintMutation.d.ts +40 -0
- package/esm/public/hooks/mutations/useUpdateBlueprintMutation.js +37 -0
- package/esm/public/hooks/mutations/useUpdateBlueprintTemplateMutation.d.ts +40 -0
- package/esm/public/hooks/mutations/useUpdateBlueprintTemplateMutation.js +37 -0
- package/esm/public/hooks/mutations/useUpdateDatabaseTransferMutation.d.ts +40 -0
- package/esm/public/hooks/mutations/useUpdateDatabaseTransferMutation.js +37 -0
- package/esm/public/hooks/mutations/useUpdateEmbeddingChunkMutation.d.ts +40 -0
- package/esm/public/hooks/mutations/useUpdateEmbeddingChunkMutation.js +37 -0
- package/esm/public/hooks/mutations/useUpdateEnumMutation.d.ts +40 -0
- package/esm/public/hooks/mutations/{useUpdateUuidModuleMutation.js → useUpdateEnumMutation.js} +10 -10
- package/esm/public/hooks/queries/index.d.ts +25 -17
- package/esm/public/hooks/queries/index.js +25 -17
- package/esm/public/hooks/queries/useBlueprintQuery.d.ts +65 -0
- package/esm/public/hooks/queries/useBlueprintQuery.js +47 -0
- package/esm/public/hooks/queries/useBlueprintTemplateQuery.d.ts +65 -0
- package/esm/public/hooks/queries/useBlueprintTemplateQuery.js +47 -0
- package/esm/public/hooks/queries/useBlueprintTemplatesQuery.d.ts +69 -0
- package/esm/public/hooks/queries/useBlueprintTemplatesQuery.js +32 -0
- package/esm/public/hooks/queries/useBlueprintsQuery.d.ts +69 -0
- package/esm/public/hooks/queries/useBlueprintsQuery.js +32 -0
- package/esm/public/hooks/queries/useDatabaseTransferQuery.d.ts +65 -0
- package/esm/public/hooks/queries/useDatabaseTransferQuery.js +47 -0
- package/esm/public/hooks/queries/useDatabaseTransfersQuery.d.ts +69 -0
- package/esm/public/hooks/queries/useDatabaseTransfersQuery.js +32 -0
- package/esm/public/hooks/queries/useEmbeddingChunkQuery.d.ts +65 -0
- package/esm/public/hooks/queries/useEmbeddingChunkQuery.js +47 -0
- package/esm/public/hooks/queries/useEmbeddingChunksQuery.d.ts +69 -0
- package/esm/public/hooks/queries/useEmbeddingChunksQuery.js +32 -0
- package/esm/public/hooks/queries/useEnumQuery.d.ts +65 -0
- package/esm/public/hooks/queries/{useUuidModuleQuery.js → useEnumQuery.js} +11 -11
- package/esm/public/hooks/queries/useEnumsQuery.d.ts +69 -0
- package/esm/public/hooks/queries/{useUuidModulesQuery.js → useEnumsQuery.js} +11 -11
- package/esm/public/hooks/query-keys.d.ts +180 -124
- package/esm/public/hooks/query-keys.js +103 -71
- package/esm/public/orm/index.d.ts +81 -48
- package/esm/public/orm/index.js +26 -18
- package/esm/public/orm/input-types.d.ts +2447 -2980
- package/esm/public/orm/input-types.js +26 -1
- package/esm/public/orm/models/blueprint.d.ts +56 -0
- package/esm/public/orm/models/blueprint.js +94 -0
- package/esm/public/orm/models/blueprintTemplate.d.ts +56 -0
- package/esm/public/orm/models/blueprintTemplate.js +94 -0
- package/esm/public/orm/models/databaseTransfer.d.ts +56 -0
- package/esm/public/orm/models/databaseTransfer.js +94 -0
- package/esm/public/orm/models/embeddingChunk.d.ts +56 -0
- package/esm/public/orm/models/embeddingChunk.js +94 -0
- package/esm/public/orm/models/enum.d.ts +56 -0
- package/esm/public/orm/models/{uuidModule.js → enum.js} +23 -23
- package/esm/public/orm/models/index.d.ts +13 -9
- package/esm/public/orm/models/index.js +13 -9
- package/esm/public/orm/mutation/index.d.ts +98 -50
- package/esm/public/orm/mutation/index.js +126 -66
- package/esm/public/schema-types.d.ts +2328 -2206
- package/esm/public/types.d.ts +161 -379
- package/index.d.ts +5 -1
- package/index.js +5 -1
- package/objects/orm/input-types.d.ts +17 -48
- package/objects/schema-types.d.ts +3 -37
- package/objects/types.d.ts +0 -6
- package/package.json +3 -3
- package/public/hooks/index.d.ts +1 -1
- package/public/hooks/index.js +1 -1
- package/public/hooks/invalidation.d.ts +77 -53
- package/public/hooks/invalidation.js +201 -137
- package/public/hooks/mutation-keys.d.ts +180 -122
- package/public/hooks/mutation-keys.js +132 -89
- package/public/hooks/mutations/index.d.ts +50 -33
- package/public/hooks/mutations/index.js +50 -33
- package/public/hooks/mutations/useAcceptDatabaseTransferMutation.d.ts +20 -0
- package/public/hooks/mutations/useAcceptDatabaseTransferMutation.js +26 -0
- package/public/hooks/mutations/useCancelDatabaseTransferMutation.d.ts +20 -0
- package/public/hooks/mutations/useCancelDatabaseTransferMutation.js +26 -0
- package/public/hooks/mutations/useConstructBlueprintMutation.d.ts +20 -0
- package/public/hooks/mutations/useConstructBlueprintMutation.js +26 -0
- package/public/hooks/mutations/useCopyTemplateToBlueprintMutation.d.ts +20 -0
- package/public/hooks/mutations/useCopyTemplateToBlueprintMutation.js +26 -0
- package/public/hooks/mutations/useCreateBlueprintMutation.d.ts +34 -0
- package/public/hooks/mutations/useCreateBlueprintMutation.js +34 -0
- package/public/hooks/mutations/useCreateBlueprintTemplateMutation.d.ts +34 -0
- package/public/hooks/mutations/useCreateBlueprintTemplateMutation.js +34 -0
- package/public/hooks/mutations/useCreateDatabaseTransferMutation.d.ts +34 -0
- package/public/hooks/mutations/useCreateDatabaseTransferMutation.js +34 -0
- package/public/hooks/mutations/useCreateEmbeddingChunkMutation.d.ts +34 -0
- package/public/hooks/mutations/useCreateEmbeddingChunkMutation.js +34 -0
- package/public/hooks/mutations/useCreateEnumMutation.d.ts +34 -0
- package/public/hooks/mutations/{useCreateUuidModuleMutation.js → useCreateEnumMutation.js} +6 -6
- package/public/hooks/mutations/useDeleteBlueprintMutation.d.ts +38 -0
- package/public/hooks/mutations/useDeleteBlueprintMutation.js +39 -0
- package/public/hooks/mutations/useDeleteBlueprintTemplateMutation.d.ts +38 -0
- package/public/hooks/mutations/useDeleteBlueprintTemplateMutation.js +39 -0
- package/public/hooks/mutations/useDeleteDatabaseTransferMutation.d.ts +38 -0
- package/public/hooks/mutations/useDeleteDatabaseTransferMutation.js +39 -0
- package/public/hooks/mutations/useDeleteEmbeddingChunkMutation.d.ts +38 -0
- package/public/hooks/mutations/useDeleteEmbeddingChunkMutation.js +39 -0
- package/public/hooks/mutations/useDeleteEnumMutation.d.ts +38 -0
- package/public/hooks/mutations/{useDeleteUuidModuleMutation.js → useDeleteEnumMutation.js} +7 -7
- package/public/hooks/mutations/useRejectDatabaseTransferMutation.d.ts +20 -0
- package/public/hooks/mutations/useRejectDatabaseTransferMutation.js +26 -0
- package/public/hooks/mutations/useUpdateBlueprintMutation.d.ts +40 -0
- package/public/hooks/mutations/useUpdateBlueprintMutation.js +40 -0
- package/public/hooks/mutations/useUpdateBlueprintTemplateMutation.d.ts +40 -0
- package/public/hooks/mutations/useUpdateBlueprintTemplateMutation.js +40 -0
- package/public/hooks/mutations/useUpdateDatabaseTransferMutation.d.ts +40 -0
- package/public/hooks/mutations/useUpdateDatabaseTransferMutation.js +40 -0
- package/public/hooks/mutations/useUpdateEmbeddingChunkMutation.d.ts +40 -0
- package/public/hooks/mutations/useUpdateEmbeddingChunkMutation.js +40 -0
- package/public/hooks/mutations/useUpdateEnumMutation.d.ts +40 -0
- package/public/hooks/mutations/{useUpdateUuidModuleMutation.js → useUpdateEnumMutation.js} +9 -9
- package/public/hooks/queries/index.d.ts +25 -17
- package/public/hooks/queries/index.js +25 -17
- package/public/hooks/queries/useBlueprintQuery.d.ts +65 -0
- package/public/hooks/queries/useBlueprintQuery.js +53 -0
- package/public/hooks/queries/useBlueprintTemplateQuery.d.ts +65 -0
- package/public/hooks/queries/useBlueprintTemplateQuery.js +53 -0
- package/public/hooks/queries/useBlueprintTemplatesQuery.d.ts +69 -0
- package/public/hooks/queries/useBlueprintTemplatesQuery.js +38 -0
- package/public/hooks/queries/useBlueprintsQuery.d.ts +69 -0
- package/public/hooks/queries/useBlueprintsQuery.js +38 -0
- package/public/hooks/queries/useDatabaseTransferQuery.d.ts +65 -0
- package/public/hooks/queries/useDatabaseTransferQuery.js +53 -0
- package/public/hooks/queries/useDatabaseTransfersQuery.d.ts +69 -0
- package/public/hooks/queries/useDatabaseTransfersQuery.js +38 -0
- package/public/hooks/queries/useEmbeddingChunkQuery.d.ts +65 -0
- package/public/hooks/queries/useEmbeddingChunkQuery.js +53 -0
- package/public/hooks/queries/useEmbeddingChunksQuery.d.ts +69 -0
- package/public/hooks/queries/useEmbeddingChunksQuery.js +38 -0
- package/public/hooks/queries/useEnumQuery.d.ts +65 -0
- package/public/hooks/queries/{useUuidModuleQuery.js → useEnumQuery.js} +14 -14
- package/public/hooks/queries/useEnumsQuery.d.ts +69 -0
- package/public/hooks/queries/{useUuidModulesQuery.js → useEnumsQuery.js} +14 -14
- package/public/hooks/query-keys.d.ts +180 -124
- package/public/hooks/query-keys.js +106 -74
- package/public/orm/index.d.ts +81 -48
- package/public/orm/index.js +26 -18
- package/public/orm/input-types.d.ts +2447 -2980
- package/public/orm/input-types.js +26 -1
- package/public/orm/models/blueprint.d.ts +56 -0
- package/public/orm/models/blueprint.js +98 -0
- package/public/orm/models/blueprintTemplate.d.ts +56 -0
- package/public/orm/models/blueprintTemplate.js +98 -0
- package/public/orm/models/databaseTransfer.d.ts +56 -0
- package/public/orm/models/databaseTransfer.js +98 -0
- package/public/orm/models/embeddingChunk.d.ts +56 -0
- package/public/orm/models/embeddingChunk.js +98 -0
- package/public/orm/models/enum.d.ts +56 -0
- package/public/orm/models/{uuidModule.js → enum.js} +25 -25
- package/public/orm/models/index.d.ts +13 -9
- package/public/orm/models/index.js +29 -21
- package/public/orm/mutation/index.d.ts +98 -50
- package/public/orm/mutation/index.js +126 -66
- package/public/schema-types.d.ts +2328 -2206
- package/public/types.d.ts +161 -379
- package/esm/public/hooks/mutations/useCreateUuidModuleMutation.d.ts +0 -34
- package/esm/public/hooks/mutations/useDeleteUuidModuleMutation.d.ts +0 -38
- package/esm/public/hooks/mutations/useUpdateUuidModuleMutation.d.ts +0 -40
- package/esm/public/hooks/queries/useUuidModuleQuery.d.ts +0 -65
- package/esm/public/hooks/queries/useUuidModulesQuery.d.ts +0 -69
- package/esm/public/orm/models/uuidModule.d.ts +0 -56
- package/public/hooks/mutations/useCreateUuidModuleMutation.d.ts +0 -34
- package/public/hooks/mutations/useDeleteUuidModuleMutation.d.ts +0 -38
- package/public/hooks/mutations/useUpdateUuidModuleMutation.d.ts +0 -40
- package/public/hooks/queries/useUuidModuleQuery.d.ts +0 -65
- package/public/hooks/queries/useUuidModulesQuery.d.ts +0 -69
- package/public/orm/models/uuidModule.d.ts +0 -56
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create mutation hook for Enum
|
|
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 { EnumSelect, EnumWithRelations, CreateEnumInput } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { EnumSelect, EnumWithRelations, CreateEnumInput } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* Mutation hook for creating a Enum
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useCreateEnumMutation({
|
|
16
|
+
* selection: { fields: { id: true, name: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ name: 'New item' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useCreateEnumMutation<S extends EnumSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & EnumSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, EnumSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
createEnum: {
|
|
28
|
+
enum: InferSelectResult<EnumWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, CreateEnumInput['enum']>, 'mutationFn'>): UseMutationResult<{
|
|
31
|
+
createEnum: {
|
|
32
|
+
enum: InferSelectResult<EnumWithRelations, S>;
|
|
33
|
+
};
|
|
34
|
+
}, Error, CreateEnumInput['enum']>;
|
package/esm/public/hooks/mutations/{useCreateUuidModuleMutation.js → useCreateEnumMutation.js}
RENAMED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Create mutation hook for
|
|
2
|
+
* Create mutation hook for Enum
|
|
3
3
|
* @generated by @constructive-io/graphql-codegen
|
|
4
4
|
* DO NOT EDIT - changes will be overwritten
|
|
5
5
|
*/
|
|
6
6
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
7
7
|
import { getClient } from '../client';
|
|
8
8
|
import { buildSelectionArgs } from '../selection';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
export function
|
|
9
|
+
import { enumKeys } from '../query-keys';
|
|
10
|
+
import { enumMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useCreateEnumMutation(params) {
|
|
12
12
|
const args = buildSelectionArgs(params.selection);
|
|
13
13
|
const { selection: _selection, ...mutationOptions } = params ?? {};
|
|
14
14
|
void _selection;
|
|
15
15
|
const queryClient = useQueryClient();
|
|
16
16
|
return useMutation({
|
|
17
|
-
mutationKey:
|
|
17
|
+
mutationKey: enumMutationKeys.create(),
|
|
18
18
|
mutationFn: (data) => getClient()
|
|
19
|
-
.
|
|
19
|
+
.enum.create({
|
|
20
20
|
data,
|
|
21
21
|
select: args.select,
|
|
22
22
|
})
|
|
23
23
|
.unwrap(),
|
|
24
24
|
onSuccess: () => {
|
|
25
25
|
queryClient.invalidateQueries({
|
|
26
|
-
queryKey:
|
|
26
|
+
queryKey: enumKeys.lists(),
|
|
27
27
|
});
|
|
28
28
|
},
|
|
29
29
|
...mutationOptions,
|
|
@@ -0,0 +1,38 @@
|
|
|
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.
|
|
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 { BlueprintSelect, BlueprintWithRelations } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { BlueprintSelect, BlueprintWithRelations } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* 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.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useDeleteBlueprintMutation({
|
|
16
|
+
* selection: { fields: { id: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-to-delete' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDeleteBlueprintMutation<S extends BlueprintSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & BlueprintSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, BlueprintSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
deleteBlueprint: {
|
|
28
|
+
blueprint: InferSelectResult<BlueprintWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
33
|
+
deleteBlueprint: {
|
|
34
|
+
blueprint: InferSelectResult<BlueprintWithRelations, S>;
|
|
35
|
+
};
|
|
36
|
+
}, Error, {
|
|
37
|
+
id: string;
|
|
38
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
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.
|
|
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 { blueprintKeys } from '../query-keys';
|
|
10
|
+
import { blueprintMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useDeleteBlueprintMutation(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: blueprintMutationKeys.all,
|
|
18
|
+
mutationFn: ({ id }) => getClient()
|
|
19
|
+
.blueprint.delete({
|
|
20
|
+
where: {
|
|
21
|
+
id,
|
|
22
|
+
},
|
|
23
|
+
select: args.select,
|
|
24
|
+
})
|
|
25
|
+
.unwrap(),
|
|
26
|
+
onSuccess: (_, variables) => {
|
|
27
|
+
queryClient.removeQueries({
|
|
28
|
+
queryKey: blueprintKeys.detail(variables.id),
|
|
29
|
+
});
|
|
30
|
+
queryClient.invalidateQueries({
|
|
31
|
+
queryKey: blueprintKeys.lists(),
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
...mutationOptions,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible).
|
|
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 { BlueprintTemplateSelect, BlueprintTemplateWithRelations } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { BlueprintTemplateSelect, BlueprintTemplateWithRelations, } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useDeleteBlueprintTemplateMutation({
|
|
16
|
+
* selection: { fields: { id: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-to-delete' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDeleteBlueprintTemplateMutation<S extends BlueprintTemplateSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & BlueprintTemplateSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, BlueprintTemplateSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
deleteBlueprintTemplate: {
|
|
28
|
+
blueprintTemplate: InferSelectResult<BlueprintTemplateWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
33
|
+
deleteBlueprintTemplate: {
|
|
34
|
+
blueprintTemplate: InferSelectResult<BlueprintTemplateWithRelations, S>;
|
|
35
|
+
};
|
|
36
|
+
}, Error, {
|
|
37
|
+
id: string;
|
|
38
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible).
|
|
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 { blueprintTemplateKeys } from '../query-keys';
|
|
10
|
+
import { blueprintTemplateMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useDeleteBlueprintTemplateMutation(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: blueprintTemplateMutationKeys.all,
|
|
18
|
+
mutationFn: ({ id }) => getClient()
|
|
19
|
+
.blueprintTemplate.delete({
|
|
20
|
+
where: {
|
|
21
|
+
id,
|
|
22
|
+
},
|
|
23
|
+
select: args.select,
|
|
24
|
+
})
|
|
25
|
+
.unwrap(),
|
|
26
|
+
onSuccess: (_, variables) => {
|
|
27
|
+
queryClient.removeQueries({
|
|
28
|
+
queryKey: blueprintTemplateKeys.detail(variables.id),
|
|
29
|
+
});
|
|
30
|
+
queryClient.invalidateQueries({
|
|
31
|
+
queryKey: blueprintTemplateKeys.lists(),
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
...mutationOptions,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete mutation hook for DatabaseTransfer
|
|
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 { DatabaseTransferSelect, DatabaseTransferWithRelations } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { DatabaseTransferSelect, DatabaseTransferWithRelations } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* Mutation hook for deleting a DatabaseTransfer with typed selection
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useDeleteDatabaseTransferMutation({
|
|
16
|
+
* selection: { fields: { id: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-to-delete' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDeleteDatabaseTransferMutation<S extends DatabaseTransferSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & DatabaseTransferSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, DatabaseTransferSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
deleteDatabaseTransfer: {
|
|
28
|
+
databaseTransfer: InferSelectResult<DatabaseTransferWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
33
|
+
deleteDatabaseTransfer: {
|
|
34
|
+
databaseTransfer: InferSelectResult<DatabaseTransferWithRelations, S>;
|
|
35
|
+
};
|
|
36
|
+
}, Error, {
|
|
37
|
+
id: string;
|
|
38
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete mutation hook for DatabaseTransfer
|
|
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 { databaseTransferKeys } from '../query-keys';
|
|
10
|
+
import { databaseTransferMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useDeleteDatabaseTransferMutation(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: databaseTransferMutationKeys.all,
|
|
18
|
+
mutationFn: ({ id }) => getClient()
|
|
19
|
+
.databaseTransfer.delete({
|
|
20
|
+
where: {
|
|
21
|
+
id,
|
|
22
|
+
},
|
|
23
|
+
select: args.select,
|
|
24
|
+
})
|
|
25
|
+
.unwrap(),
|
|
26
|
+
onSuccess: (_, variables) => {
|
|
27
|
+
queryClient.removeQueries({
|
|
28
|
+
queryKey: databaseTransferKeys.detail(variables.id),
|
|
29
|
+
});
|
|
30
|
+
queryClient.invalidateQueries({
|
|
31
|
+
queryKey: databaseTransferKeys.lists(),
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
...mutationOptions,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete mutation hook for EmbeddingChunk
|
|
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 { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { EmbeddingChunkSelect, EmbeddingChunkWithRelations } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* Mutation hook for deleting a EmbeddingChunk with typed selection
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useDeleteEmbeddingChunkMutation({
|
|
16
|
+
* selection: { fields: { id: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-to-delete' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDeleteEmbeddingChunkMutation<S extends EmbeddingChunkSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & EmbeddingChunkSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, EmbeddingChunkSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
deleteEmbeddingChunk: {
|
|
28
|
+
embeddingChunk: InferSelectResult<EmbeddingChunkWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
33
|
+
deleteEmbeddingChunk: {
|
|
34
|
+
embeddingChunk: InferSelectResult<EmbeddingChunkWithRelations, S>;
|
|
35
|
+
};
|
|
36
|
+
}, Error, {
|
|
37
|
+
id: string;
|
|
38
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete mutation hook for EmbeddingChunk
|
|
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 { embeddingChunkKeys } from '../query-keys';
|
|
10
|
+
import { embeddingChunkMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useDeleteEmbeddingChunkMutation(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: embeddingChunkMutationKeys.all,
|
|
18
|
+
mutationFn: ({ id }) => getClient()
|
|
19
|
+
.embeddingChunk.delete({
|
|
20
|
+
where: {
|
|
21
|
+
id,
|
|
22
|
+
},
|
|
23
|
+
select: args.select,
|
|
24
|
+
})
|
|
25
|
+
.unwrap(),
|
|
26
|
+
onSuccess: (_, variables) => {
|
|
27
|
+
queryClient.removeQueries({
|
|
28
|
+
queryKey: embeddingChunkKeys.detail(variables.id),
|
|
29
|
+
});
|
|
30
|
+
queryClient.invalidateQueries({
|
|
31
|
+
queryKey: embeddingChunkKeys.lists(),
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
...mutationOptions,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete mutation hook for Enum
|
|
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 { EnumSelect, EnumWithRelations } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { EnumSelect, EnumWithRelations } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* Mutation hook for deleting a Enum with typed selection
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useDeleteEnumMutation({
|
|
16
|
+
* selection: { fields: { id: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-to-delete' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDeleteEnumMutation<S extends EnumSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & EnumSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, EnumSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
deleteEnum: {
|
|
28
|
+
enum: InferSelectResult<EnumWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
33
|
+
deleteEnum: {
|
|
34
|
+
enum: InferSelectResult<EnumWithRelations, S>;
|
|
35
|
+
};
|
|
36
|
+
}, Error, {
|
|
37
|
+
id: string;
|
|
38
|
+
}>;
|
package/esm/public/hooks/mutations/{useDeleteUuidModuleMutation.js → useDeleteEnumMutation.js}
RENAMED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Delete mutation hook for
|
|
2
|
+
* Delete mutation hook for Enum
|
|
3
3
|
* @generated by @constructive-io/graphql-codegen
|
|
4
4
|
* DO NOT EDIT - changes will be overwritten
|
|
5
5
|
*/
|
|
6
6
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
7
7
|
import { getClient } from '../client';
|
|
8
8
|
import { buildSelectionArgs } from '../selection';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
export function
|
|
9
|
+
import { enumKeys } from '../query-keys';
|
|
10
|
+
import { enumMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useDeleteEnumMutation(params) {
|
|
12
12
|
const args = buildSelectionArgs(params.selection);
|
|
13
13
|
const { selection: _selection, ...mutationOptions } = params ?? {};
|
|
14
14
|
void _selection;
|
|
15
15
|
const queryClient = useQueryClient();
|
|
16
16
|
return useMutation({
|
|
17
|
-
mutationKey:
|
|
17
|
+
mutationKey: enumMutationKeys.all,
|
|
18
18
|
mutationFn: ({ id }) => getClient()
|
|
19
|
-
.
|
|
19
|
+
.enum.delete({
|
|
20
20
|
where: {
|
|
21
21
|
id,
|
|
22
22
|
},
|
|
@@ -25,10 +25,10 @@ export function useDeleteUuidModuleMutation(params) {
|
|
|
25
25
|
.unwrap(),
|
|
26
26
|
onSuccess: (_, variables) => {
|
|
27
27
|
queryClient.removeQueries({
|
|
28
|
-
queryKey:
|
|
28
|
+
queryKey: enumKeys.detail(variables.id),
|
|
29
29
|
});
|
|
30
30
|
queryClient.invalidateQueries({
|
|
31
|
-
queryKey:
|
|
31
|
+
queryKey: enumKeys.lists(),
|
|
32
32
|
});
|
|
33
33
|
},
|
|
34
34
|
...mutationOptions,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom mutation hook for rejectDatabaseTransfer
|
|
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 { RejectDatabaseTransferVariables } from '../../orm/mutation';
|
|
8
|
+
import type { RejectDatabaseTransferPayloadSelect, RejectDatabaseTransferPayload } from '../../orm/input-types';
|
|
9
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
10
|
+
export type { RejectDatabaseTransferVariables } from '../../orm/mutation';
|
|
11
|
+
export type { RejectDatabaseTransferPayloadSelect } from '../../orm/input-types';
|
|
12
|
+
export declare function useRejectDatabaseTransferMutation<S extends RejectDatabaseTransferPayloadSelect>(params: {
|
|
13
|
+
selection: {
|
|
14
|
+
fields: S & RejectDatabaseTransferPayloadSelect;
|
|
15
|
+
} & HookStrictSelect<NoInfer<S>, RejectDatabaseTransferPayloadSelect>;
|
|
16
|
+
} & Omit<UseMutationOptions<{
|
|
17
|
+
rejectDatabaseTransfer: InferSelectResult<RejectDatabaseTransferPayload, S> | null;
|
|
18
|
+
}, Error, RejectDatabaseTransferVariables>, 'mutationFn'>): UseMutationResult<{
|
|
19
|
+
rejectDatabaseTransfer: InferSelectResult<RejectDatabaseTransferPayload, S> | null;
|
|
20
|
+
}, Error, RejectDatabaseTransferVariables>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom mutation hook for rejectDatabaseTransfer
|
|
3
|
+
* @generated by @constructive-io/graphql-codegen
|
|
4
|
+
* DO NOT EDIT - changes will be overwritten
|
|
5
|
+
*/
|
|
6
|
+
import { useMutation } from '@tanstack/react-query';
|
|
7
|
+
import { getClient } from '../client';
|
|
8
|
+
import { buildSelectionArgs } from '../selection';
|
|
9
|
+
import { customMutationKeys } from '../mutation-keys';
|
|
10
|
+
export function useRejectDatabaseTransferMutation(params) {
|
|
11
|
+
const args = buildSelectionArgs(params.selection);
|
|
12
|
+
const { selection: _selection, ...mutationOptions } = params ?? {};
|
|
13
|
+
void _selection;
|
|
14
|
+
return useMutation({
|
|
15
|
+
mutationKey: customMutationKeys.rejectDatabaseTransfer(),
|
|
16
|
+
mutationFn: (variables) => getClient()
|
|
17
|
+
.mutation.rejectDatabaseTransfer(variables, {
|
|
18
|
+
select: args.select,
|
|
19
|
+
})
|
|
20
|
+
.unwrap(),
|
|
21
|
+
...mutationOptions,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.
|
|
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 { BlueprintSelect, BlueprintWithRelations, BlueprintPatch } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { BlueprintSelect, BlueprintWithRelations, BlueprintPatch, } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* 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.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useUpdateBlueprintMutation({
|
|
16
|
+
* selection: { fields: { id: true, name: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-here', blueprintPatch: { name: 'Updated' } });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useUpdateBlueprintMutation<S extends BlueprintSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & BlueprintSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, BlueprintSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
updateBlueprint: {
|
|
28
|
+
blueprint: InferSelectResult<BlueprintWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
blueprintPatch: BlueprintPatch;
|
|
33
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
34
|
+
updateBlueprint: {
|
|
35
|
+
blueprint: InferSelectResult<BlueprintWithRelations, S>;
|
|
36
|
+
};
|
|
37
|
+
}, Error, {
|
|
38
|
+
id: string;
|
|
39
|
+
blueprintPatch: BlueprintPatch;
|
|
40
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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.
|
|
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 { blueprintKeys } from '../query-keys';
|
|
10
|
+
import { blueprintMutationKeys } from '../mutation-keys';
|
|
11
|
+
export function useUpdateBlueprintMutation(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: blueprintMutationKeys.all,
|
|
18
|
+
mutationFn: ({ id, blueprintPatch }) => getClient()
|
|
19
|
+
.blueprint.update({
|
|
20
|
+
where: {
|
|
21
|
+
id,
|
|
22
|
+
},
|
|
23
|
+
data: blueprintPatch,
|
|
24
|
+
select: args.select,
|
|
25
|
+
})
|
|
26
|
+
.unwrap(),
|
|
27
|
+
onSuccess: (_, variables) => {
|
|
28
|
+
queryClient.invalidateQueries({
|
|
29
|
+
queryKey: blueprintKeys.detail(variables.id),
|
|
30
|
+
});
|
|
31
|
+
queryClient.invalidateQueries({
|
|
32
|
+
queryKey: blueprintKeys.lists(),
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
...mutationOptions,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible).
|
|
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 { BlueprintTemplateSelect, BlueprintTemplateWithRelations, BlueprintTemplatePatch } from '../../orm/input-types';
|
|
8
|
+
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
+
export type { BlueprintTemplateSelect, BlueprintTemplateWithRelations, BlueprintTemplatePatch, } from '../../orm/input-types';
|
|
10
|
+
/**
|
|
11
|
+
* A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { mutate, isPending } = useUpdateBlueprintTemplateMutation({
|
|
16
|
+
* selection: { fields: { id: true, name: true } },
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* mutate({ id: 'value-here', blueprintTemplatePatch: { name: 'Updated' } });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useUpdateBlueprintTemplateMutation<S extends BlueprintTemplateSelect>(params: {
|
|
23
|
+
selection: {
|
|
24
|
+
fields: S & BlueprintTemplateSelect;
|
|
25
|
+
} & HookStrictSelect<NoInfer<S>, BlueprintTemplateSelect>;
|
|
26
|
+
} & Omit<UseMutationOptions<{
|
|
27
|
+
updateBlueprintTemplate: {
|
|
28
|
+
blueprintTemplate: InferSelectResult<BlueprintTemplateWithRelations, S>;
|
|
29
|
+
};
|
|
30
|
+
}, Error, {
|
|
31
|
+
id: string;
|
|
32
|
+
blueprintTemplatePatch: BlueprintTemplatePatch;
|
|
33
|
+
}>, 'mutationFn'>): UseMutationResult<{
|
|
34
|
+
updateBlueprintTemplate: {
|
|
35
|
+
blueprintTemplate: InferSelectResult<BlueprintTemplateWithRelations, S>;
|
|
36
|
+
};
|
|
37
|
+
}, Error, {
|
|
38
|
+
id: string;
|
|
39
|
+
blueprintTemplatePatch: BlueprintTemplatePatch;
|
|
40
|
+
}>;
|