@gettersethya/mira-tanstack-adapter 0.1.0-alpha.21 → 0.1.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -160
- package/dist/_core.d.ts +53 -199
- package/dist/_core.d.ts.map +1 -1
- package/dist/_core.js +78 -83
- package/dist/_core.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -34
- package/dist/react.d.ts +0 -173
- package/dist/react.d.ts.map +0 -1
- package/dist/react.js +0 -34
- package/dist/react.js.map +0 -1
- package/dist/solid.d.ts +0 -180
- package/dist/solid.d.ts.map +0 -1
- package/dist/solid.js +0 -41
- package/dist/solid.js.map +0 -1
- package/dist/svelte.d.ts +0 -161
- package/dist/svelte.d.ts.map +0 -1
- package/dist/svelte.js +0 -50
- package/dist/svelte.js.map +0 -1
package/dist/solid.d.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { ActionKeys } from "./_core.js";
|
|
2
|
-
/**
|
|
3
|
-
* A pre-built {@link createCollectionAdapter | collection adapter} for **TanStack Solid Query**.
|
|
4
|
-
*
|
|
5
|
-
* Uses `queryOptions` and `mutationOptions` from `@tanstack/solid-query` to produce
|
|
6
|
-
* options objects compatible with `createQuery` and `createMutation`.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```tsx
|
|
10
|
-
* import { createQuery, createMutation, useQueryClient } from "@tanstack/solid-query"
|
|
11
|
-
* import { collectionAdapter } from "@gettersethya/mira-tanstack-adapter/solid"
|
|
12
|
-
* import { createMiraClient } from "@gettersethya/mira-client"
|
|
13
|
-
* import { PostCollection } from "../collections"
|
|
14
|
-
*
|
|
15
|
-
* const client = createMiraClient({ url: "/api" }).withCollections({ posts: PostCollection })
|
|
16
|
-
* const api = collectionAdapter(client, "posts")
|
|
17
|
-
* const queryClient = useQueryClient()
|
|
18
|
-
*
|
|
19
|
-
* function PostList() {
|
|
20
|
-
* const query = createQuery(() => api.getList({ limit: 10 }).queryOptions)
|
|
21
|
-
*
|
|
22
|
-
* const mutation = createMutation(() => ({
|
|
23
|
-
* ...api.create().mutationOptions,
|
|
24
|
-
* onSuccess: () => api.invalidateAll(queryClient),
|
|
25
|
-
* }))
|
|
26
|
-
*
|
|
27
|
-
* return (
|
|
28
|
-
* <div>
|
|
29
|
-
* <Show when={query.isLoading}><p>Loading...</p></Show>
|
|
30
|
-
* <Show when={query.data}>
|
|
31
|
-
* <ul>{query.data!.items.map(p => <li>{p.title}</li>)}</ul>
|
|
32
|
-
* </Show>
|
|
33
|
-
* </div>
|
|
34
|
-
* )
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare const collectionAdapter: <F extends import("@gettersethya/mira-collection").FieldsMap>(client: import("@gettersethya/mira-client").CollectionClient<F>, name: string) => {
|
|
39
|
-
invalidateAll: (queryClient: {
|
|
40
|
-
invalidateQueries(opts: {
|
|
41
|
-
queryKey: import("./_core.js").QueryKey;
|
|
42
|
-
}): unknown;
|
|
43
|
-
}) => unknown;
|
|
44
|
-
invalidateOne: (queryClient: {
|
|
45
|
-
invalidateQueries(opts: {
|
|
46
|
-
queryKey: import("./_core.js").QueryKey;
|
|
47
|
-
}): unknown;
|
|
48
|
-
}, id: string) => unknown;
|
|
49
|
-
register?: (() => import("@gettersethya/mira-client").ClientHandler<import("@gettersethya/mira-collection").InferRecord<F>, import("@gettersethya/mira-collection").RegisterInput<F>>) | undefined;
|
|
50
|
-
getList: (options?: {
|
|
51
|
-
filter?: ((f: import("@gettersethya/mira-client").FilterBuilder<F>) => import("@gettersethya/mira-collection").FilterNode) | undefined;
|
|
52
|
-
sort?: (keyof F & string) | undefined;
|
|
53
|
-
order?: "asc" | "desc";
|
|
54
|
-
cursor?: number | null;
|
|
55
|
-
limit?: number;
|
|
56
|
-
select?: readonly (keyof F & string)[] | undefined;
|
|
57
|
-
expand?: readonly import("@gettersethya/mira-collection").RelationKeys<F>[] | undefined;
|
|
58
|
-
retryOptions?: import("@gettersethya/mira-client").RetryOptions;
|
|
59
|
-
} | undefined) => {
|
|
60
|
-
raw(): Promise<{
|
|
61
|
-
items: import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>[];
|
|
62
|
-
nextCursor: number | null;
|
|
63
|
-
}>;
|
|
64
|
-
toEffect(): import("effect/Effect").Effect<{
|
|
65
|
-
items: import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>[];
|
|
66
|
-
nextCursor: number | null;
|
|
67
|
-
}, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
68
|
-
} & {
|
|
69
|
-
queryKey: import("./_core.js").QueryKey;
|
|
70
|
-
queryOptions: import("@tanstack/solid-query").QueryOptions<unknown, unknown, unknown, readonly unknown[]> & {
|
|
71
|
-
initialData: unknown;
|
|
72
|
-
} & {
|
|
73
|
-
queryKey: readonly unknown[] & {
|
|
74
|
-
[dataTagSymbol]: unknown;
|
|
75
|
-
[dataTagErrorSymbol]: unknown;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
getOne: (id: string, options?: {
|
|
80
|
-
select?: readonly (keyof F & string)[] | undefined;
|
|
81
|
-
expand?: readonly import("@gettersethya/mira-collection").RelationKeys<F>[] | undefined;
|
|
82
|
-
retryOptions?: import("@gettersethya/mira-client").RetryOptions;
|
|
83
|
-
} | undefined) => {
|
|
84
|
-
raw(): Promise<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>>;
|
|
85
|
-
toEffect(): import("effect/Effect").Effect<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
86
|
-
} & {
|
|
87
|
-
queryKey: import("./_core.js").QueryKey;
|
|
88
|
-
queryOptions: import("@tanstack/solid-query").QueryOptions<unknown, unknown, unknown, readonly unknown[]> & {
|
|
89
|
-
initialData: unknown;
|
|
90
|
-
} & {
|
|
91
|
-
queryKey: readonly unknown[] & {
|
|
92
|
-
[dataTagSymbol]: unknown;
|
|
93
|
-
[dataTagErrorSymbol]: unknown;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
getFirstOrNone: (filter: (f: import("@gettersethya/mira-client").FilterBuilder<F>) => import("@gettersethya/mira-collection").FilterNode, options?: Omit<{
|
|
98
|
-
filter?: ((f: import("@gettersethya/mira-client").FilterBuilder<F>) => import("@gettersethya/mira-collection").FilterNode) | undefined;
|
|
99
|
-
sort?: (keyof F & string) | undefined;
|
|
100
|
-
order?: "asc" | "desc";
|
|
101
|
-
cursor?: number | null;
|
|
102
|
-
limit?: number;
|
|
103
|
-
select?: readonly (keyof F & string)[] | undefined;
|
|
104
|
-
expand?: readonly import("@gettersethya/mira-collection").RelationKeys<F>[] | undefined;
|
|
105
|
-
retryOptions?: import("@gettersethya/mira-client").RetryOptions;
|
|
106
|
-
}, "filter" | "limit" | "cursor"> | undefined) => {
|
|
107
|
-
raw(): Promise<import("effect/Option").Option<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>>>;
|
|
108
|
-
toEffect(): import("effect/Effect").Effect<import("effect/Option").Option<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>>, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
109
|
-
} & {
|
|
110
|
-
queryKey: import("./_core.js").QueryKey;
|
|
111
|
-
queryOptions: import("@tanstack/solid-query").QueryOptions<unknown, unknown, unknown, readonly unknown[]> & {
|
|
112
|
-
initialData: unknown;
|
|
113
|
-
} & {
|
|
114
|
-
queryKey: readonly unknown[] & {
|
|
115
|
-
[dataTagSymbol]: unknown;
|
|
116
|
-
[dataTagErrorSymbol]: unknown;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
getFullList: (options?: (Omit<{
|
|
121
|
-
filter?: ((f: import("@gettersethya/mira-client").FilterBuilder<F>) => import("@gettersethya/mira-collection").FilterNode) | undefined;
|
|
122
|
-
sort?: (keyof F & string) | undefined;
|
|
123
|
-
order?: "asc" | "desc";
|
|
124
|
-
cursor?: number | null;
|
|
125
|
-
limit?: number;
|
|
126
|
-
select?: readonly (keyof F & string)[] | undefined;
|
|
127
|
-
expand?: readonly import("@gettersethya/mira-collection").RelationKeys<F>[] | undefined;
|
|
128
|
-
retryOptions?: import("@gettersethya/mira-client").RetryOptions;
|
|
129
|
-
}, "limit" | "cursor"> & {
|
|
130
|
-
limit?: number;
|
|
131
|
-
}) | undefined) => {
|
|
132
|
-
raw(): Promise<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>[]>;
|
|
133
|
-
toEffect(): import("effect/Effect").Effect<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>[], import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
134
|
-
} & {
|
|
135
|
-
queryKey: import("./_core.js").QueryKey;
|
|
136
|
-
queryOptions: import("@tanstack/solid-query").QueryOptions<unknown, unknown, unknown, readonly unknown[]> & {
|
|
137
|
-
initialData: unknown;
|
|
138
|
-
} & {
|
|
139
|
-
queryKey: readonly unknown[] & {
|
|
140
|
-
[dataTagSymbol]: unknown;
|
|
141
|
-
[dataTagErrorSymbol]: unknown;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
create: () => import("@gettersethya/mira-client").ClientHandler<import("@gettersethya/mira-collection").InferRecord<F>, Omit<import("@gettersethya/mira-collection").InferMutationInput<F>, "emailVerified">> & {
|
|
146
|
-
mutationOptions: Omit<import("@tanstack/solid-query").MutationOptions<unknown, unknown, unknown, unknown>, "mutationKey">;
|
|
147
|
-
};
|
|
148
|
-
update: () => {
|
|
149
|
-
raw(input: import("@gettersethya/mira-collection").UpdateInput<F, "base">): Promise<import("@gettersethya/mira-collection").InferRecord<F>>;
|
|
150
|
-
toEffect(input: import("@gettersethya/mira-collection").UpdateInput<F, "base">): import("effect/Effect").Effect<import("@gettersethya/mira-collection").InferRecord<F>, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
151
|
-
} & {
|
|
152
|
-
mutationOptions: Omit<import("@tanstack/solid-query").MutationOptions<unknown, unknown, unknown, unknown>, "mutationKey">;
|
|
153
|
-
};
|
|
154
|
-
delete: () => {
|
|
155
|
-
raw(input: string): Promise<void>;
|
|
156
|
-
toEffect(input: string): import("effect/Effect").Effect<void, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
157
|
-
} & {
|
|
158
|
-
mutationOptions: Omit<import("@tanstack/solid-query").MutationOptions<unknown, unknown, unknown, unknown>, "mutationKey">;
|
|
159
|
-
};
|
|
160
|
-
authWithPassword?(): {
|
|
161
|
-
raw(input: {
|
|
162
|
-
email: string;
|
|
163
|
-
password: string;
|
|
164
|
-
}): Promise<{
|
|
165
|
-
token: string;
|
|
166
|
-
record: import("@gettersethya/mira-collection").InferRecord<F>;
|
|
167
|
-
}>;
|
|
168
|
-
toEffect(input: {
|
|
169
|
-
email: string;
|
|
170
|
-
password: string;
|
|
171
|
-
}): import("effect/Effect").Effect<{
|
|
172
|
-
token: string;
|
|
173
|
-
record: import("@gettersethya/mira-collection").InferRecord<F>;
|
|
174
|
-
}, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
175
|
-
};
|
|
176
|
-
fields: import("@gettersethya/mira-client").CollectionFileFields<F>;
|
|
177
|
-
};
|
|
178
|
-
export { ActionKeys };
|
|
179
|
-
export type { ActionKey } from "./_core.js";
|
|
180
|
-
//# sourceMappingURL=solid.d.ts.map
|
package/dist/solid.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solid.d.ts","sourceRoot":"","sources":["../src/solid.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,UAAU,EAAE,MAAM,YAAY,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAyD,CAAA;AACvF,OAAO,EAAE,UAAU,EAAE,CAAA;AACrB,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/solid.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { mutationOptions, queryOptions } from "@tanstack/solid-query";
|
|
2
|
-
import { createCollectionAdapter, ActionKeys } from "./_core.js";
|
|
3
|
-
/**
|
|
4
|
-
* A pre-built {@link createCollectionAdapter | collection adapter} for **TanStack Solid Query**.
|
|
5
|
-
*
|
|
6
|
-
* Uses `queryOptions` and `mutationOptions` from `@tanstack/solid-query` to produce
|
|
7
|
-
* options objects compatible with `createQuery` and `createMutation`.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import { createQuery, createMutation, useQueryClient } from "@tanstack/solid-query"
|
|
12
|
-
* import { collectionAdapter } from "@gettersethya/mira-tanstack-adapter/solid"
|
|
13
|
-
* import { createMiraClient } from "@gettersethya/mira-client"
|
|
14
|
-
* import { PostCollection } from "../collections"
|
|
15
|
-
*
|
|
16
|
-
* const client = createMiraClient({ url: "/api" }).withCollections({ posts: PostCollection })
|
|
17
|
-
* const api = collectionAdapter(client, "posts")
|
|
18
|
-
* const queryClient = useQueryClient()
|
|
19
|
-
*
|
|
20
|
-
* function PostList() {
|
|
21
|
-
* const query = createQuery(() => api.getList({ limit: 10 }).queryOptions)
|
|
22
|
-
*
|
|
23
|
-
* const mutation = createMutation(() => ({
|
|
24
|
-
* ...api.create().mutationOptions,
|
|
25
|
-
* onSuccess: () => api.invalidateAll(queryClient),
|
|
26
|
-
* }))
|
|
27
|
-
*
|
|
28
|
-
* return (
|
|
29
|
-
* <div>
|
|
30
|
-
* <Show when={query.isLoading}><p>Loading...</p></Show>
|
|
31
|
-
* <Show when={query.data}>
|
|
32
|
-
* <ul>{query.data!.items.map(p => <li>{p.title}</li>)}</ul>
|
|
33
|
-
* </Show>
|
|
34
|
-
* </div>
|
|
35
|
-
* )
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export const collectionAdapter = createCollectionAdapter(queryOptions, mutationOptions);
|
|
40
|
-
export { ActionKeys };
|
|
41
|
-
//# sourceMappingURL=solid.js.map
|
package/dist/solid.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solid.js","sourceRoot":"","sources":["../src/solid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAA;AACvF,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
package/dist/svelte.d.ts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { ActionKeys } from "./_core.js";
|
|
2
|
-
import type { MakeMutationOptions, MakeQueryOptions } from "./_core.js";
|
|
3
|
-
/**
|
|
4
|
-
* Creates a {@link createCollectionAdapter | collection adapter} for **TanStack Svelte Query**.
|
|
5
|
-
*
|
|
6
|
-
* Unlike the React and Solid entries, this entry cannot ship a pre-built adapter:
|
|
7
|
-
* `@tanstack/svelte-query` v6 brands its option objects with a `unique symbol`
|
|
8
|
-
* that is not exported from the package, so any pre-built value re-exposed here
|
|
9
|
-
* fails declaration emit (`TS2527`). Accepting the factories as arguments keeps
|
|
10
|
-
* this entry emit-safe: inference happens in the consumer's project, where the
|
|
11
|
-
* branded types resolve in memory.
|
|
12
|
-
*
|
|
13
|
-
* Uses `queryOptions` and `mutationOptions` from `@tanstack/svelte-query` to produce
|
|
14
|
-
* options objects compatible with `createQuery` and `createMutation`.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```svelte
|
|
18
|
-
* <script lang="ts">
|
|
19
|
-
* import { createQuery, createMutation, getQueryClient, mutationOptions, queryOptions } from "@tanstack/svelte-query"
|
|
20
|
-
* import { createSvelteCollectionAdapter } from "@gettersethya/mira-tanstack-adapter/svelte"
|
|
21
|
-
* import { createMiraClient } from "@gettersethya/mira-client"
|
|
22
|
-
* import { PostCollection } from "../collections"
|
|
23
|
-
*
|
|
24
|
-
* const client = createMiraClient({ url: "/api" }).withCollections({ posts: PostCollection })
|
|
25
|
-
* const collectionAdapter = createSvelteCollectionAdapter(queryOptions, mutationOptions)
|
|
26
|
-
* const api = collectionAdapter(client, "posts")
|
|
27
|
-
*
|
|
28
|
-
* const query = createQuery(() => api.getList({ limit: 10 }).queryOptions)
|
|
29
|
-
* const queryClient = getQueryClient()
|
|
30
|
-
*
|
|
31
|
-
* async function handleCreate() {
|
|
32
|
-
* const mutation = createMutation(() => ({
|
|
33
|
-
* ...api.create().mutationOptions,
|
|
34
|
-
* onSuccess: () => api.invalidateAll(queryClient),
|
|
35
|
-
* }))
|
|
36
|
-
* $mutation.mutate({ title: "New Post" })
|
|
37
|
-
* }
|
|
38
|
-
* </script>
|
|
39
|
-
*
|
|
40
|
-
* {#if $query.isLoading}
|
|
41
|
-
* <p>Loading...</p>
|
|
42
|
-
* {:else}
|
|
43
|
-
* <ul>{#each $query.data?.items ?? [] as post}<li>{post.title}</li>{/each}</ul>
|
|
44
|
-
* {/if}
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export declare function createSvelteCollectionAdapter<FQ extends MakeQueryOptions, FM extends MakeMutationOptions>(makeQueryOptions: FQ, makeMutationOptions: FM): <F extends import("@gettersethya/mira-collection").FieldsMap>(client: import("@gettersethya/mira-client").CollectionClient<F>, name: string) => {
|
|
48
|
-
invalidateAll: (queryClient: {
|
|
49
|
-
invalidateQueries(opts: {
|
|
50
|
-
queryKey: import("./_core.js").QueryKey;
|
|
51
|
-
}): unknown;
|
|
52
|
-
}) => unknown;
|
|
53
|
-
invalidateOne: (queryClient: {
|
|
54
|
-
invalidateQueries(opts: {
|
|
55
|
-
queryKey: import("./_core.js").QueryKey;
|
|
56
|
-
}): unknown;
|
|
57
|
-
}, id: string) => unknown;
|
|
58
|
-
register?: (() => import("@gettersethya/mira-client").ClientHandler<import("@gettersethya/mira-collection").InferRecord<F>, import("@gettersethya/mira-collection").RegisterInput<F>>) | undefined;
|
|
59
|
-
getList: (options?: {
|
|
60
|
-
filter?: ((f: import("@gettersethya/mira-client").FilterBuilder<F>) => import("@gettersethya/mira-collection").FilterNode) | undefined;
|
|
61
|
-
sort?: (keyof F & string) | undefined;
|
|
62
|
-
order?: "asc" | "desc";
|
|
63
|
-
cursor?: number | null;
|
|
64
|
-
limit?: number;
|
|
65
|
-
select?: readonly (keyof F & string)[] | undefined;
|
|
66
|
-
expand?: readonly import("@gettersethya/mira-collection").RelationKeys<F>[] | undefined;
|
|
67
|
-
retryOptions?: import("@gettersethya/mira-client").RetryOptions;
|
|
68
|
-
} | undefined) => {
|
|
69
|
-
raw(): Promise<{
|
|
70
|
-
items: import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>[];
|
|
71
|
-
nextCursor: number | null;
|
|
72
|
-
}>;
|
|
73
|
-
toEffect(): import("effect/Effect").Effect<{
|
|
74
|
-
items: import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>[];
|
|
75
|
-
nextCursor: number | null;
|
|
76
|
-
}, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
77
|
-
} & {
|
|
78
|
-
queryKey: import("./_core.js").QueryKey;
|
|
79
|
-
queryOptions: ReturnType<FQ>;
|
|
80
|
-
};
|
|
81
|
-
getOne: (id: string, options?: {
|
|
82
|
-
select?: readonly (keyof F & string)[] | undefined;
|
|
83
|
-
expand?: readonly import("@gettersethya/mira-collection").RelationKeys<F>[] | undefined;
|
|
84
|
-
retryOptions?: import("@gettersethya/mira-client").RetryOptions;
|
|
85
|
-
} | undefined) => {
|
|
86
|
-
raw(): Promise<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>>;
|
|
87
|
-
toEffect(): import("effect/Effect").Effect<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
88
|
-
} & {
|
|
89
|
-
queryKey: import("./_core.js").QueryKey;
|
|
90
|
-
queryOptions: ReturnType<FQ>;
|
|
91
|
-
};
|
|
92
|
-
getFirstOrNone: (filter: (f: import("@gettersethya/mira-client").FilterBuilder<F>) => import("@gettersethya/mira-collection").FilterNode, options?: Omit<{
|
|
93
|
-
filter?: ((f: import("@gettersethya/mira-client").FilterBuilder<F>) => import("@gettersethya/mira-collection").FilterNode) | undefined;
|
|
94
|
-
sort?: (keyof F & string) | undefined;
|
|
95
|
-
order?: "asc" | "desc";
|
|
96
|
-
cursor?: number | null;
|
|
97
|
-
limit?: number;
|
|
98
|
-
select?: readonly (keyof F & string)[] | undefined;
|
|
99
|
-
expand?: readonly import("@gettersethya/mira-collection").RelationKeys<F>[] | undefined;
|
|
100
|
-
retryOptions?: import("@gettersethya/mira-client").RetryOptions;
|
|
101
|
-
}, "filter" | "limit" | "cursor"> | undefined) => {
|
|
102
|
-
raw(): Promise<import("effect/Option").Option<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>>>;
|
|
103
|
-
toEffect(): import("effect/Effect").Effect<import("effect/Option").Option<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>>, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
104
|
-
} & {
|
|
105
|
-
queryKey: import("./_core.js").QueryKey;
|
|
106
|
-
queryOptions: ReturnType<FQ>;
|
|
107
|
-
};
|
|
108
|
-
getFullList: (options?: (Omit<{
|
|
109
|
-
filter?: ((f: import("@gettersethya/mira-client").FilterBuilder<F>) => import("@gettersethya/mira-collection").FilterNode) | undefined;
|
|
110
|
-
sort?: (keyof F & string) | undefined;
|
|
111
|
-
order?: "asc" | "desc";
|
|
112
|
-
cursor?: number | null;
|
|
113
|
-
limit?: number;
|
|
114
|
-
select?: readonly (keyof F & string)[] | undefined;
|
|
115
|
-
expand?: readonly import("@gettersethya/mira-collection").RelationKeys<F>[] | undefined;
|
|
116
|
-
retryOptions?: import("@gettersethya/mira-client").RetryOptions;
|
|
117
|
-
}, "limit" | "cursor"> & {
|
|
118
|
-
limit?: number;
|
|
119
|
-
}) | undefined) => {
|
|
120
|
-
raw(): Promise<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>[]>;
|
|
121
|
-
toEffect(): import("effect/Effect").Effect<import("@gettersethya/mira-collection").WithExpand<F, readonly import("@gettersethya/mira-collection").RelationKeys<F>[]>[], import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
122
|
-
} & {
|
|
123
|
-
queryKey: import("./_core.js").QueryKey;
|
|
124
|
-
queryOptions: ReturnType<FQ>;
|
|
125
|
-
};
|
|
126
|
-
create: () => import("@gettersethya/mira-client").ClientHandler<import("@gettersethya/mira-collection").InferRecord<F>, Omit<import("@gettersethya/mira-collection").InferMutationInput<F>, "emailVerified">> & {
|
|
127
|
-
mutationOptions: ReturnType<FM>;
|
|
128
|
-
};
|
|
129
|
-
update: () => {
|
|
130
|
-
raw(input: import("@gettersethya/mira-collection").UpdateInput<F, "base">): Promise<import("@gettersethya/mira-collection").InferRecord<F>>;
|
|
131
|
-
toEffect(input: import("@gettersethya/mira-collection").UpdateInput<F, "base">): import("effect/Effect").Effect<import("@gettersethya/mira-collection").InferRecord<F>, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
132
|
-
} & {
|
|
133
|
-
mutationOptions: ReturnType<FM>;
|
|
134
|
-
};
|
|
135
|
-
delete: () => {
|
|
136
|
-
raw(input: string): Promise<void>;
|
|
137
|
-
toEffect(input: string): import("effect/Effect").Effect<void, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
138
|
-
} & {
|
|
139
|
-
mutationOptions: ReturnType<FM>;
|
|
140
|
-
};
|
|
141
|
-
authWithPassword?(): {
|
|
142
|
-
raw(input: {
|
|
143
|
-
email: string;
|
|
144
|
-
password: string;
|
|
145
|
-
}): Promise<{
|
|
146
|
-
token: string;
|
|
147
|
-
record: import("@gettersethya/mira-collection").InferRecord<F>;
|
|
148
|
-
}>;
|
|
149
|
-
toEffect(input: {
|
|
150
|
-
email: string;
|
|
151
|
-
password: string;
|
|
152
|
-
}): import("effect/Effect").Effect<{
|
|
153
|
-
token: string;
|
|
154
|
-
record: import("@gettersethya/mira-collection").InferRecord<F>;
|
|
155
|
-
}, import("@gettersethya/mira-client").MiraError, import("effect/http/HttpClient").HttpClient>;
|
|
156
|
-
};
|
|
157
|
-
fields: import("@gettersethya/mira-client").CollectionFileFields<F>;
|
|
158
|
-
};
|
|
159
|
-
export { ActionKeys };
|
|
160
|
-
export type { ActionKey } from "./_core.js";
|
|
161
|
-
//# sourceMappingURL=svelte.d.ts.map
|
package/dist/svelte.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svelte.d.ts","sourceRoot":"","sources":["../src/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,UAAU,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,6BAA6B,CAAC,EAAE,SAAS,gBAAgB,EAAE,EAAE,SAAS,mBAAmB,EACvG,gBAAgB,EAAE,EAAE,EACpB,mBAAmB,EAAE,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGxB;AACD,OAAO,EAAE,UAAU,EAAE,CAAA;AACrB,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/svelte.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createCollectionAdapter, ActionKeys } from "./_core.js";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a {@link createCollectionAdapter | collection adapter} for **TanStack Svelte Query**.
|
|
4
|
-
*
|
|
5
|
-
* Unlike the React and Solid entries, this entry cannot ship a pre-built adapter:
|
|
6
|
-
* `@tanstack/svelte-query` v6 brands its option objects with a `unique symbol`
|
|
7
|
-
* that is not exported from the package, so any pre-built value re-exposed here
|
|
8
|
-
* fails declaration emit (`TS2527`). Accepting the factories as arguments keeps
|
|
9
|
-
* this entry emit-safe: inference happens in the consumer's project, where the
|
|
10
|
-
* branded types resolve in memory.
|
|
11
|
-
*
|
|
12
|
-
* Uses `queryOptions` and `mutationOptions` from `@tanstack/svelte-query` to produce
|
|
13
|
-
* options objects compatible with `createQuery` and `createMutation`.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```svelte
|
|
17
|
-
* <script lang="ts">
|
|
18
|
-
* import { createQuery, createMutation, getQueryClient, mutationOptions, queryOptions } from "@tanstack/svelte-query"
|
|
19
|
-
* import { createSvelteCollectionAdapter } from "@gettersethya/mira-tanstack-adapter/svelte"
|
|
20
|
-
* import { createMiraClient } from "@gettersethya/mira-client"
|
|
21
|
-
* import { PostCollection } from "../collections"
|
|
22
|
-
*
|
|
23
|
-
* const client = createMiraClient({ url: "/api" }).withCollections({ posts: PostCollection })
|
|
24
|
-
* const collectionAdapter = createSvelteCollectionAdapter(queryOptions, mutationOptions)
|
|
25
|
-
* const api = collectionAdapter(client, "posts")
|
|
26
|
-
*
|
|
27
|
-
* const query = createQuery(() => api.getList({ limit: 10 }).queryOptions)
|
|
28
|
-
* const queryClient = getQueryClient()
|
|
29
|
-
*
|
|
30
|
-
* async function handleCreate() {
|
|
31
|
-
* const mutation = createMutation(() => ({
|
|
32
|
-
* ...api.create().mutationOptions,
|
|
33
|
-
* onSuccess: () => api.invalidateAll(queryClient),
|
|
34
|
-
* }))
|
|
35
|
-
* $mutation.mutate({ title: "New Post" })
|
|
36
|
-
* }
|
|
37
|
-
* </script>
|
|
38
|
-
*
|
|
39
|
-
* {#if $query.isLoading}
|
|
40
|
-
* <p>Loading...</p>
|
|
41
|
-
* {:else}
|
|
42
|
-
* <ul>{#each $query.data?.items ?? [] as post}<li>{post.title}</li>{/each}</ul>
|
|
43
|
-
* {/if}
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export function createSvelteCollectionAdapter(makeQueryOptions, makeMutationOptions) {
|
|
47
|
-
return createCollectionAdapter(makeQueryOptions, makeMutationOptions);
|
|
48
|
-
}
|
|
49
|
-
export { ActionKeys };
|
|
50
|
-
//# sourceMappingURL=svelte.js.map
|
package/dist/svelte.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svelte.js","sourceRoot":"","sources":["../src/svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,UAAU,6BAA6B,CAC3C,gBAAoB,EACpB,mBAAuB;IAEvB,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAA;AACvE,CAAC;AACD,OAAO,EAAE,UAAU,EAAE,CAAA"}
|