@deenruv/replicate-simple-bg-plugin 1.0.6 → 1.0.9
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/dist/plugin-server/tsconfig.tsbuildinfo +1 -0
- package/dist/plugin-server/zeus/index.d.ts +18 -18
- package/dist/plugin-server/zeus/index.js +1 -1
- package/dist/plugin-server/zeus/typedDocumentNode.d.ts +2 -1
- package/dist/plugin-ui/graphql/mutations.d.ts +4 -4
- package/dist/plugin-ui/graphql/queries.d.ts +15 -48
- package/dist/plugin-ui/pages/ReplicatePage.js +1 -1
- package/dist/plugin-ui/pages/ReplicateProductSidebar.js +4 -3
- package/dist/plugin-ui/tsconfig.tsbuildinfo +1 -0
- package/dist/plugin-ui/types.d.ts +6 -17
- package/dist/plugin-ui/types.js +3 -3
- package/dist/plugin-ui/zeus/index.d.ts +18 -18
- package/dist/plugin-ui/zeus/index.js +1 -1
- package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +2 -1
- package/package.json +11 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../../src/plugin-server/constants.ts","../../src/plugin-server/index.ts","../../src/plugin-server/types.ts","../../src/plugin-server/entities/replicate-simple-bg.ts","../../src/plugin-server/extensions/replicate-simple-bg.extension.ts","../../src/plugin-server/graphql/generated-admin-types.ts","../../src/plugin-server/resolvers/replicate-simple-bg-admin.resolver.ts","../../src/plugin-server/services/replicate-simple-bg.service.ts","../../src/plugin-server/zeus/const.ts","../../src/plugin-server/zeus/index.ts","../../src/plugin-server/zeus/typedDocumentNode.ts"],"version":"5.9.3"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ops } from './const.js';
|
|
2
|
-
export declare const HOST = "http://localhost:
|
|
2
|
+
export declare const HOST = "http://localhost:6100/admin-api";
|
|
3
3
|
export declare const HEADERS: {};
|
|
4
4
|
export declare const apiSubscription: (options: chainOptions) => (query: string) => {
|
|
5
5
|
ws: WebSocket;
|
|
@@ -8,38 +8,38 @@ export declare const apiSubscription: (options: chainOptions) => (query: string)
|
|
|
8
8
|
error: (e: (args: any) => void) => void;
|
|
9
9
|
open: (e: () => void) => void;
|
|
10
10
|
};
|
|
11
|
-
export declare const apiFetch: (options:
|
|
11
|
+
export declare const apiFetch: (options: fetchOptions) => (query: string, variables?: Record<string, unknown>) => Promise<Record<string, any> | undefined>;
|
|
12
12
|
export declare const InternalsBuildQuery: ({ ops, props, returns, options, scalars, }: {
|
|
13
13
|
props: AllTypesPropsType;
|
|
14
14
|
returns: ReturnTypesType;
|
|
15
15
|
ops: Operations;
|
|
16
|
-
options?: OperationOptions
|
|
17
|
-
scalars?: ScalarDefinition
|
|
16
|
+
options?: OperationOptions;
|
|
17
|
+
scalars?: ScalarDefinition;
|
|
18
18
|
}) => (k: string, o: InputValueType | VType, p?: string, root?: boolean, vars?: Array<{
|
|
19
19
|
name: string;
|
|
20
20
|
graphQLType: string;
|
|
21
21
|
}>) => string;
|
|
22
22
|
type UnionOverrideKeys<T, U> = Omit<T, keyof U> & U;
|
|
23
|
-
export declare const Thunder: <SCLR extends ScalarDefinition>(fn: FetchFunction, thunderGraphQLOptions?: ThunderGraphQLOptions<SCLR>
|
|
23
|
+
export declare const Thunder: <SCLR extends ScalarDefinition>(fn: FetchFunction, thunderGraphQLOptions?: ThunderGraphQLOptions<SCLR>) => <O extends keyof typeof Ops, OVERRIDESCLR extends SCLR, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR>) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
24
24
|
variables?: Record<string, unknown>;
|
|
25
25
|
}) => Promise<InputType<GraphQLTypes[R], Z, UnionOverrideKeys<SCLR, OVERRIDESCLR>>>;
|
|
26
|
-
export declare const Chain: (...options: chainOptions) => <O extends
|
|
26
|
+
export declare const Chain: (...options: chainOptions) => <O extends keyof typeof Ops, OVERRIDESCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
27
27
|
variables?: Record<string, unknown>;
|
|
28
28
|
}) => Promise<InputType<GraphQLTypes[R], Z, UnionOverrideKeys<ScalarDefinition, OVERRIDESCLR>>>;
|
|
29
|
-
export declare const SubscriptionThunder: <SCLR extends ScalarDefinition>(fn: SubscriptionFunction, thunderGraphQLOptions?: ThunderGraphQLOptions<SCLR>
|
|
30
|
-
variables?: ExtractVariables<Z
|
|
31
|
-
})
|
|
32
|
-
export declare const Subscription: (...options: chainOptions) => <O extends
|
|
33
|
-
variables?: ExtractVariables<Z
|
|
34
|
-
})
|
|
35
|
-
export declare const Zeus: <Z extends ValueTypes[R], O extends
|
|
29
|
+
export declare const SubscriptionThunder: <SCLR extends ScalarDefinition>(fn: SubscriptionFunction, thunderGraphQLOptions?: ThunderGraphQLOptions<SCLR>) => <O extends keyof typeof Ops, OVERRIDESCLR extends SCLR, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR>) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
30
|
+
variables?: ExtractVariables<Z>;
|
|
31
|
+
}) => SubscriptionToGraphQL<Z, GraphQLTypes[R], UnionOverrideKeys<SCLR, OVERRIDESCLR>>;
|
|
32
|
+
export declare const Subscription: (...options: chainOptions) => <O extends keyof typeof Ops, OVERRIDESCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
33
|
+
variables?: ExtractVariables<Z>;
|
|
34
|
+
}) => SubscriptionToGraphQL<Z, GraphQLTypes[R], UnionOverrideKeys<ScalarDefinition, OVERRIDESCLR>>;
|
|
35
|
+
export declare const Zeus: <Z extends ValueTypes[R], O extends keyof typeof Ops, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, o: Z, ops?: {
|
|
36
36
|
operationOptions?: OperationOptions;
|
|
37
37
|
scalars?: ScalarDefinition;
|
|
38
38
|
}) => string;
|
|
39
39
|
export declare const ZeusSelect: <T>() => SelectionFunction<T>;
|
|
40
40
|
export declare const Selector: <T extends keyof ValueTypes>(key: T) => SelectionFunction<ValueTypes[T]>;
|
|
41
41
|
export declare const TypeFromSelector: <T extends keyof ValueTypes>(key: T) => SelectionFunction<ValueTypes[T]>;
|
|
42
|
-
export declare const Gql: <O extends
|
|
42
|
+
export declare const Gql: <O extends keyof typeof Ops, OVERRIDESCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
43
43
|
variables?: Record<string, unknown>;
|
|
44
44
|
}) => Promise<InputType<GraphQLTypes[R], Z, UnionOverrideKeys<ScalarDefinition, OVERRIDESCLR>>>;
|
|
45
45
|
export declare const ZeusScalars: SelectionFunction<ScalarCoders>;
|
|
@@ -54,7 +54,7 @@ export declare const decodeScalarsInResponse: <O extends Operations>({ response,
|
|
|
54
54
|
ops: O;
|
|
55
55
|
response: any;
|
|
56
56
|
returns: ReturnTypesType;
|
|
57
|
-
scalars?: Record<string, ScalarResolver | undefined
|
|
57
|
+
scalars?: Record<string, ScalarResolver | undefined>;
|
|
58
58
|
initialOp: keyof O;
|
|
59
59
|
initialZeusQuery: InputValueType | VType;
|
|
60
60
|
}) => any;
|
|
@@ -126,18 +126,18 @@ export declare const PrepareScalarPaths: ({ ops, returns }: {
|
|
|
126
126
|
[x: string]: `scalar.${string}`;
|
|
127
127
|
} | undefined;
|
|
128
128
|
export declare const purifyGraphQLKey: (k: string) => string;
|
|
129
|
-
export declare const ResolveFromPath: (props: AllTypesPropsType, returns: ReturnTypesType, ops: Operations) => (path: string) =>
|
|
129
|
+
export declare const ResolveFromPath: (props: AllTypesPropsType, returns: ReturnTypesType, ops: Operations) => (path: string) => "enum" | "not" | `scalar.${string}`;
|
|
130
130
|
export declare const InternalArgsBuilt: ({ props, ops, returns, scalars, vars, }: {
|
|
131
131
|
props: AllTypesPropsType;
|
|
132
132
|
returns: ReturnTypesType;
|
|
133
133
|
ops: Operations;
|
|
134
|
-
scalars?: ScalarDefinition
|
|
134
|
+
scalars?: ScalarDefinition;
|
|
135
135
|
vars: Array<{
|
|
136
136
|
name: string;
|
|
137
137
|
graphQLType: string;
|
|
138
138
|
}>;
|
|
139
139
|
}) => (a: ZeusArgsType, p?: string, root?: boolean) => string;
|
|
140
|
-
export declare const resolverFor: <X, T extends keyof ResolverInputTypes, Z extends keyof ResolverInputTypes[T]>(type: T, field: Z, fn: (args: Required<ResolverInputTypes[T]>[Z] extends [infer Input, any] ? Input : any, source: any) => Z extends keyof ModelTypes[T] ?
|
|
140
|
+
export declare const resolverFor: <X, T extends keyof ResolverInputTypes, Z extends keyof ResolverInputTypes[T]>(type: T, field: Z, fn: (args: Required<ResolverInputTypes[T]>[Z] extends [infer Input, any] ? Input : any, source: any) => Z extends keyof ModelTypes[T] ? ModelTypes[T][Z] | Promise<ModelTypes[T][Z]> | X : never) => (args?: any, source?: any) => ReturnType<typeof fn>;
|
|
141
141
|
export type UnwrapPromise<T> = T extends Promise<infer R> ? R : T;
|
|
142
142
|
export type ZeusState<T extends (...args: any[]) => Promise<any>> = NonNullable<UnwrapPromise<ReturnType<T>>>;
|
|
143
143
|
export type ZeusHook<T extends (...args: any[]) => Record<string, (...args: any[]) => Promise<any>>, N extends keyof ReturnType<T>> = ZeusState<ReturnType<T>[N]>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.PredictionSimpleBgStatus = exports.MetricType = exports.MetricInterval = exports.OrderType = exports.LanguageCode = exports.HistoryEntryType = exports.CurrencyCode = exports.LogicalOperator = exports.ErrorCode = exports.SortOrder = exports.Permission = exports.DeletionResult = exports.AdjustmentType = exports.GlobalFlag = exports.AssetType = exports.StockMovementType = exports.JobState = exports.$ = exports.GRAPHQL_TYPE_SEPARATOR = exports.START_VAR_NAME = exports.resolverFor = exports.InternalArgsBuilt = exports.ResolveFromPath = exports.purifyGraphQLKey = exports.PrepareScalarPaths = exports.GraphQLError = exports.SEPARATOR = exports.traverseResponse = exports.decodeScalarsInResponse = exports.fields = exports.ZeusScalars = exports.Gql = exports.TypeFromSelector = exports.Selector = exports.ZeusSelect = exports.Zeus = exports.Subscription = exports.SubscriptionThunder = exports.Chain = exports.Thunder = exports.InternalsBuildQuery = exports.apiFetch = exports.apiSubscription = exports.HEADERS = exports.HOST = void 0;
|
|
5
5
|
const const_js_1 = require("./const.js");
|
|
6
|
-
exports.HOST = "http://localhost:
|
|
6
|
+
exports.HOST = "http://localhost:6100/admin-api";
|
|
7
7
|
exports.HEADERS = {};
|
|
8
8
|
const apiSubscription = (options) => (query) => {
|
|
9
9
|
var _a, _b, _c;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
2
2
|
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from './index.js';
|
|
3
|
-
|
|
3
|
+
import { Ops } from './const.js';
|
|
4
|
+
export declare const typedGql: <O extends keyof typeof Ops, SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR>) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions) => TypedDocumentNode<InputType<GraphQLTypes[R], Z, SCLR>, ExtractVariables<Z>>;
|
|
@@ -2,10 +2,10 @@ export declare const startGenerateSimpleBgMutation: import("@graphql-typed-docum
|
|
|
2
2
|
startGenerateSimpleBg: string;
|
|
3
3
|
}, {} & {
|
|
4
4
|
input: {
|
|
5
|
-
assetId?: string | import("../zeus/index.js").Variable<any, string
|
|
6
|
-
roomType?: string | import("../zeus/index.js").Variable<any, string
|
|
7
|
-
roomStyle?: string | import("../zeus/index.js").Variable<any, string
|
|
8
|
-
prompt?: string | import("../zeus/index.js").Variable<any, string
|
|
5
|
+
assetId?: string | undefined | null | import("../zeus/index.js").Variable<any, string>;
|
|
6
|
+
roomType?: string | undefined | null | import("../zeus/index.js").Variable<any, string>;
|
|
7
|
+
roomStyle?: string | undefined | null | import("../zeus/index.js").Variable<any, string>;
|
|
8
|
+
prompt?: string | undefined | null | import("../zeus/index.js").Variable<any, string>;
|
|
9
9
|
};
|
|
10
10
|
}>;
|
|
11
11
|
export declare const getPredictionAssetMutation: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const getPredictionSimpleBGIDQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
2
|
-
getSimpleBgID?: string | null | undefined;
|
|
2
|
+
getSimpleBgID?: string | undefined | null | undefined;
|
|
3
3
|
}, {} & {
|
|
4
4
|
prediction_simple_bg_entity_id: string;
|
|
5
5
|
}>;
|
|
@@ -7,60 +7,27 @@ export declare const getSimpleBgPredictionsQuery: import("@graphql-typed-documen
|
|
|
7
7
|
getSimpleBgPredictions: {
|
|
8
8
|
items: {
|
|
9
9
|
id: string;
|
|
10
|
-
status: import("../zeus").PredictionSimpleBgStatus;
|
|
10
|
+
status: import("../zeus").GraphQLTypes["PredictionSimpleBgStatus"];
|
|
11
11
|
finishedAt?: string | null | undefined;
|
|
12
12
|
}[];
|
|
13
13
|
totalItems: number;
|
|
14
14
|
};
|
|
15
15
|
}, {
|
|
16
16
|
options?: {
|
|
17
|
-
skip?: number | import("../zeus").Variable<any, string
|
|
18
|
-
take?: number | import("../zeus").Variable<any, string
|
|
19
|
-
sort?:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
23
|
-
filter?: {
|
|
24
|
-
id?: {
|
|
25
|
-
eq?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
26
|
-
notEq?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
27
|
-
in?: string[] | import("../zeus").Variable<any, string> | null | undefined;
|
|
28
|
-
notIn?: string[] | import("../zeus").Variable<any, string> | null | undefined;
|
|
29
|
-
isNull?: boolean | import("../zeus").Variable<any, string> | null | undefined;
|
|
30
|
-
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
31
|
-
status?: {
|
|
32
|
-
eq?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
33
|
-
notEq?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
34
|
-
contains?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
35
|
-
notContains?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
36
|
-
in?: string[] | import("../zeus").Variable<any, string> | null | undefined;
|
|
37
|
-
notIn?: string[] | import("../zeus").Variable<any, string> | null | undefined;
|
|
38
|
-
regex?: string | import("../zeus").Variable<any, string> | null | undefined;
|
|
39
|
-
isNull?: boolean | import("../zeus").Variable<any, string> | null | undefined;
|
|
40
|
-
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
41
|
-
finishedAt?: {
|
|
42
|
-
eq?: unknown;
|
|
43
|
-
before?: unknown;
|
|
44
|
-
after?: unknown;
|
|
45
|
-
between?: {
|
|
46
|
-
start: unknown;
|
|
47
|
-
end: unknown;
|
|
48
|
-
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
49
|
-
isNull?: boolean | import("../zeus").Variable<any, string> | null | undefined;
|
|
50
|
-
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
51
|
-
_and?: import("../zeus").Variable<any, string> | any[] | null | undefined;
|
|
52
|
-
_or?: import("../zeus").Variable<any, string> | any[] | null | undefined;
|
|
53
|
-
} | import("../zeus").Variable<any, string> | null | undefined;
|
|
54
|
-
filterOperator?: import("../zeus").LogicalOperator | import("../zeus").Variable<any, string> | null | undefined;
|
|
17
|
+
skip?: number | undefined | null | import("../zeus").Variable<any, string>;
|
|
18
|
+
take?: number | undefined | null | import("../zeus").Variable<any, string>;
|
|
19
|
+
sort?: import("../zeus").ValueTypes["ReplicateSimpleBgEntitySortParameter"] | undefined | null | import("../zeus").Variable<any, string>;
|
|
20
|
+
filter?: import("../zeus").ValueTypes["ReplicateSimpleBgEntityFilterParameter"] | undefined | null | import("../zeus").Variable<any, string>;
|
|
21
|
+
filterOperator?: import("../zeus").ValueTypes["LogicalOperator"] | undefined | null | import("../zeus").Variable<any, string>;
|
|
55
22
|
} | undefined;
|
|
56
23
|
} & {}>;
|
|
57
24
|
export declare const getSimpleBgItemQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
58
25
|
getSimpleBgItem: {
|
|
59
26
|
id: string;
|
|
60
|
-
image?: string | null | undefined;
|
|
27
|
+
image?: string | undefined | null | undefined;
|
|
61
28
|
status?: import("../zeus").PredictionSimpleBgStatus | null | undefined;
|
|
62
|
-
roomType?: string | null | undefined;
|
|
63
|
-
roomStyle?: string | null | undefined;
|
|
29
|
+
roomType?: string | undefined | null | undefined;
|
|
30
|
+
roomStyle?: string | undefined | null | undefined;
|
|
64
31
|
};
|
|
65
32
|
}, {} & {
|
|
66
33
|
id: string;
|
|
@@ -75,13 +42,13 @@ export declare const getSimpleBgThemeAssetQuery: import("@graphql-typed-document
|
|
|
75
42
|
export declare const getSimpleBgRoomOptions: import("@graphql-typed-document-node/core").TypedDocumentNode<{
|
|
76
43
|
getSimpleBgOptions: {
|
|
77
44
|
roomTypes?: {
|
|
78
|
-
value?: string | null | undefined;
|
|
79
|
-
label?: string | null | undefined;
|
|
45
|
+
value?: string | undefined | null | undefined;
|
|
46
|
+
label?: string | undefined | null | undefined;
|
|
80
47
|
}[] | undefined;
|
|
81
48
|
roomThemes?: {
|
|
82
|
-
value?: string | null | undefined;
|
|
83
|
-
label?: string | null | undefined;
|
|
84
|
-
image?: string | null | undefined;
|
|
49
|
+
value?: string | undefined | null | undefined;
|
|
50
|
+
label?: string | undefined | null | undefined;
|
|
51
|
+
image?: string | undefined | null | undefined;
|
|
85
52
|
}[] | undefined;
|
|
86
53
|
};
|
|
87
54
|
}, {} & {}>;
|
|
@@ -9,7 +9,7 @@ import { FileUpload } from "../components/FileUpload.js";
|
|
|
9
9
|
import { getPredictionAssetMutation, startGenerateSimpleBgMutation, } from "../graphql/mutations.js";
|
|
10
10
|
import { $ } from "@deenruv/admin-types";
|
|
11
11
|
import { Loader2 } from "lucide-react";
|
|
12
|
-
import { useSearchParams } from "react-router
|
|
12
|
+
import { useSearchParams } from "react-router";
|
|
13
13
|
import { toast } from "sonner";
|
|
14
14
|
import { RoomStyleSelect } from "../components/RoomStyleSelect.js";
|
|
15
15
|
import { RoomTypeSelect } from "../components/RoomTypeSelect.js";
|
|
@@ -9,7 +9,7 @@ import { RoomStyleSelect } from "../components/RoomStyleSelect.js";
|
|
|
9
9
|
import { RoomTypeSelect } from "../components/RoomTypeSelect.js";
|
|
10
10
|
export const ReplicateProductSidebar = () => {
|
|
11
11
|
const { t } = useTranslation(translationNS);
|
|
12
|
-
const { id: productId, entity, markAsDirty, form: { base
|
|
12
|
+
const { id: productId, entity, markAsDirty, form: { base }, } = useDetailView("products-detail-view");
|
|
13
13
|
const [form, setForm] = useState({ roomType: undefined, roomStyle: undefined, prompt: null });
|
|
14
14
|
const { data } = useQuery(getSimpleBgRoomOptions);
|
|
15
15
|
const [getPredictionItem, { data: predictionItem, setData: setPredictionItem },] = useLazyQuery(getSimpleBgItemQuery);
|
|
@@ -92,8 +92,9 @@ export const ReplicateProductSidebar = () => {
|
|
|
92
92
|
if (!asset || !entity)
|
|
93
93
|
return;
|
|
94
94
|
const newAsset = asset.getPredictionAsset;
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
const currentAssetIds = base.getValues("assetIds");
|
|
96
|
+
if (currentAssetIds) {
|
|
97
|
+
base.setField("assetIds", [...currentAssetIds, newAsset.id]);
|
|
97
98
|
}
|
|
98
99
|
markAsDirty();
|
|
99
100
|
setIsDialogVisible(false);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../../src/plugin-ui/constants.tsx","../../src/plugin-ui/index.tsx","../../src/plugin-ui/types.tsx","../../src/plugin-ui/components/FileUpload.tsx","../../src/plugin-ui/components/RoomStyleSelect.tsx","../../src/plugin-ui/components/RoomTypeSelect.tsx","../../src/plugin-ui/components/index.tsx","../../src/plugin-ui/pages/ReplicatePage.tsx","../../src/plugin-ui/pages/ReplicateProductSidebar.tsx","../../src/plugin-ui/translation-ns.ts","../../src/plugin-ui/graphql/mutations.ts","../../src/plugin-ui/graphql/queries.ts","../../src/plugin-ui/graphql/selectors.ts","../../src/plugin-ui/locales/en/index.ts","../../src/plugin-ui/locales/pl/index.ts","../../src/plugin-ui/zeus/const.ts","../../src/plugin-ui/zeus/index.ts","../../src/plugin-ui/zeus/scalars.ts","../../src/plugin-ui/zeus/typedDocumentNode.ts","../../src/plugin-ui/tsconfig.json","../../src/plugin-ui/locales/en/simpleBg.json","../../src/plugin-ui/locales/pl/simpleBg.json"],"version":"5.9.3"}
|
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { z } from "zod";
|
|
3
2
|
export declare const formSchema: z.ZodObject<{
|
|
4
|
-
file: z.ZodUnion<[z.
|
|
3
|
+
file: z.ZodUnion<readonly [z.ZodFile, z.ZodNull]>;
|
|
5
4
|
room_type_enum: z.ZodString;
|
|
6
5
|
room_style_enum: z.ZodString;
|
|
7
6
|
prompt: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
-
},
|
|
9
|
-
file: File | null;
|
|
10
|
-
room_style_enum: string;
|
|
11
|
-
room_type_enum: string;
|
|
12
|
-
prompt?: string | null | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
file: File | null;
|
|
15
|
-
room_style_enum: string;
|
|
16
|
-
room_type_enum: string;
|
|
17
|
-
prompt?: string | null | undefined;
|
|
18
|
-
}>;
|
|
7
|
+
}, z.core.$strip>;
|
|
19
8
|
export type FormValues = z.infer<typeof formSchema>;
|
|
20
9
|
export declare const useReplicateForm: () => import("react-hook-form").UseFormReturn<{
|
|
21
|
-
file: File | null;
|
|
22
|
-
room_style_enum: string;
|
|
10
|
+
file: z.core.File | null;
|
|
23
11
|
room_type_enum: string;
|
|
12
|
+
room_style_enum: string;
|
|
24
13
|
prompt?: string | null | undefined;
|
|
25
14
|
}, any, {
|
|
26
|
-
file: File | null;
|
|
27
|
-
room_style_enum: string;
|
|
15
|
+
file: z.core.File | null;
|
|
28
16
|
room_type_enum: string;
|
|
17
|
+
room_style_enum: string;
|
|
29
18
|
prompt?: string | null | undefined;
|
|
30
19
|
}>;
|
|
31
20
|
export interface CustomFileInputProps {
|
package/dist/plugin-ui/types.js
CHANGED
|
@@ -2,14 +2,14 @@ import { z } from "zod";
|
|
|
2
2
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
3
3
|
import { useForm } from "react-hook-form";
|
|
4
4
|
export const formSchema = z.object({
|
|
5
|
-
file: z.union([z.
|
|
5
|
+
file: z.union([z.file(), z.null()]),
|
|
6
6
|
room_type_enum: z.string().min(1),
|
|
7
7
|
room_style_enum: z.string().min(1),
|
|
8
8
|
prompt: z.string().optional().nullable(),
|
|
9
9
|
});
|
|
10
10
|
export const useReplicateForm = () => {
|
|
11
|
-
//
|
|
12
|
-
//
|
|
11
|
+
// With zod@4 + @hookform/resolvers@5, zodResolver expects the native
|
|
12
|
+
// Zod 4 ZodType. Cast through unknown to satisfy both overload variants.
|
|
13
13
|
const resolver = zodResolver(formSchema);
|
|
14
14
|
return useForm({ resolver });
|
|
15
15
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ops } from './const.js';
|
|
2
|
-
export declare const HOST = "http://localhost:
|
|
2
|
+
export declare const HOST = "http://localhost:6100/admin-api";
|
|
3
3
|
export declare const HEADERS: {};
|
|
4
4
|
export declare const apiSubscription: (options: chainOptions) => (query: string) => {
|
|
5
5
|
ws: WebSocket;
|
|
@@ -8,38 +8,38 @@ export declare const apiSubscription: (options: chainOptions) => (query: string)
|
|
|
8
8
|
error: (e: (args: any) => void) => void;
|
|
9
9
|
open: (e: () => void) => void;
|
|
10
10
|
};
|
|
11
|
-
export declare const apiFetch: (options:
|
|
11
|
+
export declare const apiFetch: (options: fetchOptions) => (query: string, variables?: Record<string, unknown>) => Promise<Record<string, any> | undefined>;
|
|
12
12
|
export declare const InternalsBuildQuery: ({ ops, props, returns, options, scalars, }: {
|
|
13
13
|
props: AllTypesPropsType;
|
|
14
14
|
returns: ReturnTypesType;
|
|
15
15
|
ops: Operations;
|
|
16
|
-
options?: OperationOptions
|
|
17
|
-
scalars?: ScalarDefinition
|
|
16
|
+
options?: OperationOptions;
|
|
17
|
+
scalars?: ScalarDefinition;
|
|
18
18
|
}) => (k: string, o: InputValueType | VType, p?: string, root?: boolean, vars?: Array<{
|
|
19
19
|
name: string;
|
|
20
20
|
graphQLType: string;
|
|
21
21
|
}>) => string;
|
|
22
22
|
type UnionOverrideKeys<T, U> = Omit<T, keyof U> & U;
|
|
23
|
-
export declare const Thunder: <SCLR extends ScalarDefinition>(fn: FetchFunction, thunderGraphQLOptions?: ThunderGraphQLOptions<SCLR>
|
|
23
|
+
export declare const Thunder: <SCLR extends ScalarDefinition>(fn: FetchFunction, thunderGraphQLOptions?: ThunderGraphQLOptions<SCLR>) => <O extends keyof typeof Ops, OVERRIDESCLR extends SCLR, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR>) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
24
24
|
variables?: Record<string, unknown>;
|
|
25
25
|
}) => Promise<InputType<GraphQLTypes[R], Z, UnionOverrideKeys<SCLR, OVERRIDESCLR>>>;
|
|
26
|
-
export declare const Chain: (...options: chainOptions) => <O extends
|
|
26
|
+
export declare const Chain: (...options: chainOptions) => <O extends keyof typeof Ops, OVERRIDESCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
27
27
|
variables?: Record<string, unknown>;
|
|
28
28
|
}) => Promise<InputType<GraphQLTypes[R], Z, UnionOverrideKeys<ScalarDefinition, OVERRIDESCLR>>>;
|
|
29
|
-
export declare const SubscriptionThunder: <SCLR extends ScalarDefinition>(fn: SubscriptionFunction, thunderGraphQLOptions?: ThunderGraphQLOptions<SCLR>
|
|
30
|
-
variables?: ExtractVariables<Z
|
|
31
|
-
})
|
|
32
|
-
export declare const Subscription: (...options: chainOptions) => <O extends
|
|
33
|
-
variables?: ExtractVariables<Z
|
|
34
|
-
})
|
|
35
|
-
export declare const Zeus: <Z extends ValueTypes[R], O extends
|
|
29
|
+
export declare const SubscriptionThunder: <SCLR extends ScalarDefinition>(fn: SubscriptionFunction, thunderGraphQLOptions?: ThunderGraphQLOptions<SCLR>) => <O extends keyof typeof Ops, OVERRIDESCLR extends SCLR, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR>) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
30
|
+
variables?: ExtractVariables<Z>;
|
|
31
|
+
}) => SubscriptionToGraphQL<Z, GraphQLTypes[R], UnionOverrideKeys<SCLR, OVERRIDESCLR>>;
|
|
32
|
+
export declare const Subscription: (...options: chainOptions) => <O extends keyof typeof Ops, OVERRIDESCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
33
|
+
variables?: ExtractVariables<Z>;
|
|
34
|
+
}) => SubscriptionToGraphQL<Z, GraphQLTypes[R], UnionOverrideKeys<ScalarDefinition, OVERRIDESCLR>>;
|
|
35
|
+
export declare const Zeus: <Z extends ValueTypes[R], O extends keyof typeof Ops, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, o: Z, ops?: {
|
|
36
36
|
operationOptions?: OperationOptions;
|
|
37
37
|
scalars?: ScalarDefinition;
|
|
38
38
|
}) => string;
|
|
39
39
|
export declare const ZeusSelect: <T>() => SelectionFunction<T>;
|
|
40
40
|
export declare const Selector: <T extends keyof ValueTypes>(key: T) => SelectionFunction<ValueTypes[T]>;
|
|
41
41
|
export declare const TypeFromSelector: <T extends keyof ValueTypes>(key: T) => SelectionFunction<ValueTypes[T]>;
|
|
42
|
-
export declare const Gql: <O extends
|
|
42
|
+
export declare const Gql: <O extends keyof typeof Ops, OVERRIDESCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<OVERRIDESCLR> | undefined) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions & {
|
|
43
43
|
variables?: Record<string, unknown>;
|
|
44
44
|
}) => Promise<InputType<GraphQLTypes[R], Z, UnionOverrideKeys<ScalarDefinition, OVERRIDESCLR>>>;
|
|
45
45
|
export declare const ZeusScalars: SelectionFunction<ScalarCoders>;
|
|
@@ -54,7 +54,7 @@ export declare const decodeScalarsInResponse: <O extends Operations>({ response,
|
|
|
54
54
|
ops: O;
|
|
55
55
|
response: any;
|
|
56
56
|
returns: ReturnTypesType;
|
|
57
|
-
scalars?: Record<string, ScalarResolver | undefined
|
|
57
|
+
scalars?: Record<string, ScalarResolver | undefined>;
|
|
58
58
|
initialOp: keyof O;
|
|
59
59
|
initialZeusQuery: InputValueType | VType;
|
|
60
60
|
}) => any;
|
|
@@ -126,18 +126,18 @@ export declare const PrepareScalarPaths: ({ ops, returns }: {
|
|
|
126
126
|
[x: string]: `scalar.${string}`;
|
|
127
127
|
} | undefined;
|
|
128
128
|
export declare const purifyGraphQLKey: (k: string) => string;
|
|
129
|
-
export declare const ResolveFromPath: (props: AllTypesPropsType, returns: ReturnTypesType, ops: Operations) => (path: string) =>
|
|
129
|
+
export declare const ResolveFromPath: (props: AllTypesPropsType, returns: ReturnTypesType, ops: Operations) => (path: string) => "enum" | "not" | `scalar.${string}`;
|
|
130
130
|
export declare const InternalArgsBuilt: ({ props, ops, returns, scalars, vars, }: {
|
|
131
131
|
props: AllTypesPropsType;
|
|
132
132
|
returns: ReturnTypesType;
|
|
133
133
|
ops: Operations;
|
|
134
|
-
scalars?: ScalarDefinition
|
|
134
|
+
scalars?: ScalarDefinition;
|
|
135
135
|
vars: Array<{
|
|
136
136
|
name: string;
|
|
137
137
|
graphQLType: string;
|
|
138
138
|
}>;
|
|
139
139
|
}) => (a: ZeusArgsType, p?: string, root?: boolean) => string;
|
|
140
|
-
export declare const resolverFor: <X, T extends keyof ResolverInputTypes, Z extends keyof ResolverInputTypes[T]>(type: T, field: Z, fn: (args: Required<ResolverInputTypes[T]>[Z] extends [infer Input, any] ? Input : any, source: any) => Z extends keyof ModelTypes[T] ?
|
|
140
|
+
export declare const resolverFor: <X, T extends keyof ResolverInputTypes, Z extends keyof ResolverInputTypes[T]>(type: T, field: Z, fn: (args: Required<ResolverInputTypes[T]>[Z] extends [infer Input, any] ? Input : any, source: any) => Z extends keyof ModelTypes[T] ? ModelTypes[T][Z] | Promise<ModelTypes[T][Z]> | X : never) => (args?: any, source?: any) => ReturnType<typeof fn>;
|
|
141
141
|
export type UnwrapPromise<T> = T extends Promise<infer R> ? R : T;
|
|
142
142
|
export type ZeusState<T extends (...args: any[]) => Promise<any>> = NonNullable<UnwrapPromise<ReturnType<T>>>;
|
|
143
143
|
export type ZeusHook<T extends (...args: any[]) => Record<string, (...args: any[]) => Promise<any>>, N extends keyof ReturnType<T>> = ZeusState<ReturnType<T>[N]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import { AllTypesProps, ReturnTypes, Ops } from './const.js';
|
|
3
|
-
export const HOST = "http://localhost:
|
|
3
|
+
export const HOST = "http://localhost:6100/admin-api";
|
|
4
4
|
export const HEADERS = {};
|
|
5
5
|
export const apiSubscription = (options) => (query) => {
|
|
6
6
|
try {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
2
2
|
import { ValueTypes, GenericOperation, OperationOptions, GraphQLTypes, InputType, ScalarDefinition, ThunderGraphQLOptions, ExtractVariables } from './index.js';
|
|
3
|
-
|
|
3
|
+
import { Ops } from './const.js';
|
|
4
|
+
export declare const typedGql: <O extends keyof typeof Ops, SCLR extends ScalarDefinition, R extends keyof ValueTypes = GenericOperation<O>>(operation: O, graphqlOptions?: ThunderGraphQLOptions<SCLR>) => <Z extends ValueTypes[R]>(o: Z & { [P in keyof Z]: P extends keyof ValueTypes[R] ? Z[P] : never; }, ops?: OperationOptions) => TypedDocumentNode<InputType<GraphQLTypes[R], Z, SCLR>, ExtractVariables<Z>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deenruv/replicate-simple-bg-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"homepage": "https://deenruv.com/",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"./plugin-ui": "./dist/plugin-ui/index.js"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@hookform/resolvers": "^
|
|
16
|
+
"@hookform/resolvers": "^5.2.2",
|
|
17
17
|
"@nestjs/common": "^10.3.10",
|
|
18
18
|
"@nestjs/graphql": "^12.2.0",
|
|
19
19
|
"axios": "^1.7.7",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"lucide-react": "^0.363.0",
|
|
23
23
|
"react": "^19.0.0",
|
|
24
24
|
"react-dropzone": "^14.3.8",
|
|
25
|
-
"react-hook-form": "^7.
|
|
25
|
+
"react-hook-form": "^7.71.1",
|
|
26
26
|
"react-i18next": "^14.0.5",
|
|
27
|
-
"react-router
|
|
27
|
+
"react-router": "^7.13.0",
|
|
28
28
|
"replicate": "1.0.1",
|
|
29
29
|
"sonner": "^1.4.41",
|
|
30
|
-
"zod": "^3.
|
|
31
|
-
"@deenruv/admin-types": "^1.0.
|
|
32
|
-
"@deenruv/
|
|
33
|
-
"@deenruv/
|
|
30
|
+
"zod": "^4.3.6",
|
|
31
|
+
"@deenruv/admin-types": "^1.0.9",
|
|
32
|
+
"@deenruv/react-ui-devkit": "^1.0.9",
|
|
33
|
+
"@deenruv/common": "^1.0.9"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@deenruv/core": "^1.0.0",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@types/react": "^19.0.0",
|
|
42
42
|
"@types/react-dom": "^19.0.0",
|
|
43
43
|
"rimraf": "^5.0.10",
|
|
44
|
-
"typescript": "5.
|
|
45
|
-
"@deenruv/core": "^1.0.
|
|
44
|
+
"typescript": "~5.9.3",
|
|
45
|
+
"@deenruv/core": "^1.0.9"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "rimraf dist && tsc --build",
|
|
49
49
|
"watch": "tsc --build --watch",
|
|
50
50
|
"lint": "eslint --fix .",
|
|
51
|
-
"zeus": "zeus http://localhost:
|
|
51
|
+
"zeus": "zeus http://localhost:6100/admin-api ./src/plugin-server --es --td && zeus http://localhost:6100/admin-api ./src/plugin-ui --es --td"
|
|
52
52
|
}
|
|
53
53
|
}
|