@panneau/data 4.0.84 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -16
- package/dist/index.js +693 -402
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, UseMutationOptions, QueryClientConfig, QueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { Item, Pagination, Resource, ResourceItem } from '@panneau/core';
|
|
3
|
+
import { Item, Pagination, Resource, ResourceItem, Media } from '@panneau/core';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
@@ -295,11 +295,13 @@ declare function useItems<T = Item>(scope: string, { url, getItems, page: initia
|
|
|
295
295
|
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
296
296
|
};
|
|
297
297
|
|
|
298
|
+
type MutationOptions$2 = UseMutationOptions<unknown, Error, string | void>;
|
|
298
299
|
declare function useResourceDestroy(resource: Resource | string): any;
|
|
299
300
|
declare function useResourceDestroy(id: string | null): any;
|
|
300
301
|
declare function useResourceDestroy(resource: Resource | string, id: string | null): any;
|
|
301
|
-
declare function useResourceDestroy(
|
|
302
|
-
declare function useResourceDestroy(
|
|
302
|
+
declare function useResourceDestroy(resource: Resource | string, options: MutationOptions$2): any;
|
|
303
|
+
declare function useResourceDestroy(id: string | null, options: MutationOptions$2): any;
|
|
304
|
+
declare function useResourceDestroy(resource: Resource | string, id: string | null, options: MutationOptions$2): any;
|
|
303
305
|
|
|
304
306
|
declare function useResourceItem(id: string | null): any;
|
|
305
307
|
declare function useResourceItem(id: string | null, opts: any): any;
|
|
@@ -325,17 +327,21 @@ declare function useResourceUpdate(resource: Resource | string, id: string, opti
|
|
|
325
327
|
declare function useResourceUpdate(id: string): any;
|
|
326
328
|
declare function useResourceUpdate(id: string, options: UseMutationOptions): any;
|
|
327
329
|
|
|
330
|
+
type MutationOptions$1 = UseMutationOptions<unknown, Error, string | void>;
|
|
328
331
|
declare function useResourceClone(resource: Resource | string): any;
|
|
329
332
|
declare function useResourceClone(id: string | null): any;
|
|
330
333
|
declare function useResourceClone(resource: Resource | string, id: string | null): any;
|
|
331
|
-
declare function useResourceClone(
|
|
332
|
-
declare function useResourceClone(
|
|
334
|
+
declare function useResourceClone(resource: Resource | string, options: MutationOptions$1): any;
|
|
335
|
+
declare function useResourceClone(id: string | null, options: MutationOptions$1): any;
|
|
336
|
+
declare function useResourceClone(resource: Resource | string, id: string | null, options: MutationOptions$1): any;
|
|
333
337
|
|
|
338
|
+
type MutationOptions = UseMutationOptions<unknown, Error, string | void>;
|
|
334
339
|
declare function useResourceRestore(resource: Resource | string): any;
|
|
335
340
|
declare function useResourceRestore(id: string | null): any;
|
|
336
341
|
declare function useResourceRestore(resource: Resource | string, id: string | null): any;
|
|
337
|
-
declare function useResourceRestore(
|
|
338
|
-
declare function useResourceRestore(
|
|
342
|
+
declare function useResourceRestore(resource: Resource | string, options: MutationOptions): any;
|
|
343
|
+
declare function useResourceRestore(id: string | null, options: MutationOptions): any;
|
|
344
|
+
declare function useResourceRestore(resource: Resource | string, id: string | null, options: MutationOptions): any;
|
|
339
345
|
|
|
340
346
|
interface ApiOptions {
|
|
341
347
|
baseUrl?: string | null;
|
|
@@ -352,8 +358,8 @@ declare class Base {
|
|
|
352
358
|
requestPatch<T = unknown>(path: string, data: Record<string, unknown>, opts?: Record<string, unknown> | null): Promise<T | null>;
|
|
353
359
|
requestDelete<T = unknown>(path: string, opts?: Record<string, unknown> | null): Promise<T | null>;
|
|
354
360
|
hasRoute(route: string): boolean;
|
|
355
|
-
route(route: string, params?: Record<string, unknown> | null): string;
|
|
356
|
-
getFullUrl(path: string, query?: Record<string, unknown> | null): string;
|
|
361
|
+
route(route: string, params?: Record<string, unknown> | null): string | null;
|
|
362
|
+
getFullUrl(path: string | null, query?: Record<string, unknown> | null): string;
|
|
357
363
|
onError(err: any): void;
|
|
358
364
|
}
|
|
359
365
|
|
|
@@ -376,16 +382,16 @@ declare class AuthApi extends Base {
|
|
|
376
382
|
|
|
377
383
|
declare class MediasApi extends Base {
|
|
378
384
|
constructor(opts: any);
|
|
379
|
-
find(id:
|
|
380
|
-
get(query?: Record<string, unknown>, page?: number | null, count?: number | null): Promise<
|
|
381
|
-
getTrashed(query?: Record<string, unknown>, page?: number | null, count?: number | null): Promise<
|
|
385
|
+
find(id: string): Promise<Media>;
|
|
386
|
+
get(query?: Record<string, unknown>, page?: number | null, count?: number | null): Promise<UseItemsResponse<Media>>;
|
|
387
|
+
getTrashed(query?: Record<string, unknown>, page?: number | null, count?: number | null): Promise<UseItemsResponse<Media>>;
|
|
382
388
|
getTags(query?: Record<string, unknown>, count?: number | null): Promise<unknown>;
|
|
383
|
-
create(data: Record<string, unknown>): Promise<
|
|
384
|
-
update(id: string, data: Record<string, unknown>): Promise<
|
|
389
|
+
create(data: Record<string, unknown>): Promise<Media>;
|
|
390
|
+
update(id: string, data: Record<string, unknown>): Promise<Media>;
|
|
385
391
|
trash(id: string): Promise<unknown>;
|
|
386
|
-
restore(id: string): Promise<
|
|
392
|
+
restore(id: string): Promise<Media>;
|
|
387
393
|
destroy(id: string): Promise<unknown>;
|
|
388
|
-
replace(id: string, data: Record<string, unknown>): Promise<
|
|
394
|
+
replace(id: string, data: Record<string, unknown>): Promise<Media>;
|
|
389
395
|
}
|
|
390
396
|
|
|
391
397
|
type ItemsResponse<T> = {
|