@chelone/vue 0.1.0 → 0.1.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/dist/admin/admin-shell.vue.js +1 -1
- package/dist/components/admin/auth/auth-callback.vue.js +1 -1
- package/dist/components/admin/auth/login-form.vue.js +1 -1
- package/dist/components/admin/auth/login-with-email.vue.js +1 -1
- package/dist/components/admin/feedback/loading-indicator.vue.js +1 -1
- package/dist/components/admin/feedback/spinner.vue.js +1 -1
- package/dist/components/admin/list/calendar-list.vue.js +1 -2
- package/dist/components/admin/list/count-spinner.vue.js +1 -1
- package/dist/components/admin/supabase/forgot-password-form.vue.js +1 -1
- package/dist/components/admin/supabase/set-password-form.vue.js +1 -1
- package/dist/components/maps-osm/osm-feature-operator.vue.js +1 -1
- package/dist/components/ui/spinner.vue.js +29 -1
- package/dist/components/ui/spinner2.vue.js +1 -29
- package/dist/controllers/use-infinite-list-controller.js +2 -13
- package/dist/controllers/use-list-controller.js +3 -13
- package/dist/data/create-chelone-hooks.d.ts +318 -4
- package/dist/data/mutations.d.ts +324 -5
- package/dist/data/mutations.js +55 -45
- package/dist/list/use-list.js +2 -13
- package/package.json +4 -4
|
@@ -4,7 +4,7 @@ import { useRoute, useRouter, START_LOCATION } from "vue-router";
|
|
|
4
4
|
import _sfc_main$6 from "../components/admin/layout/layout.vue.js";
|
|
5
5
|
import _sfc_main$1 from "../components/admin/layout/theme-provider.vue.js";
|
|
6
6
|
import _sfc_main$4 from "../components/admin/auth/login-page.vue.js";
|
|
7
|
-
import _sfc_main$3 from "../components/ui/
|
|
7
|
+
import _sfc_main$3 from "../components/ui/spinner.vue.js";
|
|
8
8
|
import { useBasename } from "../router/adapter.js";
|
|
9
9
|
import { useWatchDataErrors } from "../auth/permissions-hooks.js";
|
|
10
10
|
import { useAuthGate } from "./auth-gate.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, unref, openBlock, createBlock, createElementBlock, createVNode } from "vue";
|
|
2
2
|
import { useHandleAuthCallback } from "../../../admin/auth-gate.js";
|
|
3
|
-
import _sfc_main$2 from "../../ui/
|
|
3
|
+
import _sfc_main$2 from "../../ui/spinner.vue.js";
|
|
4
4
|
import _sfc_main$1 from "./auth-error.vue.js";
|
|
5
5
|
const _hoisted_1 = {
|
|
6
6
|
key: 1,
|
|
@@ -6,7 +6,7 @@ import { useTranslate } from "../../../i18n/use-translate.js";
|
|
|
6
6
|
import { cn } from "../../../lib/utils.js";
|
|
7
7
|
import { useLogin } from "../../../auth/auth-hooks.js";
|
|
8
8
|
import _sfc_main$2 from "../../ui/button.vue.js";
|
|
9
|
-
import _sfc_main$3 from "../../ui/
|
|
9
|
+
import _sfc_main$3 from "../../ui/spinner.vue.js";
|
|
10
10
|
import _sfc_main$1 from "../inputs/text-input.vue.js";
|
|
11
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
12
|
__name: "login-form",
|
|
@@ -6,7 +6,7 @@ import { useForm } from "../../../form/use-form.js";
|
|
|
6
6
|
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
7
7
|
import { cn } from "../../../lib/utils.js";
|
|
8
8
|
import _sfc_main$3 from "../../ui/button.vue.js";
|
|
9
|
-
import _sfc_main$4 from "../../ui/
|
|
9
|
+
import _sfc_main$4 from "../../ui/spinner.vue.js";
|
|
10
10
|
import _sfc_main$2 from "../inputs/password-input.vue.js";
|
|
11
11
|
import _sfc_main$1 from "../inputs/text-input.vue.js";
|
|
12
12
|
import { LogInIcon } from "./icons.js";
|
|
@@ -2,7 +2,7 @@ import { defineComponent, computed, openBlock, createElementBlock, normalizeClas
|
|
|
2
2
|
import { useLoading, useRefresh } from "../../../data/use-refresh.js";
|
|
3
3
|
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
4
4
|
import { cn } from "../../../lib/utils.js";
|
|
5
|
-
import _sfc_main$2 from "../../ui/
|
|
5
|
+
import _sfc_main$2 from "../../ui/spinner.vue.js";
|
|
6
6
|
import { RotateCwIcon } from "../buttons/icons.js";
|
|
7
7
|
import _sfc_main$1 from "../common/icon-button-with-tooltip.vue.js";
|
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, normalizeClass, createCommentVNode } from "vue";
|
|
2
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
-
import _sfc_main$1 from "../../ui/
|
|
3
|
+
import _sfc_main$1 from "../../ui/spinner.vue.js";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "spinner",
|
|
6
6
|
props: {
|
|
@@ -98,8 +98,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
98
98
|
);
|
|
99
99
|
const rangeStartISO = computed(() => range.value.start.toISOString());
|
|
100
100
|
const rangeEndISO = computed(() => range.value.end.toISOString());
|
|
101
|
-
const
|
|
102
|
-
const originalPerPage = list.perPage === props.perPage ? LIST_DEFAULT_PER_PAGE : list.perPage;
|
|
101
|
+
const originalPerPage = list.perPage === props.perPage ? list.defaultPerPage ?? 10 : list.perPage;
|
|
103
102
|
let appliedKeys = [];
|
|
104
103
|
const without = (filter, keys) => Object.fromEntries(
|
|
105
104
|
Object.entries(filter).filter(([key]) => !keys.includes(key))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, unref, openBlock, createBlock, normalizeClass, createCommentVNode } from "vue";
|
|
2
|
-
import _sfc_main$1 from "../../ui/
|
|
2
|
+
import _sfc_main$1 from "../../ui/spinner.vue.js";
|
|
3
3
|
import { useTimeout } from "../feedback/use-timeout.js";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "count-spinner",
|
|
@@ -6,7 +6,7 @@ import { useForm } from "../../../form/use-form.js";
|
|
|
6
6
|
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
7
7
|
import { cn } from "../../../lib/utils.js";
|
|
8
8
|
import _sfc_main$2 from "../../ui/button.vue.js";
|
|
9
|
-
import _sfc_main$3 from "../../ui/
|
|
9
|
+
import _sfc_main$3 from "../../ui/spinner.vue.js";
|
|
10
10
|
import _sfc_main$1 from "../inputs/text-input.vue.js";
|
|
11
11
|
import { useResetPassword } from "./use-password-recovery.js";
|
|
12
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -6,7 +6,7 @@ import { useForm } from "../../../form/use-form.js";
|
|
|
6
6
|
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
7
7
|
import { cn } from "../../../lib/utils.js";
|
|
8
8
|
import _sfc_main$2 from "../../ui/button.vue.js";
|
|
9
|
-
import _sfc_main$3 from "../../ui/
|
|
9
|
+
import _sfc_main$3 from "../../ui/spinner.vue.js";
|
|
10
10
|
import _sfc_main$1 from "../inputs/password-input.vue.js";
|
|
11
11
|
import { useSupabaseUrlTokens, useSetPassword } from "./use-password-recovery.js";
|
|
12
12
|
const _hoisted_1 = {
|
|
@@ -6,7 +6,7 @@ import { useTranslate } from "../../i18n/use-translate.js";
|
|
|
6
6
|
import { useNotify } from "../../notification-hooks.js";
|
|
7
7
|
import { useMapsConfig } from "../maps/use-map.js";
|
|
8
8
|
import _sfc_main$1 from "../ui/button.vue.js";
|
|
9
|
-
import _sfc_main$2 from "../ui/
|
|
9
|
+
import _sfc_main$2 from "../ui/spinner.vue.js";
|
|
10
10
|
import { fetchOsmFeatures } from "./osm-features.js";
|
|
11
11
|
import { subtractMask, unionAll } from "./osm-geometry-ops.js";
|
|
12
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,4 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createElementVNode } from "vue";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "spinner",
|
|
5
|
+
props: {
|
|
6
|
+
class: {}
|
|
7
|
+
},
|
|
8
|
+
setup(__props) {
|
|
9
|
+
const props = __props;
|
|
10
|
+
const classes = computed(() => cn("size-4 animate-spin", props.class));
|
|
11
|
+
return (_ctx, _cache) => {
|
|
12
|
+
return openBlock(), createElementBlock("svg", {
|
|
13
|
+
role: "status",
|
|
14
|
+
"aria-label": "Loading",
|
|
15
|
+
class: normalizeClass(classes.value),
|
|
16
|
+
"data-slot": "spinner",
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
fill: "none",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
"stroke-width": "2",
|
|
21
|
+
"stroke-linecap": "round",
|
|
22
|
+
"stroke-linejoin": "round",
|
|
23
|
+
"aria-hidden": "false"
|
|
24
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
25
|
+
createElementVNode("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }, null, -1)
|
|
26
|
+
])], 2);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
2
30
|
export {
|
|
3
31
|
_sfc_main as default
|
|
4
32
|
};
|
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { cn } from "../../lib/utils.js";
|
|
3
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
-
__name: "spinner",
|
|
5
|
-
props: {
|
|
6
|
-
class: {}
|
|
7
|
-
},
|
|
8
|
-
setup(__props) {
|
|
9
|
-
const props = __props;
|
|
10
|
-
const classes = computed(() => cn("size-4 animate-spin", props.class));
|
|
11
|
-
return (_ctx, _cache) => {
|
|
12
|
-
return openBlock(), createElementBlock("svg", {
|
|
13
|
-
role: "status",
|
|
14
|
-
"aria-label": "Loading",
|
|
15
|
-
class: normalizeClass(classes.value),
|
|
16
|
-
"data-slot": "spinner",
|
|
17
|
-
viewBox: "0 0 24 24",
|
|
18
|
-
fill: "none",
|
|
19
|
-
stroke: "currentColor",
|
|
20
|
-
"stroke-width": "2",
|
|
21
|
-
"stroke-linecap": "round",
|
|
22
|
-
"stroke-linejoin": "round",
|
|
23
|
-
"aria-hidden": "false"
|
|
24
|
-
}, [..._cache[0] || (_cache[0] = [
|
|
25
|
-
createElementVNode("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }, null, -1)
|
|
26
|
-
])], 2);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
});
|
|
1
|
+
import _sfc_main from "./spinner.vue.js";
|
|
30
2
|
export {
|
|
31
3
|
_sfc_main as default
|
|
32
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createInfiniteListController } from "@chelone/core";
|
|
1
|
+
import { createInfiniteListController, listControllerActions } from "@chelone/core";
|
|
2
2
|
import { reactive, computed } from "vue";
|
|
3
3
|
import { useCheloneContext } from "../context.js";
|
|
4
4
|
import { useRequiredResource } from "../resource-context.js";
|
|
@@ -29,18 +29,7 @@ function useInfiniteListController(options = {}) {
|
|
|
29
29
|
selectedIds: computed(() => state.value.selectedIds),
|
|
30
30
|
hasNextPage: computed(() => state.value.hasNextPage),
|
|
31
31
|
hasPreviousPage: computed(() => state.value.hasPreviousPage),
|
|
32
|
-
|
|
33
|
-
setPerPage: controller.setPerPage,
|
|
34
|
-
setSort: controller.setSort,
|
|
35
|
-
setFilters: controller.setFilters,
|
|
36
|
-
setParams: controller.setParams,
|
|
37
|
-
showFilter: controller.showFilter,
|
|
38
|
-
hideFilter: controller.hideFilter,
|
|
39
|
-
select: controller.select,
|
|
40
|
-
toggleItem: controller.toggleItem,
|
|
41
|
-
unselectAll: controller.unselectAll,
|
|
42
|
-
selectAll: controller.selectAll,
|
|
43
|
-
refetch: controller.refetch,
|
|
32
|
+
...listControllerActions(controller),
|
|
44
33
|
fetchNextPage: controller.fetchNextPage,
|
|
45
34
|
fetchPreviousPage: controller.fetchPreviousPage
|
|
46
35
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createListController, listPatchFromSearch, serializeListState } from "@chelone/core";
|
|
1
|
+
import { createListController, listPatchFromSearch, serializeListState, listControllerActions } from "@chelone/core";
|
|
2
2
|
import { onScopeDispose, watch, reactive, computed } from "vue";
|
|
3
3
|
import { useCheloneContext } from "../context.js";
|
|
4
4
|
import { useRequiredResource } from "../resource-context.js";
|
|
@@ -53,18 +53,8 @@ function useListController(options = {}) {
|
|
|
53
53
|
selectedIds: computed(() => state.value.selectedIds),
|
|
54
54
|
hasNextPage: computed(() => state.value.hasNextPage),
|
|
55
55
|
hasPreviousPage: computed(() => state.value.hasPreviousPage),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
setSort: controller.setSort,
|
|
59
|
-
setFilters: controller.setFilters,
|
|
60
|
-
setParams: controller.setParams,
|
|
61
|
-
showFilter: controller.showFilter,
|
|
62
|
-
hideFilter: controller.hideFilter,
|
|
63
|
-
select: controller.select,
|
|
64
|
-
toggleItem: controller.toggleItem,
|
|
65
|
-
unselectAll: controller.unselectAll,
|
|
66
|
-
selectAll: controller.selectAll,
|
|
67
|
-
refetch: controller.refetch
|
|
56
|
+
...listControllerActions(controller),
|
|
57
|
+
defaultPerPage: controller.defaultPerPage
|
|
68
58
|
});
|
|
69
59
|
}
|
|
70
60
|
export {
|
|
@@ -92,8 +92,165 @@ export declare function createCheloneHooks<TResources extends ResourceMap>(): {
|
|
|
92
92
|
meta: {} | null;
|
|
93
93
|
}];
|
|
94
94
|
manySnapshot: [readonly unknown[], unknown][];
|
|
95
|
-
}>, "reset" | "mutate"
|
|
96
|
-
|
|
95
|
+
}>, "reset" | "mutate">> | (Omit<import("@tanstack/vue-query").UseMutationReturnType<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").UpdateParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
96
|
+
previous?: undefined;
|
|
97
|
+
key?: undefined;
|
|
98
|
+
manySnapshot?: undefined;
|
|
99
|
+
} | {
|
|
100
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
101
|
+
key: readonly [string, "getOne", {
|
|
102
|
+
id: string;
|
|
103
|
+
meta?: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
id: string;
|
|
106
|
+
meta: {} | null;
|
|
107
|
+
}];
|
|
108
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
109
|
+
}, Omit<import("@tanstack/query-core").MutationObserverIdleResult<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").UpdateParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
110
|
+
previous?: undefined;
|
|
111
|
+
key?: undefined;
|
|
112
|
+
manySnapshot?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
115
|
+
key: readonly [string, "getOne", {
|
|
116
|
+
id: string;
|
|
117
|
+
meta?: undefined;
|
|
118
|
+
} | {
|
|
119
|
+
id: string;
|
|
120
|
+
meta: {} | null;
|
|
121
|
+
}];
|
|
122
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
123
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverLoadingResult<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").UpdateParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
124
|
+
previous?: undefined;
|
|
125
|
+
key?: undefined;
|
|
126
|
+
manySnapshot?: undefined;
|
|
127
|
+
} | {
|
|
128
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
129
|
+
key: readonly [string, "getOne", {
|
|
130
|
+
id: string;
|
|
131
|
+
meta?: undefined;
|
|
132
|
+
} | {
|
|
133
|
+
id: string;
|
|
134
|
+
meta: {} | null;
|
|
135
|
+
}];
|
|
136
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
137
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverErrorResult<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").UpdateParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
138
|
+
previous?: undefined;
|
|
139
|
+
key?: undefined;
|
|
140
|
+
manySnapshot?: undefined;
|
|
141
|
+
} | {
|
|
142
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
143
|
+
key: readonly [string, "getOne", {
|
|
144
|
+
id: string;
|
|
145
|
+
meta?: undefined;
|
|
146
|
+
} | {
|
|
147
|
+
id: string;
|
|
148
|
+
meta: {} | null;
|
|
149
|
+
}];
|
|
150
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
151
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverSuccessResult<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").UpdateParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
152
|
+
previous?: undefined;
|
|
153
|
+
key?: undefined;
|
|
154
|
+
manySnapshot?: undefined;
|
|
155
|
+
} | {
|
|
156
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
157
|
+
key: readonly [string, "getOne", {
|
|
158
|
+
id: string;
|
|
159
|
+
meta?: undefined;
|
|
160
|
+
} | {
|
|
161
|
+
id: string;
|
|
162
|
+
meta: {} | null;
|
|
163
|
+
}];
|
|
164
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
165
|
+
}>, "reset" | "mutate">>, "mutate" | "mutateAsync"> & {
|
|
166
|
+
mutate: (params: import("@chelone/core").UpdateParams<import("@chelone/core").RecordOf<TResources, TName>>, callbacks?: import("@chelone/core").UndoableCallbacks<import("@chelone/core").RecordOf<TResources, TName>, import("@chelone/core").UpdateParams<import("@chelone/core").RecordOf<TResources, TName>>> | undefined) => void;
|
|
167
|
+
mutateAsync: (params: import("@chelone/core").UpdateParams<import("@chelone/core").RecordOf<TResources, TName>>) => Promise<void>;
|
|
168
|
+
});
|
|
169
|
+
useUpdateMany: <TName extends keyof TResources & string>(resource: TName, options?: MutationModeOptions) => (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverIdleResult<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown>, "reset" | "mutate">>> & {
|
|
170
|
+
mutate: (variables: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, options?: import("@tanstack/query-core").MutateOptions<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown> | undefined) => void;
|
|
171
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown>;
|
|
172
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
173
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverLoadingResult<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown>, "reset" | "mutate">>> & {
|
|
174
|
+
mutate: (variables: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, options?: import("@tanstack/query-core").MutateOptions<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown> | undefined) => void;
|
|
175
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown>;
|
|
176
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
177
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverErrorResult<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown>, "reset" | "mutate">>> & {
|
|
178
|
+
mutate: (variables: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, options?: import("@tanstack/query-core").MutateOptions<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown> | undefined) => void;
|
|
179
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown>;
|
|
180
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
181
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverSuccessResult<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown>, "reset" | "mutate">>> & {
|
|
182
|
+
mutate: (variables: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, options?: import("@tanstack/query-core").MutateOptions<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown> | undefined) => void;
|
|
183
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<import("@chelone/core").Identifier[], Error, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, unknown>;
|
|
184
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
185
|
+
}) | {
|
|
186
|
+
mutate: (params: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, callbacks?: import("@chelone/core").UndoableUpdateManyCallbacks<import("@chelone/core").RecordOf<TResources, TName>> | undefined) => void;
|
|
187
|
+
mutateAsync: (params: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>) => Promise<void>;
|
|
188
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
189
|
+
error: import("vue").Ref<null, null>;
|
|
190
|
+
status: import("vue").Ref<"idle", "idle">;
|
|
191
|
+
isError: import("vue").Ref<false, false>;
|
|
192
|
+
isPending: import("vue").Ref<false, false>;
|
|
193
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
194
|
+
failureCount: import("vue").Ref<number, number>;
|
|
195
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
196
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
197
|
+
variables: import("vue").Ref<undefined, undefined>;
|
|
198
|
+
isIdle: import("vue").Ref<true, true>;
|
|
199
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
200
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
201
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
202
|
+
} | {
|
|
203
|
+
mutate: (params: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, callbacks?: import("@chelone/core").UndoableUpdateManyCallbacks<import("@chelone/core").RecordOf<TResources, TName>> | undefined) => void;
|
|
204
|
+
mutateAsync: (params: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>) => Promise<void>;
|
|
205
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
206
|
+
error: import("vue").Ref<null, null>;
|
|
207
|
+
status: import("vue").Ref<"pending", "pending">;
|
|
208
|
+
isError: import("vue").Ref<false, false>;
|
|
209
|
+
isPending: import("vue").Ref<true, true>;
|
|
210
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
211
|
+
failureCount: import("vue").Ref<number, number>;
|
|
212
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
213
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
214
|
+
variables: import("vue").Ref<import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>>;
|
|
215
|
+
isIdle: import("vue").Ref<false, false>;
|
|
216
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
217
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
218
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
219
|
+
} | {
|
|
220
|
+
mutate: (params: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, callbacks?: import("@chelone/core").UndoableUpdateManyCallbacks<import("@chelone/core").RecordOf<TResources, TName>> | undefined) => void;
|
|
221
|
+
mutateAsync: (params: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>) => Promise<void>;
|
|
222
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
223
|
+
error: import("vue").Ref<Error, Error>;
|
|
224
|
+
status: import("vue").Ref<"error", "error">;
|
|
225
|
+
isError: import("vue").Ref<true, true>;
|
|
226
|
+
isPending: import("vue").Ref<false, false>;
|
|
227
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
228
|
+
failureCount: import("vue").Ref<number, number>;
|
|
229
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
230
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
231
|
+
variables: import("vue").Ref<import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>>;
|
|
232
|
+
isIdle: import("vue").Ref<false, false>;
|
|
233
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
234
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
235
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
236
|
+
} | {
|
|
237
|
+
mutate: (params: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, callbacks?: import("@chelone/core").UndoableUpdateManyCallbacks<import("@chelone/core").RecordOf<TResources, TName>> | undefined) => void;
|
|
238
|
+
mutateAsync: (params: import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>) => Promise<void>;
|
|
239
|
+
data: import("vue").Ref<import("@chelone/core").Identifier[], import("@chelone/core").Identifier[]>;
|
|
240
|
+
error: import("vue").Ref<null, null>;
|
|
241
|
+
status: import("vue").Ref<"success", "success">;
|
|
242
|
+
isError: import("vue").Ref<false, false>;
|
|
243
|
+
isPending: import("vue").Ref<false, false>;
|
|
244
|
+
isSuccess: import("vue").Ref<true, true>;
|
|
245
|
+
failureCount: import("vue").Ref<number, number>;
|
|
246
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
247
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
248
|
+
variables: import("vue").Ref<import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>, import("@chelone/core").UpdateManyParams<import("@chelone/core").RecordOf<TResources, TName>>>;
|
|
249
|
+
isIdle: import("vue").Ref<false, false>;
|
|
250
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
251
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
252
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
253
|
+
};
|
|
97
254
|
useDelete: <TName extends keyof TResources & string>(resource: TName, options?: MutationModeOptions) => import("@tanstack/vue-query").UseMutationReturnType<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
98
255
|
previous?: undefined;
|
|
99
256
|
key?: undefined;
|
|
@@ -164,7 +321,164 @@ export declare function createCheloneHooks<TResources extends ResourceMap>(): {
|
|
|
164
321
|
meta: {} | null;
|
|
165
322
|
}];
|
|
166
323
|
manySnapshot: [readonly unknown[], unknown][];
|
|
167
|
-
}>, "reset" | "mutate"
|
|
168
|
-
|
|
324
|
+
}>, "reset" | "mutate">> | (Omit<import("@tanstack/vue-query").UseMutationReturnType<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
325
|
+
previous?: undefined;
|
|
326
|
+
key?: undefined;
|
|
327
|
+
manySnapshot?: undefined;
|
|
328
|
+
} | {
|
|
329
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
330
|
+
key: readonly [string, "getOne", {
|
|
331
|
+
id: string;
|
|
332
|
+
meta?: undefined;
|
|
333
|
+
} | {
|
|
334
|
+
id: string;
|
|
335
|
+
meta: {} | null;
|
|
336
|
+
}];
|
|
337
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
338
|
+
}, Omit<import("@tanstack/query-core").MutationObserverIdleResult<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
339
|
+
previous?: undefined;
|
|
340
|
+
key?: undefined;
|
|
341
|
+
manySnapshot?: undefined;
|
|
342
|
+
} | {
|
|
343
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
344
|
+
key: readonly [string, "getOne", {
|
|
345
|
+
id: string;
|
|
346
|
+
meta?: undefined;
|
|
347
|
+
} | {
|
|
348
|
+
id: string;
|
|
349
|
+
meta: {} | null;
|
|
350
|
+
}];
|
|
351
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
352
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverLoadingResult<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
353
|
+
previous?: undefined;
|
|
354
|
+
key?: undefined;
|
|
355
|
+
manySnapshot?: undefined;
|
|
356
|
+
} | {
|
|
357
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
358
|
+
key: readonly [string, "getOne", {
|
|
359
|
+
id: string;
|
|
360
|
+
meta?: undefined;
|
|
361
|
+
} | {
|
|
362
|
+
id: string;
|
|
363
|
+
meta: {} | null;
|
|
364
|
+
}];
|
|
365
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
366
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverErrorResult<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
367
|
+
previous?: undefined;
|
|
368
|
+
key?: undefined;
|
|
369
|
+
manySnapshot?: undefined;
|
|
370
|
+
} | {
|
|
371
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
372
|
+
key: readonly [string, "getOne", {
|
|
373
|
+
id: string;
|
|
374
|
+
meta?: undefined;
|
|
375
|
+
} | {
|
|
376
|
+
id: string;
|
|
377
|
+
meta: {} | null;
|
|
378
|
+
}];
|
|
379
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
380
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverSuccessResult<import("@chelone/core").RecordOf<TResources, TName>, unknown, import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>, {
|
|
381
|
+
previous?: undefined;
|
|
382
|
+
key?: undefined;
|
|
383
|
+
manySnapshot?: undefined;
|
|
384
|
+
} | {
|
|
385
|
+
previous: import("@chelone/core").RecordOf<TResources, TName> | undefined;
|
|
386
|
+
key: readonly [string, "getOne", {
|
|
387
|
+
id: string;
|
|
388
|
+
meta?: undefined;
|
|
389
|
+
} | {
|
|
390
|
+
id: string;
|
|
391
|
+
meta: {} | null;
|
|
392
|
+
}];
|
|
393
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
394
|
+
}>, "reset" | "mutate">>, "mutate" | "mutateAsync"> & {
|
|
395
|
+
mutate: (params: import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>, callbacks?: import("@chelone/core").UndoableCallbacks<import("@chelone/core").RecordOf<TResources, TName> | undefined, import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>> | undefined) => void;
|
|
396
|
+
mutateAsync: (params: import("@chelone/core").DeleteParams<import("@chelone/core").RecordOf<TResources, TName>>) => Promise<void>;
|
|
397
|
+
});
|
|
398
|
+
useDeleteMany: <TName extends keyof TResources & string>(resource: TName, options?: MutationModeOptions) => (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverIdleResult<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown>, "reset" | "mutate">>> & {
|
|
399
|
+
mutate: (variables: import("@chelone/core").DeleteManyParams, options?: import("@tanstack/query-core").MutateOptions<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown> | undefined) => void;
|
|
400
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown>;
|
|
401
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
402
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverLoadingResult<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown>, "reset" | "mutate">>> & {
|
|
403
|
+
mutate: (variables: import("@chelone/core").DeleteManyParams, options?: import("@tanstack/query-core").MutateOptions<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown> | undefined) => void;
|
|
404
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown>;
|
|
405
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
406
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverErrorResult<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown>, "reset" | "mutate">>> & {
|
|
407
|
+
mutate: (variables: import("@chelone/core").DeleteManyParams, options?: import("@tanstack/query-core").MutateOptions<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown> | undefined) => void;
|
|
408
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown>;
|
|
409
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
410
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverSuccessResult<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown>, "reset" | "mutate">>> & {
|
|
411
|
+
mutate: (variables: import("@chelone/core").DeleteManyParams, options?: import("@tanstack/query-core").MutateOptions<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown> | undefined) => void;
|
|
412
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<import("@chelone/core").Identifier[], Error, import("@chelone/core").DeleteManyParams, unknown>;
|
|
413
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
414
|
+
}) | {
|
|
415
|
+
mutate: (params: import("@chelone/core").DeleteManyParams, callbacks?: import("@chelone/core").UndoableCallbacks<import("@chelone/core").Identifier[], import("@chelone/core").DeleteManyParams>) => void;
|
|
416
|
+
mutateAsync: (params: import("@chelone/core").DeleteManyParams) => Promise<void>;
|
|
417
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
418
|
+
error: import("vue").Ref<null, null>;
|
|
419
|
+
status: import("vue").Ref<"idle", "idle">;
|
|
420
|
+
isError: import("vue").Ref<false, false>;
|
|
421
|
+
isPending: import("vue").Ref<false, false>;
|
|
422
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
423
|
+
failureCount: import("vue").Ref<number, number>;
|
|
424
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
425
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
426
|
+
variables: import("vue").Ref<undefined, undefined>;
|
|
427
|
+
isIdle: import("vue").Ref<true, true>;
|
|
428
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
429
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
430
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
431
|
+
} | {
|
|
432
|
+
mutate: (params: import("@chelone/core").DeleteManyParams, callbacks?: import("@chelone/core").UndoableCallbacks<import("@chelone/core").Identifier[], import("@chelone/core").DeleteManyParams>) => void;
|
|
433
|
+
mutateAsync: (params: import("@chelone/core").DeleteManyParams) => Promise<void>;
|
|
434
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
435
|
+
error: import("vue").Ref<null, null>;
|
|
436
|
+
status: import("vue").Ref<"pending", "pending">;
|
|
437
|
+
isError: import("vue").Ref<false, false>;
|
|
438
|
+
isPending: import("vue").Ref<true, true>;
|
|
439
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
440
|
+
failureCount: import("vue").Ref<number, number>;
|
|
441
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
442
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
443
|
+
variables: import("vue").Ref<import("@chelone/core").DeleteManyParams, import("@chelone/core").DeleteManyParams>;
|
|
444
|
+
isIdle: import("vue").Ref<false, false>;
|
|
445
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
446
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
447
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
448
|
+
} | {
|
|
449
|
+
mutate: (params: import("@chelone/core").DeleteManyParams, callbacks?: import("@chelone/core").UndoableCallbacks<import("@chelone/core").Identifier[], import("@chelone/core").DeleteManyParams>) => void;
|
|
450
|
+
mutateAsync: (params: import("@chelone/core").DeleteManyParams) => Promise<void>;
|
|
451
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
452
|
+
error: import("vue").Ref<Error, Error>;
|
|
453
|
+
status: import("vue").Ref<"error", "error">;
|
|
454
|
+
isError: import("vue").Ref<true, true>;
|
|
455
|
+
isPending: import("vue").Ref<false, false>;
|
|
456
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
457
|
+
failureCount: import("vue").Ref<number, number>;
|
|
458
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
459
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
460
|
+
variables: import("vue").Ref<import("@chelone/core").DeleteManyParams, import("@chelone/core").DeleteManyParams>;
|
|
461
|
+
isIdle: import("vue").Ref<false, false>;
|
|
462
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
463
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
464
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
465
|
+
} | {
|
|
466
|
+
mutate: (params: import("@chelone/core").DeleteManyParams, callbacks?: import("@chelone/core").UndoableCallbacks<import("@chelone/core").Identifier[], import("@chelone/core").DeleteManyParams>) => void;
|
|
467
|
+
mutateAsync: (params: import("@chelone/core").DeleteManyParams) => Promise<void>;
|
|
468
|
+
data: import("vue").Ref<import("@chelone/core").Identifier[], import("@chelone/core").Identifier[]>;
|
|
469
|
+
error: import("vue").Ref<null, null>;
|
|
470
|
+
status: import("vue").Ref<"success", "success">;
|
|
471
|
+
isError: import("vue").Ref<false, false>;
|
|
472
|
+
isPending: import("vue").Ref<false, false>;
|
|
473
|
+
isSuccess: import("vue").Ref<true, true>;
|
|
474
|
+
failureCount: import("vue").Ref<number, number>;
|
|
475
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
476
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
477
|
+
variables: import("vue").Ref<import("@chelone/core").DeleteManyParams, import("@chelone/core").DeleteManyParams>;
|
|
478
|
+
isIdle: import("vue").Ref<false, false>;
|
|
479
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
480
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
481
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
482
|
+
};
|
|
169
483
|
};
|
|
170
484
|
export {};
|
package/dist/data/mutations.d.ts
CHANGED
|
@@ -14,7 +14,17 @@
|
|
|
14
14
|
* vanilla `startUndoableMutation` engine + an Undo notification. The default
|
|
15
15
|
* (`"pessimistic"`) path is unchanged.
|
|
16
16
|
*/
|
|
17
|
-
import { type DeleteManyParams, type DeleteParams, type MutationModeOptions, type RecordOf, type ResourceMap, type UpdateManyParams, type UpdateParams } from "@chelone/core";
|
|
17
|
+
import { type DeleteManyParams, type DeleteParams, type Identifier, type MutationModeOptions, type RecordOf, type ResourceMap, type UndoableCallbacks, type UndoableUpdateManyCallbacks, type UpdateManyParams, type UpdateParams } from "@chelone/core";
|
|
18
|
+
/**
|
|
19
|
+
* A mutation whose `mutate` / `mutateAsync` are swapped for the undoable pair,
|
|
20
|
+
* the state refs untouched. Naming it keeps the hook's inferred type
|
|
21
|
+
* declaration-emittable: spreading vue-query's refs over a generic record type
|
|
22
|
+
* would expand to `@vue/shared` types a `.d.ts` cannot name.
|
|
23
|
+
*/
|
|
24
|
+
type Undoable<TMutation, TParams, TData> = Omit<TMutation, "mutate" | "mutateAsync"> & {
|
|
25
|
+
mutate: (params: TParams, callbacks?: UndoableCallbacks<TData, TParams>) => void;
|
|
26
|
+
mutateAsync: (params: TParams) => Promise<void>;
|
|
27
|
+
};
|
|
18
28
|
/**
|
|
19
29
|
* Create mutation for `resource` — the Vue twin of `@chelone/react`'s
|
|
20
30
|
* `useCreate(resource)`. Call `.mutateAsync({ data })` to dispatch; the
|
|
@@ -98,7 +108,77 @@ export declare function useUpdate<TResources extends ResourceMap = ResourceMap,
|
|
|
98
108
|
meta: {} | null;
|
|
99
109
|
}];
|
|
100
110
|
manySnapshot: [readonly unknown[], unknown][];
|
|
101
|
-
}>, "reset" | "mutate"
|
|
111
|
+
}>, "reset" | "mutate">> | Undoable<import("@tanstack/vue-query").UseMutationReturnType<RecordOf<TResources, TName>, unknown, UpdateParams<RecordOf<TResources, TName>>, {
|
|
112
|
+
previous?: undefined;
|
|
113
|
+
key?: undefined;
|
|
114
|
+
manySnapshot?: undefined;
|
|
115
|
+
} | {
|
|
116
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
117
|
+
key: readonly [string, "getOne", {
|
|
118
|
+
id: string;
|
|
119
|
+
meta?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
id: string;
|
|
122
|
+
meta: {} | null;
|
|
123
|
+
}];
|
|
124
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
125
|
+
}, Omit<import("@tanstack/query-core").MutationObserverIdleResult<RecordOf<TResources, TName>, unknown, UpdateParams<RecordOf<TResources, TName>>, {
|
|
126
|
+
previous?: undefined;
|
|
127
|
+
key?: undefined;
|
|
128
|
+
manySnapshot?: undefined;
|
|
129
|
+
} | {
|
|
130
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
131
|
+
key: readonly [string, "getOne", {
|
|
132
|
+
id: string;
|
|
133
|
+
meta?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
id: string;
|
|
136
|
+
meta: {} | null;
|
|
137
|
+
}];
|
|
138
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
139
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverLoadingResult<RecordOf<TResources, TName>, unknown, UpdateParams<RecordOf<TResources, TName>>, {
|
|
140
|
+
previous?: undefined;
|
|
141
|
+
key?: undefined;
|
|
142
|
+
manySnapshot?: undefined;
|
|
143
|
+
} | {
|
|
144
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
145
|
+
key: readonly [string, "getOne", {
|
|
146
|
+
id: string;
|
|
147
|
+
meta?: undefined;
|
|
148
|
+
} | {
|
|
149
|
+
id: string;
|
|
150
|
+
meta: {} | null;
|
|
151
|
+
}];
|
|
152
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
153
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverErrorResult<RecordOf<TResources, TName>, unknown, UpdateParams<RecordOf<TResources, TName>>, {
|
|
154
|
+
previous?: undefined;
|
|
155
|
+
key?: undefined;
|
|
156
|
+
manySnapshot?: undefined;
|
|
157
|
+
} | {
|
|
158
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
159
|
+
key: readonly [string, "getOne", {
|
|
160
|
+
id: string;
|
|
161
|
+
meta?: undefined;
|
|
162
|
+
} | {
|
|
163
|
+
id: string;
|
|
164
|
+
meta: {} | null;
|
|
165
|
+
}];
|
|
166
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
167
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverSuccessResult<RecordOf<TResources, TName>, unknown, UpdateParams<RecordOf<TResources, TName>>, {
|
|
168
|
+
previous?: undefined;
|
|
169
|
+
key?: undefined;
|
|
170
|
+
manySnapshot?: undefined;
|
|
171
|
+
} | {
|
|
172
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
173
|
+
key: readonly [string, "getOne", {
|
|
174
|
+
id: string;
|
|
175
|
+
meta?: undefined;
|
|
176
|
+
} | {
|
|
177
|
+
id: string;
|
|
178
|
+
meta: {} | null;
|
|
179
|
+
}];
|
|
180
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
181
|
+
}>, "reset" | "mutate">>, UpdateParams<RecordOf<TResources, TName>>, RecordOf<TResources, TName>>;
|
|
102
182
|
/**
|
|
103
183
|
* Delete-one mutation for `resource`. Returns vue-query's mutation object; call
|
|
104
184
|
* `.mutateAsync({ id, previousData })` to dispatch. Mirrors the React delete
|
|
@@ -177,7 +257,77 @@ export declare function useDelete<TResources extends ResourceMap = ResourceMap,
|
|
|
177
257
|
meta: {} | null;
|
|
178
258
|
}];
|
|
179
259
|
manySnapshot: [readonly unknown[], unknown][];
|
|
180
|
-
}>, "reset" | "mutate"
|
|
260
|
+
}>, "reset" | "mutate">> | Undoable<import("@tanstack/vue-query").UseMutationReturnType<RecordOf<TResources, TName>, unknown, DeleteParams<RecordOf<TResources, TName>>, {
|
|
261
|
+
previous?: undefined;
|
|
262
|
+
key?: undefined;
|
|
263
|
+
manySnapshot?: undefined;
|
|
264
|
+
} | {
|
|
265
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
266
|
+
key: readonly [string, "getOne", {
|
|
267
|
+
id: string;
|
|
268
|
+
meta?: undefined;
|
|
269
|
+
} | {
|
|
270
|
+
id: string;
|
|
271
|
+
meta: {} | null;
|
|
272
|
+
}];
|
|
273
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
274
|
+
}, Omit<import("@tanstack/query-core").MutationObserverIdleResult<RecordOf<TResources, TName>, unknown, DeleteParams<RecordOf<TResources, TName>>, {
|
|
275
|
+
previous?: undefined;
|
|
276
|
+
key?: undefined;
|
|
277
|
+
manySnapshot?: undefined;
|
|
278
|
+
} | {
|
|
279
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
280
|
+
key: readonly [string, "getOne", {
|
|
281
|
+
id: string;
|
|
282
|
+
meta?: undefined;
|
|
283
|
+
} | {
|
|
284
|
+
id: string;
|
|
285
|
+
meta: {} | null;
|
|
286
|
+
}];
|
|
287
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
288
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverLoadingResult<RecordOf<TResources, TName>, unknown, DeleteParams<RecordOf<TResources, TName>>, {
|
|
289
|
+
previous?: undefined;
|
|
290
|
+
key?: undefined;
|
|
291
|
+
manySnapshot?: undefined;
|
|
292
|
+
} | {
|
|
293
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
294
|
+
key: readonly [string, "getOne", {
|
|
295
|
+
id: string;
|
|
296
|
+
meta?: undefined;
|
|
297
|
+
} | {
|
|
298
|
+
id: string;
|
|
299
|
+
meta: {} | null;
|
|
300
|
+
}];
|
|
301
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
302
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverErrorResult<RecordOf<TResources, TName>, unknown, DeleteParams<RecordOf<TResources, TName>>, {
|
|
303
|
+
previous?: undefined;
|
|
304
|
+
key?: undefined;
|
|
305
|
+
manySnapshot?: undefined;
|
|
306
|
+
} | {
|
|
307
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
308
|
+
key: readonly [string, "getOne", {
|
|
309
|
+
id: string;
|
|
310
|
+
meta?: undefined;
|
|
311
|
+
} | {
|
|
312
|
+
id: string;
|
|
313
|
+
meta: {} | null;
|
|
314
|
+
}];
|
|
315
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
316
|
+
}>, "reset" | "mutate"> | Omit<import("@tanstack/query-core").MutationObserverSuccessResult<RecordOf<TResources, TName>, unknown, DeleteParams<RecordOf<TResources, TName>>, {
|
|
317
|
+
previous?: undefined;
|
|
318
|
+
key?: undefined;
|
|
319
|
+
manySnapshot?: undefined;
|
|
320
|
+
} | {
|
|
321
|
+
previous: RecordOf<TResources, TName> | undefined;
|
|
322
|
+
key: readonly [string, "getOne", {
|
|
323
|
+
id: string;
|
|
324
|
+
meta?: undefined;
|
|
325
|
+
} | {
|
|
326
|
+
id: string;
|
|
327
|
+
meta: {} | null;
|
|
328
|
+
}];
|
|
329
|
+
manySnapshot: [readonly unknown[], unknown][];
|
|
330
|
+
}>, "reset" | "mutate">>, DeleteParams<RecordOf<TResources, TName>>, RecordOf<TResources, TName> | undefined>;
|
|
181
331
|
/**
|
|
182
332
|
* Delete-many mutation for `resource` — the Vue twin of the bulk delete path
|
|
183
333
|
* `@chelone/react`'s `<BulkDeleteButton>` fires against
|
|
@@ -190,7 +340,91 @@ export declare function useDelete<TResources extends ResourceMap = ResourceMap,
|
|
|
190
340
|
* `mutateAsync` for the optimistic-with-Undo flow (remove the rows now, defer the
|
|
191
341
|
* server call until the Undo window closes) via the core `startUndoableMutation`.
|
|
192
342
|
*/
|
|
193
|
-
export declare function useDeleteMany<TResources extends ResourceMap = ResourceMap, TName extends keyof TResources & string = keyof TResources & string>(resource: TName, options?: MutationModeOptions): import("
|
|
343
|
+
export declare function useDeleteMany<TResources extends ResourceMap = ResourceMap, TName extends keyof TResources & string = keyof TResources & string>(resource: TName, options?: MutationModeOptions): (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverIdleResult<Identifier[], Error, DeleteManyParams, unknown>, "reset" | "mutate">>> & {
|
|
344
|
+
mutate: (variables: DeleteManyParams, options?: import("@tanstack/query-core").MutateOptions<Identifier[], Error, DeleteManyParams, unknown> | undefined) => void;
|
|
345
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<Identifier[], Error, DeleteManyParams, unknown>;
|
|
346
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
347
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverLoadingResult<Identifier[], Error, DeleteManyParams, unknown>, "reset" | "mutate">>> & {
|
|
348
|
+
mutate: (variables: DeleteManyParams, options?: import("@tanstack/query-core").MutateOptions<Identifier[], Error, DeleteManyParams, unknown> | undefined) => void;
|
|
349
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<Identifier[], Error, DeleteManyParams, unknown>;
|
|
350
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
351
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverErrorResult<Identifier[], Error, DeleteManyParams, unknown>, "reset" | "mutate">>> & {
|
|
352
|
+
mutate: (variables: DeleteManyParams, options?: import("@tanstack/query-core").MutateOptions<Identifier[], Error, DeleteManyParams, unknown> | undefined) => void;
|
|
353
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<Identifier[], Error, DeleteManyParams, unknown>;
|
|
354
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
355
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverSuccessResult<Identifier[], Error, DeleteManyParams, unknown>, "reset" | "mutate">>> & {
|
|
356
|
+
mutate: (variables: DeleteManyParams, options?: import("@tanstack/query-core").MutateOptions<Identifier[], Error, DeleteManyParams, unknown> | undefined) => void;
|
|
357
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<Identifier[], Error, DeleteManyParams, unknown>;
|
|
358
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
359
|
+
}) | {
|
|
360
|
+
mutate: (params: DeleteManyParams, callbacks?: UndoableCallbacks<Identifier[], DeleteManyParams>) => void;
|
|
361
|
+
mutateAsync: (params: DeleteManyParams) => Promise<void>;
|
|
362
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
363
|
+
error: import("vue").Ref<null, null>;
|
|
364
|
+
status: import("vue").Ref<"idle", "idle">;
|
|
365
|
+
isError: import("vue").Ref<false, false>;
|
|
366
|
+
isPending: import("vue").Ref<false, false>;
|
|
367
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
368
|
+
failureCount: import("vue").Ref<number, number>;
|
|
369
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
370
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
371
|
+
variables: import("vue").Ref<undefined, undefined>;
|
|
372
|
+
isIdle: import("vue").Ref<true, true>;
|
|
373
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
374
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
375
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
376
|
+
} | {
|
|
377
|
+
mutate: (params: DeleteManyParams, callbacks?: UndoableCallbacks<Identifier[], DeleteManyParams>) => void;
|
|
378
|
+
mutateAsync: (params: DeleteManyParams) => Promise<void>;
|
|
379
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
380
|
+
error: import("vue").Ref<null, null>;
|
|
381
|
+
status: import("vue").Ref<"pending", "pending">;
|
|
382
|
+
isError: import("vue").Ref<false, false>;
|
|
383
|
+
isPending: import("vue").Ref<true, true>;
|
|
384
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
385
|
+
failureCount: import("vue").Ref<number, number>;
|
|
386
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
387
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
388
|
+
variables: import("vue").Ref<DeleteManyParams, DeleteManyParams>;
|
|
389
|
+
isIdle: import("vue").Ref<false, false>;
|
|
390
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
391
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
392
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
393
|
+
} | {
|
|
394
|
+
mutate: (params: DeleteManyParams, callbacks?: UndoableCallbacks<Identifier[], DeleteManyParams>) => void;
|
|
395
|
+
mutateAsync: (params: DeleteManyParams) => Promise<void>;
|
|
396
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
397
|
+
error: import("vue").Ref<Error, Error>;
|
|
398
|
+
status: import("vue").Ref<"error", "error">;
|
|
399
|
+
isError: import("vue").Ref<true, true>;
|
|
400
|
+
isPending: import("vue").Ref<false, false>;
|
|
401
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
402
|
+
failureCount: import("vue").Ref<number, number>;
|
|
403
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
404
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
405
|
+
variables: import("vue").Ref<DeleteManyParams, DeleteManyParams>;
|
|
406
|
+
isIdle: import("vue").Ref<false, false>;
|
|
407
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
408
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
409
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
410
|
+
} | {
|
|
411
|
+
mutate: (params: DeleteManyParams, callbacks?: UndoableCallbacks<Identifier[], DeleteManyParams>) => void;
|
|
412
|
+
mutateAsync: (params: DeleteManyParams) => Promise<void>;
|
|
413
|
+
data: import("vue").Ref<Identifier[], Identifier[]>;
|
|
414
|
+
error: import("vue").Ref<null, null>;
|
|
415
|
+
status: import("vue").Ref<"success", "success">;
|
|
416
|
+
isError: import("vue").Ref<false, false>;
|
|
417
|
+
isPending: import("vue").Ref<false, false>;
|
|
418
|
+
isSuccess: import("vue").Ref<true, true>;
|
|
419
|
+
failureCount: import("vue").Ref<number, number>;
|
|
420
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
421
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
422
|
+
variables: import("vue").Ref<DeleteManyParams, DeleteManyParams>;
|
|
423
|
+
isIdle: import("vue").Ref<false, false>;
|
|
424
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
425
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
426
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
427
|
+
};
|
|
194
428
|
/**
|
|
195
429
|
* Update-many mutation for `resource` — the Vue twin of the bulk update path
|
|
196
430
|
* `@chelone/react`'s `<BulkUpdateButton>` fires against
|
|
@@ -199,4 +433,89 @@ export declare function useDeleteMany<TResources extends ResourceMap = ResourceM
|
|
|
199
433
|
* invalidates the resource's caches on settle. Call `.mutateAsync({ ids, data })`
|
|
200
434
|
* to dispatch; `<BulkUpdateButton>` then clears the selection + notifies.
|
|
201
435
|
*/
|
|
202
|
-
export declare function useUpdateMany<TResources extends ResourceMap = ResourceMap, TName extends keyof TResources & string = keyof TResources & string>(resource: TName, options?: MutationModeOptions): import("
|
|
436
|
+
export declare function useUpdateMany<TResources extends ResourceMap = ResourceMap, TName extends keyof TResources & string = keyof TResources & string>(resource: TName, options?: MutationModeOptions): (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverIdleResult<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown>, "reset" | "mutate">>> & {
|
|
437
|
+
mutate: (variables: UpdateManyParams<RecordOf<TResources, TName>>, options?: import("@tanstack/query-core").MutateOptions<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown> | undefined) => void;
|
|
438
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown>;
|
|
439
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
440
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverLoadingResult<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown>, "reset" | "mutate">>> & {
|
|
441
|
+
mutate: (variables: UpdateManyParams<RecordOf<TResources, TName>>, options?: import("@tanstack/query-core").MutateOptions<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown> | undefined) => void;
|
|
442
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown>;
|
|
443
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
444
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverErrorResult<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown>, "reset" | "mutate">>> & {
|
|
445
|
+
mutate: (variables: UpdateManyParams<RecordOf<TResources, TName>>, options?: import("@tanstack/query-core").MutateOptions<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown> | undefined) => void;
|
|
446
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown>;
|
|
447
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
448
|
+
}) | (import("vue").ToRefs<Readonly<Omit<import("@tanstack/query-core").MutationObserverSuccessResult<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown>, "reset" | "mutate">>> & {
|
|
449
|
+
mutate: (variables: UpdateManyParams<RecordOf<TResources, TName>>, options?: import("@tanstack/query-core").MutateOptions<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown> | undefined) => void;
|
|
450
|
+
mutateAsync: import("@tanstack/query-core").MutateFunction<Identifier[], Error, UpdateManyParams<RecordOf<TResources, TName>>, unknown>;
|
|
451
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
452
|
+
}) | {
|
|
453
|
+
mutate: (params: UpdateManyParams<RecordOf<TResources, TName>>, callbacks?: UndoableUpdateManyCallbacks<RecordOf<TResources, TName>>) => void;
|
|
454
|
+
mutateAsync: (params: UpdateManyParams<RecordOf<TResources, TName>>) => Promise<void>;
|
|
455
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
456
|
+
error: import("vue").Ref<null, null>;
|
|
457
|
+
status: import("vue").Ref<"idle", "idle">;
|
|
458
|
+
isError: import("vue").Ref<false, false>;
|
|
459
|
+
isPending: import("vue").Ref<false, false>;
|
|
460
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
461
|
+
failureCount: import("vue").Ref<number, number>;
|
|
462
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
463
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
464
|
+
variables: import("vue").Ref<undefined, undefined>;
|
|
465
|
+
isIdle: import("vue").Ref<true, true>;
|
|
466
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
467
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
468
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
469
|
+
} | {
|
|
470
|
+
mutate: (params: UpdateManyParams<RecordOf<TResources, TName>>, callbacks?: UndoableUpdateManyCallbacks<RecordOf<TResources, TName>>) => void;
|
|
471
|
+
mutateAsync: (params: UpdateManyParams<RecordOf<TResources, TName>>) => Promise<void>;
|
|
472
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
473
|
+
error: import("vue").Ref<null, null>;
|
|
474
|
+
status: import("vue").Ref<"pending", "pending">;
|
|
475
|
+
isError: import("vue").Ref<false, false>;
|
|
476
|
+
isPending: import("vue").Ref<true, true>;
|
|
477
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
478
|
+
failureCount: import("vue").Ref<number, number>;
|
|
479
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
480
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
481
|
+
variables: import("vue").Ref<UpdateManyParams<RecordOf<TResources, TName>>, UpdateManyParams<RecordOf<TResources, TName>>>;
|
|
482
|
+
isIdle: import("vue").Ref<false, false>;
|
|
483
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
484
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
485
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
486
|
+
} | {
|
|
487
|
+
mutate: (params: UpdateManyParams<RecordOf<TResources, TName>>, callbacks?: UndoableUpdateManyCallbacks<RecordOf<TResources, TName>>) => void;
|
|
488
|
+
mutateAsync: (params: UpdateManyParams<RecordOf<TResources, TName>>) => Promise<void>;
|
|
489
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
490
|
+
error: import("vue").Ref<Error, Error>;
|
|
491
|
+
status: import("vue").Ref<"error", "error">;
|
|
492
|
+
isError: import("vue").Ref<true, true>;
|
|
493
|
+
isPending: import("vue").Ref<false, false>;
|
|
494
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
495
|
+
failureCount: import("vue").Ref<number, number>;
|
|
496
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
497
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
498
|
+
variables: import("vue").Ref<UpdateManyParams<RecordOf<TResources, TName>>, UpdateManyParams<RecordOf<TResources, TName>>>;
|
|
499
|
+
isIdle: import("vue").Ref<false, false>;
|
|
500
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
501
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
502
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
503
|
+
} | {
|
|
504
|
+
mutate: (params: UpdateManyParams<RecordOf<TResources, TName>>, callbacks?: UndoableUpdateManyCallbacks<RecordOf<TResources, TName>>) => void;
|
|
505
|
+
mutateAsync: (params: UpdateManyParams<RecordOf<TResources, TName>>) => Promise<void>;
|
|
506
|
+
data: import("vue").Ref<Identifier[], Identifier[]>;
|
|
507
|
+
error: import("vue").Ref<null, null>;
|
|
508
|
+
status: import("vue").Ref<"success", "success">;
|
|
509
|
+
isError: import("vue").Ref<false, false>;
|
|
510
|
+
isPending: import("vue").Ref<false, false>;
|
|
511
|
+
isSuccess: import("vue").Ref<true, true>;
|
|
512
|
+
failureCount: import("vue").Ref<number, number>;
|
|
513
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
514
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
515
|
+
variables: import("vue").Ref<UpdateManyParams<RecordOf<TResources, TName>>, UpdateManyParams<RecordOf<TResources, TName>>>;
|
|
516
|
+
isIdle: import("vue").Ref<false, false>;
|
|
517
|
+
context: import("vue").Ref<unknown, unknown>;
|
|
518
|
+
submittedAt: import("vue").Ref<number, number>;
|
|
519
|
+
reset: import("@tanstack/query-core").MutationObserverResult<TData, TError, TVariables, TOnMutateResult>["reset"];
|
|
520
|
+
};
|
|
521
|
+
export {};
|
package/dist/data/mutations.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { updateMutationOptions, resourceKey, createMutationOptions, deleteMutationOptions,
|
|
1
|
+
import { updateMutationOptions, resourceKey, createMutationOptions, deleteMutationOptions, undoableCallbacks, undoableUpdateOptions, patchedRecord, undoableDeleteOptions } from "@chelone/core";
|
|
2
2
|
import { useMutation } from "@tanstack/vue-query";
|
|
3
3
|
import { useCheloneContext } from "../context.js";
|
|
4
4
|
import { useUndoable } from "./undoable.js";
|
|
@@ -11,45 +11,49 @@ function useUpdate(resource, options = {}) {
|
|
|
11
11
|
const runUndoable = useUndoable();
|
|
12
12
|
const mutation = useMutation(updateMutationOptions(ctx, resource, options));
|
|
13
13
|
if (options.mutationMode !== "undoable") return mutation;
|
|
14
|
-
const mutate = (params) => {
|
|
14
|
+
const mutate = (params, callbacks) => {
|
|
15
|
+
const settle = undoableCallbacks(params, callbacks);
|
|
15
16
|
runUndoable({
|
|
16
|
-
|
|
17
|
-
applyOptimistic: () => updateRecordsInCache(
|
|
17
|
+
...undoableUpdateOptions(
|
|
18
18
|
ctx.queryClient,
|
|
19
19
|
resource,
|
|
20
20
|
[params.id],
|
|
21
21
|
params.data
|
|
22
22
|
),
|
|
23
|
-
commit: () => ctx.dataProvider.update(resource, params)
|
|
24
|
-
message: "chelone.notification.updated",
|
|
25
|
-
messageArgs: { smart_count: 1 }
|
|
23
|
+
commit: settle.commit(() => ctx.dataProvider.update(resource, params))
|
|
26
24
|
});
|
|
25
|
+
settle.success(patchedRecord(params));
|
|
27
26
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
mutate
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const undoable = {
|
|
28
|
+
...mutation,
|
|
29
|
+
mutate,
|
|
30
|
+
mutateAsync: async (params) => {
|
|
31
|
+
mutate(params);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return undoable;
|
|
33
35
|
}
|
|
34
36
|
function useDelete(resource, options = {}) {
|
|
35
37
|
const ctx = useCheloneContext();
|
|
36
38
|
const runUndoable = useUndoable();
|
|
37
39
|
const mutation = useMutation(deleteMutationOptions(ctx, resource, options));
|
|
38
40
|
if (options.mutationMode !== "undoable") return mutation;
|
|
39
|
-
const mutate = (params) => {
|
|
41
|
+
const mutate = (params, callbacks) => {
|
|
42
|
+
const settle = undoableCallbacks(params, callbacks);
|
|
40
43
|
runUndoable({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
commit: () => ctx.dataProvider.delete(resource, params),
|
|
44
|
-
message: "chelone.notification.deleted",
|
|
45
|
-
messageArgs: { smart_count: 1 }
|
|
44
|
+
...undoableDeleteOptions(ctx.queryClient, resource, [params.id]),
|
|
45
|
+
commit: settle.commit(() => ctx.dataProvider.delete(resource, params))
|
|
46
46
|
});
|
|
47
|
+
settle.success(params.previousData);
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
mutate
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const undoable = {
|
|
50
|
+
...mutation,
|
|
51
|
+
mutate,
|
|
52
|
+
mutateAsync: async (params) => {
|
|
53
|
+
mutate(params);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return undoable;
|
|
53
57
|
}
|
|
54
58
|
function useDeleteMany(resource, options = {}) {
|
|
55
59
|
const ctx = useCheloneContext();
|
|
@@ -62,20 +66,23 @@ function useDeleteMany(resource, options = {}) {
|
|
|
62
66
|
onSettled: () => ctx.queryClient.invalidateQueries({ queryKey: resourceKey(resource) })
|
|
63
67
|
});
|
|
64
68
|
if (options.mutationMode !== "undoable") return mutation;
|
|
65
|
-
const mutate = (params) => {
|
|
69
|
+
const mutate = (params, callbacks) => {
|
|
70
|
+
const settle = undoableCallbacks(params, callbacks);
|
|
66
71
|
runUndoable({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
messageArgs: { smart_count: params.ids.length }
|
|
72
|
+
...undoableDeleteOptions(ctx.queryClient, resource, params.ids),
|
|
73
|
+
commit: settle.commit(
|
|
74
|
+
() => ctx.dataProvider.deleteMany(resource, params)
|
|
75
|
+
)
|
|
72
76
|
});
|
|
77
|
+
settle.success(params.ids);
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
...mutation,
|
|
81
|
+
mutate,
|
|
82
|
+
mutateAsync: async (params) => {
|
|
83
|
+
mutate(params);
|
|
84
|
+
}
|
|
73
85
|
};
|
|
74
|
-
mutation.mutate = mutate;
|
|
75
|
-
mutation.mutateAsync = (async (params) => {
|
|
76
|
-
mutate(params);
|
|
77
|
-
});
|
|
78
|
-
return mutation;
|
|
79
86
|
}
|
|
80
87
|
function useUpdateMany(resource, options = {}) {
|
|
81
88
|
const ctx = useCheloneContext();
|
|
@@ -88,25 +95,28 @@ function useUpdateMany(resource, options = {}) {
|
|
|
88
95
|
onSettled: () => ctx.queryClient.invalidateQueries({ queryKey: resourceKey(resource) })
|
|
89
96
|
});
|
|
90
97
|
if (options.mutationMode !== "undoable") return mutation;
|
|
91
|
-
const mutate = (params) => {
|
|
98
|
+
const mutate = (params, callbacks) => {
|
|
99
|
+
const settle = undoableCallbacks(params, callbacks);
|
|
92
100
|
runUndoable({
|
|
93
|
-
|
|
94
|
-
applyOptimistic: () => updateRecordsInCache(
|
|
101
|
+
...undoableUpdateOptions(
|
|
95
102
|
ctx.queryClient,
|
|
96
103
|
resource,
|
|
97
104
|
params.ids,
|
|
98
105
|
params.data
|
|
99
106
|
),
|
|
100
|
-
commit:
|
|
101
|
-
|
|
102
|
-
|
|
107
|
+
commit: settle.commit(
|
|
108
|
+
() => ctx.dataProvider.updateMany(resource, params)
|
|
109
|
+
)
|
|
103
110
|
});
|
|
111
|
+
settle.success(params.ids);
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
...mutation,
|
|
115
|
+
mutate,
|
|
116
|
+
mutateAsync: async (params) => {
|
|
117
|
+
mutate(params);
|
|
118
|
+
}
|
|
104
119
|
};
|
|
105
|
-
mutation.mutate = mutate;
|
|
106
|
-
mutation.mutateAsync = (async (params) => {
|
|
107
|
-
mutate(params);
|
|
108
|
-
});
|
|
109
|
-
return mutation;
|
|
110
120
|
}
|
|
111
121
|
export {
|
|
112
122
|
useCreate,
|
package/dist/list/use-list.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createClientListController } from "@chelone/core";
|
|
1
|
+
import { createClientListController, listControllerActions } from "@chelone/core";
|
|
2
2
|
import { toValue, watch, reactive, computed } from "vue";
|
|
3
3
|
import { useMicroStore } from "../store/use-micro-store.js";
|
|
4
4
|
function useList(options = {}) {
|
|
@@ -40,18 +40,7 @@ function useList(options = {}) {
|
|
|
40
40
|
selectedIds: computed(() => state.value.selectedIds),
|
|
41
41
|
hasNextPage: computed(() => state.value.hasNextPage),
|
|
42
42
|
hasPreviousPage: computed(() => state.value.hasPreviousPage),
|
|
43
|
-
|
|
44
|
-
setPerPage: controller.setPerPage,
|
|
45
|
-
setSort: controller.setSort,
|
|
46
|
-
setFilters: controller.setFilters,
|
|
47
|
-
setParams: controller.setParams,
|
|
48
|
-
showFilter: controller.showFilter,
|
|
49
|
-
hideFilter: controller.hideFilter,
|
|
50
|
-
select: controller.select,
|
|
51
|
-
toggleItem: controller.toggleItem,
|
|
52
|
-
unselectAll: controller.unselectAll,
|
|
53
|
-
selectAll: controller.selectAll,
|
|
54
|
-
refetch: controller.refetch
|
|
43
|
+
...listControllerActions(controller)
|
|
55
44
|
});
|
|
56
45
|
}
|
|
57
46
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chelone/vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"cronstrue": "^3.24.0",
|
|
59
59
|
"libphonenumber-js": "^1.13.8",
|
|
60
|
-
"@chelone/core": "0.1.
|
|
60
|
+
"@chelone/core": "0.1.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@guolao/vue-monaco-editor": "^1.6.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"terra-draw-maplibre-gl-adapter": "^1.5.0",
|
|
77
77
|
"vue": "^3.4.0",
|
|
78
78
|
"vue-router": "^4.0.0",
|
|
79
|
-
"@chelone/supabase": "0.1.
|
|
79
|
+
"@chelone/supabase": "0.1.1"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"@chelone/supabase": {
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"vue-router": "^4.0.0",
|
|
151
151
|
"vue-tsc": "^2.0.0",
|
|
152
152
|
"zod": "^3.24.0",
|
|
153
|
-
"@chelone/supabase": "0.1.
|
|
153
|
+
"@chelone/supabase": "0.1.1"
|
|
154
154
|
},
|
|
155
155
|
"scripts": {
|
|
156
156
|
"build": "vite build && vue-tsc -p tsconfig.build.json && node ../../scripts/strip-dts-css-imports.mjs dist && node ../../scripts/dts-extensions.mjs dist",
|