@constructive-io/schema-builder 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +12 -4
- package/dist/card-widths-CmIxkRfh.cjs +28 -0
- package/dist/card-widths-CmIxkRfh.cjs.map +1 -0
- package/dist/card-widths-pI4Kw4Xz.js +22 -0
- package/dist/card-widths-pI4Kw4Xz.js.map +1 -0
- package/dist/core-CVxnNLs7.cjs +66 -0
- package/dist/core-CVxnNLs7.cjs.map +1 -0
- package/dist/core-DJ5kA4r-.js +49 -0
- package/dist/core-DJ5kA4r-.js.map +1 -0
- package/dist/core.cjs +14 -212
- package/dist/core.d.cts +3 -54
- package/dist/core.d.ts +3 -54
- package/dist/core.js +3 -200
- package/dist/create-table-card-B6SMrt_g.js +7691 -0
- package/dist/create-table-card-B6SMrt_g.js.map +1 -0
- package/dist/create-table-card-BrQ7pB_U.cjs +7732 -0
- package/dist/create-table-card-BrQ7pB_U.cjs.map +1 -0
- package/dist/delete-confirm-dialog-Ch4tWj6B.cjs +42 -0
- package/dist/delete-confirm-dialog-Ch4tWj6B.cjs.map +1 -0
- package/dist/delete-confirm-dialog-K0AWE643.js +37 -0
- package/dist/delete-confirm-dialog-K0AWE643.js.map +1 -0
- package/dist/empty-state-card-5t7LygTB.cjs +62 -0
- package/dist/empty-state-card-5t7LygTB.cjs.map +1 -0
- package/dist/empty-state-card-C-Nylatg.js +57 -0
- package/dist/empty-state-card-C-Nylatg.js.map +1 -0
- package/dist/fields.cjs +8 -7763
- package/dist/fields.d.cts +38 -39
- package/dist/fields.d.ts +38 -39
- package/dist/fields.js +2 -7735
- package/dist/generated-types-DZMUyNBH.d.cts +27 -0
- package/dist/generated-types-DZMUyNBH.d.ts +27 -0
- package/dist/index--9KTz1LB.d.cts +56 -0
- package/dist/index-10idAfdb.d.cts +7 -0
- package/dist/index-BcdFaKFS.d.ts +7 -0
- package/dist/index-euaSKMQK.d.ts +56 -0
- package/dist/index.cjs +392 -13730
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -10
- package/dist/index.d.ts +4 -10
- package/dist/index.js +381 -13698
- package/dist/index.js.map +1 -1
- package/dist/indexes-view-CBzYpKcd.js +736 -0
- package/dist/indexes-view-CBzYpKcd.js.map +1 -0
- package/dist/indexes-view-D1K24ts1.cjs +759 -0
- package/dist/indexes-view-D1K24ts1.cjs.map +1 -0
- package/dist/indexes.cjs +6 -1041
- package/dist/indexes.d.cts +27 -27
- package/dist/indexes.d.ts +27 -27
- package/dist/indexes.js +2 -1016
- package/dist/invalidate-database-entities-BFCWf5Zf.js +2561 -0
- package/dist/invalidate-database-entities-BFCWf5Zf.js.map +1 -0
- package/dist/invalidate-database-entities-Gs5k8A-M.cjs +2864 -0
- package/dist/invalidate-database-entities-Gs5k8A-M.cjs.map +1 -0
- package/dist/keyboard-activation-BQiV0scm.js +13 -0
- package/dist/keyboard-activation-BQiV0scm.js.map +1 -0
- package/dist/keyboard-activation-D-L0IU6Y.cjs +19 -0
- package/dist/keyboard-activation-D-L0IU6Y.cjs.map +1 -0
- package/dist/policies-view-CkvGpJBo.cjs +1023 -0
- package/dist/policies-view-CkvGpJBo.cjs.map +1 -0
- package/dist/policies-view-DTfAhX7G.js +1018 -0
- package/dist/policies-view-DTfAhX7G.js.map +1 -0
- package/dist/policies.cjs +10 -5939
- package/dist/policies.d.cts +55 -50
- package/dist/policies.d.ts +55 -50
- package/dist/policies.js +4 -5911
- package/dist/policy-config-form-EEcQ9ywL.js +2502 -0
- package/dist/policy-config-form-EEcQ9ywL.js.map +1 -0
- package/dist/policy-config-form-RP9010zj.cjs +2629 -0
- package/dist/policy-config-form-RP9010zj.cjs.map +1 -0
- package/dist/policy-types-D_sYWb-b.d.cts +81 -0
- package/dist/policy-types-D_sYWb-b.d.ts +81 -0
- package/dist/query-BGtzUV7Y.cjs +233 -0
- package/dist/query-BGtzUV7Y.cjs.map +1 -0
- package/dist/query-r6j8IjQB.js +192 -0
- package/dist/query-r6j8IjQB.js.map +1 -0
- package/dist/relationships-view-C884EvGj.js +2417 -0
- package/dist/relationships-view-C884EvGj.js.map +1 -0
- package/dist/relationships-view-DlBs-gCF.cjs +2452 -0
- package/dist/relationships-view-DlBs-gCF.cjs.map +1 -0
- package/dist/relationships.cjs +9 -4328
- package/dist/relationships.d.cts +92 -92
- package/dist/relationships.d.ts +92 -92
- package/dist/relationships.js +2 -4300
- package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
- package/dist/schema-builder-sidebar-DAgK7ZTu.js +654 -0
- package/dist/schema-builder-sidebar-DAgK7ZTu.js.map +1 -0
- package/dist/schema-builder-sidebar-L3TcQeQr.cjs +671 -0
- package/dist/schema-builder-sidebar-L3TcQeQr.cjs.map +1 -0
- package/dist/table-editor-B-5i1M79.js +1906 -0
- package/dist/table-editor-B-5i1M79.js.map +1 -0
- package/dist/table-editor-BdLdVZfh.cjs +1935 -0
- package/dist/table-editor-BdLdVZfh.cjs.map +1 -0
- package/dist/tables.cjs +6 -5643
- package/dist/tables.d.cts +22 -21
- package/dist/tables.d.ts +22 -21
- package/dist/tables.js +3 -5618
- package/dist/testing.cjs +63 -62
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +62 -61
- package/dist/testing.js.map +1 -1
- package/dist/types-CXNRA22N.d.cts +450 -0
- package/dist/types-CXNRA22N.d.ts +450 -0
- package/dist/use-update-table-DlLX9fdE.js +244 -0
- package/dist/use-update-table-DlLX9fdE.js.map +1 -0
- package/dist/use-update-table-vcoHVolI.cjs +291 -0
- package/dist/use-update-table-vcoHVolI.cjs.map +1 -0
- package/package.json +8 -6
- package/dist/core.cjs.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/fields.cjs.map +0 -1
- package/dist/fields.js.map +0 -1
- package/dist/generated-types-CnAlqHU_.d.cts +0 -25
- package/dist/generated-types-CnAlqHU_.d.ts +0 -25
- package/dist/indexes.cjs.map +0 -1
- package/dist/indexes.js.map +0 -1
- package/dist/policies.cjs.map +0 -1
- package/dist/policies.js.map +0 -1
- package/dist/policy-types-CEYAR5TN.d.cts +0 -79
- package/dist/policy-types-CEYAR5TN.d.ts +0 -79
- package/dist/relationships.cjs.map +0 -1
- package/dist/relationships.js.map +0 -1
- package/dist/tables.cjs.map +0 -1
- package/dist/tables.js.map +0 -1
- package/dist/types-Du86atZ8.d.cts +0 -199
- package/dist/types-Du86atZ8.d.ts +0 -199
- package/dist/types-bX2dCrdl.d.cts +0 -52
- package/dist/types-bX2dCrdl.d.ts +0 -52
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/compat/generated-types.d.ts
|
|
2
|
+
interface GeneratedNode {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
id: string;
|
|
5
|
+
name?: string | null;
|
|
6
|
+
label?: string | null;
|
|
7
|
+
description?: string | null;
|
|
8
|
+
databaseId?: string | null;
|
|
9
|
+
schemaId?: string | null;
|
|
10
|
+
tableId?: string | null;
|
|
11
|
+
ownerId?: string | null;
|
|
12
|
+
displayName?: string | null;
|
|
13
|
+
username?: string | null;
|
|
14
|
+
nodes?: GeneratedNode[] | null;
|
|
15
|
+
edges?: Array<{
|
|
16
|
+
node: GeneratedNode;
|
|
17
|
+
}> | null;
|
|
18
|
+
totalCount?: number | null;
|
|
19
|
+
pageInfo?: {
|
|
20
|
+
hasNextPage?: boolean | null;
|
|
21
|
+
hasPreviousPage?: boolean | null;
|
|
22
|
+
} | null;
|
|
23
|
+
}
|
|
24
|
+
type GeneratedMutationResult = Record<string, Record<string, GeneratedNode | null> | null>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { GeneratedNode as n, GeneratedMutationResult as t };
|
|
27
|
+
//# sourceMappingURL=generated-types-DZMUyNBH.d.cts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/compat/generated-types.d.ts
|
|
2
|
+
interface GeneratedNode {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
id: string;
|
|
5
|
+
name?: string | null;
|
|
6
|
+
label?: string | null;
|
|
7
|
+
description?: string | null;
|
|
8
|
+
databaseId?: string | null;
|
|
9
|
+
schemaId?: string | null;
|
|
10
|
+
tableId?: string | null;
|
|
11
|
+
ownerId?: string | null;
|
|
12
|
+
displayName?: string | null;
|
|
13
|
+
username?: string | null;
|
|
14
|
+
nodes?: GeneratedNode[] | null;
|
|
15
|
+
edges?: Array<{
|
|
16
|
+
node: GeneratedNode;
|
|
17
|
+
}> | null;
|
|
18
|
+
totalCount?: number | null;
|
|
19
|
+
pageInfo?: {
|
|
20
|
+
hasNextPage?: boolean | null;
|
|
21
|
+
hasPreviousPage?: boolean | null;
|
|
22
|
+
} | null;
|
|
23
|
+
}
|
|
24
|
+
type GeneratedMutationResult = Record<string, Record<string, GeneratedNode | null> | null>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { GeneratedNode as n, GeneratedMutationResult as t };
|
|
27
|
+
//# sourceMappingURL=generated-types-DZMUyNBH.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { g as SchemaBuilderOperationContext, j as SchemaBuilderVariables, n as SchemaBuilderAdapter, s as SchemaBuilderFeature, u as SchemaBuilderHostOptions, w as SchemaBuilderScope, y as SchemaBuilderPreferences } from "./types-CXNRA22N.cjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { StoreApi } from "zustand/vanilla";
|
|
4
|
+
import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
|
+
//#region src/core/store.d.ts
|
|
6
|
+
interface SchemaBuilderStoreState {
|
|
7
|
+
scopeKey: string;
|
|
8
|
+
selectedTableId: string | null;
|
|
9
|
+
selectedFieldId: string | null;
|
|
10
|
+
currentDatabaseApi: unknown | null;
|
|
11
|
+
preferences: SchemaBuilderPreferences;
|
|
12
|
+
activeTab: string;
|
|
13
|
+
setSelectedTableId: (tableId: string | null) => void;
|
|
14
|
+
setSelectedFieldId: (fieldId: string | null) => void;
|
|
15
|
+
setCurrentDatabaseApi: (api: unknown | null) => void;
|
|
16
|
+
replacePreferences: (preferences: SchemaBuilderPreferences) => void;
|
|
17
|
+
replaceActiveTab: (tabId: string) => void;
|
|
18
|
+
replaceScope: (scope: SchemaBuilderScope) => void;
|
|
19
|
+
}
|
|
20
|
+
declare function getSchemaBuilderScopeKey(scope: SchemaBuilderScope): string;
|
|
21
|
+
declare function createSchemaBuilderStore(scope: SchemaBuilderScope, preferences: SchemaBuilderPreferences, activeTab: string, selectedTableId?: string | null): StoreApi<SchemaBuilderStoreState>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/core/context.d.ts
|
|
24
|
+
interface SchemaBuilderContextValue extends SchemaBuilderHostOptions {
|
|
25
|
+
store: StoreApi<SchemaBuilderStoreState>;
|
|
26
|
+
setActiveTab: (tabId: string) => void;
|
|
27
|
+
setPreferences: (preferences: SchemaBuilderPreferences | ((current: SchemaBuilderPreferences) => SchemaBuilderPreferences)) => void;
|
|
28
|
+
selectTable: (tableId: string | null, tableName?: string | null) => void;
|
|
29
|
+
selectField: (fieldId: string | null) => void;
|
|
30
|
+
}
|
|
31
|
+
interface SchemaBuilderProviderProps extends SchemaBuilderHostOptions {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
declare function SchemaBuilderProvider(props: SchemaBuilderProviderProps): import("react").JSX.Element;
|
|
35
|
+
declare function useSchemaBuilder(): SchemaBuilderContextValue;
|
|
36
|
+
declare function useSchemaBuilderStore<T>(selector: (state: SchemaBuilderStoreState) => T): T;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/core/query.d.ts
|
|
39
|
+
type FeatureOperation$1<TFeature extends SchemaBuilderFeature> = Extract<keyof SchemaBuilderAdapter[TFeature], string>;
|
|
40
|
+
declare function schemaBuilderQueryKey(scope: {
|
|
41
|
+
orgId: string;
|
|
42
|
+
databaseId: string;
|
|
43
|
+
userId?: string | null;
|
|
44
|
+
}, feature: SchemaBuilderFeature, operation: string, variables?: SchemaBuilderVariables): readonly ["@constructive-io/schema-builder", string, string, string | null, keyof SchemaBuilderAdapter, string, object];
|
|
45
|
+
declare function useSchemaBuilderQuery<TData = unknown, TFeature extends SchemaBuilderFeature = SchemaBuilderFeature>(feature: TFeature, operation: FeatureOperation$1<TFeature>, variables?: SchemaBuilderVariables, options?: Omit<UseQueryOptions<TData, Error, TData, ReturnType<typeof schemaBuilderQueryKey>>, 'queryKey' | 'queryFn'>): UseQueryResult<TData, Error>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/core/mutation.d.ts
|
|
48
|
+
type FeatureOperation<TFeature extends SchemaBuilderFeature> = Extract<keyof SchemaBuilderAdapter[TFeature], string>;
|
|
49
|
+
type SchemaBuilderMutationOptions<TData, TVariables, TContext = unknown> = UseMutationOptions<TData, Error, TVariables, TContext> & {
|
|
50
|
+
/** Result fields required by generated GraphQL adapters for this mutation. */
|
|
51
|
+
selection?: SchemaBuilderOperationContext['selection'];
|
|
52
|
+
};
|
|
53
|
+
declare function useSchemaBuilderMutation<TData = unknown, TVariables extends SchemaBuilderVariables = SchemaBuilderVariables, TFeature extends SchemaBuilderFeature = SchemaBuilderFeature>(feature: TFeature, operation: FeatureOperation<TFeature>, options?: SchemaBuilderMutationOptions<TData, TVariables>): UseMutationResult<TData, Error, TVariables>;
|
|
54
|
+
//#endregion
|
|
55
|
+
export { SchemaBuilderContextValue as a, useSchemaBuilder as c, createSchemaBuilderStore as d, getSchemaBuilderScopeKey as f, useSchemaBuilderQuery as i, useSchemaBuilderStore as l, useSchemaBuilderMutation as n, SchemaBuilderProvider as o, schemaBuilderQueryKey as r, SchemaBuilderProviderProps as s, SchemaBuilderMutationOptions as t, SchemaBuilderStoreState as u };
|
|
56
|
+
//# sourceMappingURL=index--9KTz1LB.d.cts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { b as SchemaBuilderProps } from "./types-CXNRA22N.cjs";
|
|
2
|
+
import "./index--9KTz1LB.cjs";
|
|
3
|
+
//#region src/components/schema-builder.d.ts
|
|
4
|
+
declare function SchemaBuilder(props: SchemaBuilderProps): import("react").JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { SchemaBuilder as t };
|
|
7
|
+
//# sourceMappingURL=index-10idAfdb.d.cts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { b as SchemaBuilderProps } from "./types-CXNRA22N.js";
|
|
2
|
+
import "./index-euaSKMQK.js";
|
|
3
|
+
//#region src/components/schema-builder.d.ts
|
|
4
|
+
declare function SchemaBuilder(props: SchemaBuilderProps): import("react").JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { SchemaBuilder as t };
|
|
7
|
+
//# sourceMappingURL=index-BcdFaKFS.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { g as SchemaBuilderOperationContext, j as SchemaBuilderVariables, n as SchemaBuilderAdapter, s as SchemaBuilderFeature, u as SchemaBuilderHostOptions, w as SchemaBuilderScope, y as SchemaBuilderPreferences } from "./types-CXNRA22N.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { StoreApi } from "zustand/vanilla";
|
|
4
|
+
import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
5
|
+
//#region src/core/store.d.ts
|
|
6
|
+
interface SchemaBuilderStoreState {
|
|
7
|
+
scopeKey: string;
|
|
8
|
+
selectedTableId: string | null;
|
|
9
|
+
selectedFieldId: string | null;
|
|
10
|
+
currentDatabaseApi: unknown | null;
|
|
11
|
+
preferences: SchemaBuilderPreferences;
|
|
12
|
+
activeTab: string;
|
|
13
|
+
setSelectedTableId: (tableId: string | null) => void;
|
|
14
|
+
setSelectedFieldId: (fieldId: string | null) => void;
|
|
15
|
+
setCurrentDatabaseApi: (api: unknown | null) => void;
|
|
16
|
+
replacePreferences: (preferences: SchemaBuilderPreferences) => void;
|
|
17
|
+
replaceActiveTab: (tabId: string) => void;
|
|
18
|
+
replaceScope: (scope: SchemaBuilderScope) => void;
|
|
19
|
+
}
|
|
20
|
+
declare function getSchemaBuilderScopeKey(scope: SchemaBuilderScope): string;
|
|
21
|
+
declare function createSchemaBuilderStore(scope: SchemaBuilderScope, preferences: SchemaBuilderPreferences, activeTab: string, selectedTableId?: string | null): StoreApi<SchemaBuilderStoreState>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/core/context.d.ts
|
|
24
|
+
interface SchemaBuilderContextValue extends SchemaBuilderHostOptions {
|
|
25
|
+
store: StoreApi<SchemaBuilderStoreState>;
|
|
26
|
+
setActiveTab: (tabId: string) => void;
|
|
27
|
+
setPreferences: (preferences: SchemaBuilderPreferences | ((current: SchemaBuilderPreferences) => SchemaBuilderPreferences)) => void;
|
|
28
|
+
selectTable: (tableId: string | null, tableName?: string | null) => void;
|
|
29
|
+
selectField: (fieldId: string | null) => void;
|
|
30
|
+
}
|
|
31
|
+
interface SchemaBuilderProviderProps extends SchemaBuilderHostOptions {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
declare function SchemaBuilderProvider(props: SchemaBuilderProviderProps): import("react").JSX.Element;
|
|
35
|
+
declare function useSchemaBuilder(): SchemaBuilderContextValue;
|
|
36
|
+
declare function useSchemaBuilderStore<T>(selector: (state: SchemaBuilderStoreState) => T): T;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/core/query.d.ts
|
|
39
|
+
type FeatureOperation$1<TFeature extends SchemaBuilderFeature> = Extract<keyof SchemaBuilderAdapter[TFeature], string>;
|
|
40
|
+
declare function schemaBuilderQueryKey(scope: {
|
|
41
|
+
orgId: string;
|
|
42
|
+
databaseId: string;
|
|
43
|
+
userId?: string | null;
|
|
44
|
+
}, feature: SchemaBuilderFeature, operation: string, variables?: SchemaBuilderVariables): readonly ["@constructive-io/schema-builder", string, string, string | null, keyof SchemaBuilderAdapter, string, object];
|
|
45
|
+
declare function useSchemaBuilderQuery<TData = unknown, TFeature extends SchemaBuilderFeature = SchemaBuilderFeature>(feature: TFeature, operation: FeatureOperation$1<TFeature>, variables?: SchemaBuilderVariables, options?: Omit<UseQueryOptions<TData, Error, TData, ReturnType<typeof schemaBuilderQueryKey>>, 'queryKey' | 'queryFn'>): UseQueryResult<TData, Error>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/core/mutation.d.ts
|
|
48
|
+
type FeatureOperation<TFeature extends SchemaBuilderFeature> = Extract<keyof SchemaBuilderAdapter[TFeature], string>;
|
|
49
|
+
type SchemaBuilderMutationOptions<TData, TVariables, TContext = unknown> = UseMutationOptions<TData, Error, TVariables, TContext> & {
|
|
50
|
+
/** Result fields required by generated GraphQL adapters for this mutation. */
|
|
51
|
+
selection?: SchemaBuilderOperationContext['selection'];
|
|
52
|
+
};
|
|
53
|
+
declare function useSchemaBuilderMutation<TData = unknown, TVariables extends SchemaBuilderVariables = SchemaBuilderVariables, TFeature extends SchemaBuilderFeature = SchemaBuilderFeature>(feature: TFeature, operation: FeatureOperation<TFeature>, options?: SchemaBuilderMutationOptions<TData, TVariables>): UseMutationResult<TData, Error, TVariables>;
|
|
54
|
+
//#endregion
|
|
55
|
+
export { SchemaBuilderContextValue as a, useSchemaBuilder as c, createSchemaBuilderStore as d, getSchemaBuilderScopeKey as f, useSchemaBuilderQuery as i, useSchemaBuilderStore as l, useSchemaBuilderMutation as n, SchemaBuilderProvider as o, schemaBuilderQueryKey as r, SchemaBuilderProviderProps as s, SchemaBuilderMutationOptions as t, SchemaBuilderStoreState as u };
|
|
56
|
+
//# sourceMappingURL=index-euaSKMQK.d.ts.map
|