@htkimura/files-storage-backend.rest-client 0.0.26 → 0.0.27

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.
@@ -13,5 +13,6 @@ export interface File {
13
13
  type: string;
14
14
  size: number;
15
15
  path: string;
16
+ thumbnailPath?: string;
16
17
  userId: string;
17
18
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by orval v7.4.1 🍺
3
+ * Do not edit manually.
4
+ * files-storage
5
+ * This API is for storing files for different users
6
+ * OpenAPI spec version: 1.0
7
+ */
8
+ export interface FileFilters {
9
+ [key: string]: unknown;
10
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v7.4.1 🍺
3
+ * Do not edit manually.
4
+ * files-storage
5
+ * This API is for storing files for different users
6
+ * OpenAPI spec version: 1.0
7
+ */
8
+ export {};
@@ -13,6 +13,7 @@ export interface FileWithPresignedUrl {
13
13
  type: string;
14
14
  size: number;
15
15
  path: string;
16
+ thumbnailPath?: string;
16
17
  userId: string;
17
18
  presignedUrl: string;
18
19
  }
@@ -9,6 +9,7 @@ export * from './createUserDto';
9
9
  export * from './deleteBulkFilesByIdsParams';
10
10
  export * from './deleteBulkFilesOutput';
11
11
  export * from './file';
12
+ export * from './fileFilters';
12
13
  export * from './fileWithPresignedUrl';
13
14
  export * from './getBulkFilesByIdsParams';
14
15
  export * from './getPresignedUploadUrlParams';
@@ -9,6 +9,7 @@ export * from './createUserDto';
9
9
  export * from './deleteBulkFilesByIdsParams';
10
10
  export * from './deleteBulkFilesOutput';
11
11
  export * from './file';
12
+ export * from './fileFilters';
12
13
  export * from './fileWithPresignedUrl';
13
14
  export * from './getBulkFilesByIdsParams';
14
15
  export * from './getPresignedUploadUrlParams';
@@ -5,7 +5,9 @@
5
5
  * This API is for storing files for different users
6
6
  * OpenAPI spec version: 1.0
7
7
  */
8
+ import type { FileFilters } from './fileFilters';
8
9
  export type MyFilesParams = {
9
10
  page?: number;
10
11
  size?: number;
12
+ filters?: FileFilters;
11
13
  };
@@ -1,8 +1 @@
1
- /**
2
- * Generated by orval v7.4.1 🍺
3
- * Do not edit manually.
4
- * files-storage
5
- * This API is for storing files for different users
6
- * OpenAPI spec version: 1.0
7
- */
8
1
  export {};
@@ -25,9 +25,27 @@ export declare function useGetPresignedUploadUrl<TData = Awaited<ReturnType<type
25
25
  queryKey: QueryKey;
26
26
  };
27
27
  /**
28
- * Returns the authenticated user files by ids with presigned urls
29
- * @summary Get the authenticated user files by ids with presigned urls
28
+ * Confirms the file upload, adding the file to the thumbnail queue
29
+ * @summary Confirms the image upload
30
30
  */
31
+ export declare const imageUploaded: (options?: AxiosRequestConfig) => Promise<AxiosResponse<boolean>>;
32
+ export declare const getImageUploadedMutationOptions: <TData = AxiosResponse<boolean, any>, TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
33
+ mutation?: UseMutationOptions<TData, TError, void, TContext>;
34
+ axios?: AxiosRequestConfig;
35
+ }) => UseMutationOptions<TData, TError, void, TContext>;
36
+ export type ImageUploadedMutationResult = NonNullable<Awaited<ReturnType<typeof imageUploaded>>>;
37
+ export type ImageUploadedMutationError = AxiosError<unknown>;
38
+ /**
39
+ * @summary Confirms the image upload
40
+ */
41
+ export declare const useImageUploaded: <TData = AxiosResponse<boolean, any>, TError = AxiosError<unknown, any>, TContext = unknown>(options?: {
42
+ mutation?: UseMutationOptions<TData, TError, void, TContext>;
43
+ axios?: AxiosRequestConfig;
44
+ }) => UseMutationResult<TData, TError, void, TContext>;
45
+ /**
46
+ * Returns the authenticated user files by ids with presigned urls
47
+ * @summary Get the authenticated user files by ids with presigned urls
48
+ */
31
49
  export declare const getBulkFilesByIds: (params: GetBulkFilesByIdsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<FileWithPresignedUrl[]>>;
32
50
  export declare const getGetBulkFilesByIdsQueryKey: (params: GetBulkFilesByIdsParams) => readonly ["/files/bulk", ...GetBulkFilesByIdsParams[]];
33
51
  export declare const getGetBulkFilesByIdsQueryOptions: <TData = AxiosResponse<FileWithPresignedUrl[], any>, TError = AxiosError<unknown, any>>(params: GetBulkFilesByIdsParams, options?: {
@@ -36,9 +36,35 @@ export function useGetPresignedUploadUrl(params, options) {
36
36
  return query;
37
37
  }
38
38
  /**
39
- * Returns the authenticated user files by ids with presigned urls
40
- * @summary Get the authenticated user files by ids with presigned urls
39
+ * Confirms the file upload, adding the file to the thumbnail queue
40
+ * @summary Confirms the image upload
41
41
  */
42
+ export const imageUploaded = (options) => {
43
+ return axios.post(`/uploads/image-uploaded`, undefined, options);
44
+ };
45
+ export const getImageUploadedMutationOptions = (options) => {
46
+ const mutationKey = ['imageUploaded'];
47
+ const { mutation: mutationOptions, axios: axiosOptions } = options ?
48
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
49
+ options
50
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
51
+ : { mutation: { mutationKey, }, axios: undefined };
52
+ const mutationFn = () => {
53
+ return imageUploaded(axiosOptions);
54
+ };
55
+ return { mutationFn, ...mutationOptions };
56
+ };
57
+ /**
58
+ * @summary Confirms the image upload
59
+ */
60
+ export const useImageUploaded = (options) => {
61
+ const mutationOptions = getImageUploadedMutationOptions(options);
62
+ return useMutation(mutationOptions);
63
+ };
64
+ /**
65
+ * Returns the authenticated user files by ids with presigned urls
66
+ * @summary Get the authenticated user files by ids with presigned urls
67
+ */
42
68
  export const getBulkFilesByIds = (params, options) => {
43
69
  return axios.get(`/files/bulk`, {
44
70
  ...options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htkimura/files-storage-backend.rest-client",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "REST client of files-storage-backend",
5
5
  "author": "Henry Kimura",
6
6
  "license": "MIT",