hackathon-care-fe-sdk 0.0.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/__generated__.d.ts +194 -0
- package/dist/__generated__.js +89 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +35 -0
@@ -0,0 +1,194 @@
|
|
1
|
+
/**
|
2
|
+
* Generated by orval v7.11.2 🍺
|
3
|
+
* Do not edit manually.
|
4
|
+
* Hack Care API
|
5
|
+
* Hack Care API.
|
6
|
+
|
7
|
+
* OpenAPI spec version: 1.0.0
|
8
|
+
*/
|
9
|
+
import type { AxiosRequestConfig, AxiosResponse } from "axios";
|
10
|
+
export interface ErrorResponse {
|
11
|
+
message: string;
|
12
|
+
}
|
13
|
+
export interface Onboarding {
|
14
|
+
id: number;
|
15
|
+
step: number;
|
16
|
+
/** Unix timestamp (seconds) */
|
17
|
+
created_at: number;
|
18
|
+
/** Unix timestamp (seconds) */
|
19
|
+
updated_at: number;
|
20
|
+
}
|
21
|
+
export interface OnboardingUpdateRequest {
|
22
|
+
step: number;
|
23
|
+
}
|
24
|
+
export interface Photo {
|
25
|
+
id: number;
|
26
|
+
user_id: number;
|
27
|
+
/** Storage path for the uploaded file */
|
28
|
+
path: string;
|
29
|
+
/** Unix timestamp (seconds) */
|
30
|
+
created_at: number;
|
31
|
+
/** Unix timestamp (seconds) */
|
32
|
+
updated_at: number;
|
33
|
+
}
|
34
|
+
export interface PhotoListResponse {
|
35
|
+
photos: Photo[];
|
36
|
+
}
|
37
|
+
export interface Analysis {
|
38
|
+
id: number;
|
39
|
+
photo_id: number;
|
40
|
+
skin_type: string;
|
41
|
+
cancer: string;
|
42
|
+
diseases: string[];
|
43
|
+
/** Unix timestamp (seconds) */
|
44
|
+
created_at: number;
|
45
|
+
/** Unix timestamp (seconds) */
|
46
|
+
updated_at: number;
|
47
|
+
}
|
48
|
+
export interface PartialAnalysis {
|
49
|
+
id?: number;
|
50
|
+
photo_id: number;
|
51
|
+
/** @nullable */
|
52
|
+
skin_type: string | null;
|
53
|
+
/** @nullable */
|
54
|
+
cancer: string | null;
|
55
|
+
/** @nullable */
|
56
|
+
diseases: string[] | null;
|
57
|
+
/** Unix timestamp (seconds) */
|
58
|
+
created_at: number;
|
59
|
+
/** Unix timestamp (seconds) */
|
60
|
+
updated_at: number;
|
61
|
+
}
|
62
|
+
export interface SkinDisease {
|
63
|
+
id: number;
|
64
|
+
analysis_id: number;
|
65
|
+
name: string;
|
66
|
+
left_top_dot_x: number;
|
67
|
+
left_top_dot_y: number;
|
68
|
+
right_bottom_dot_x: number;
|
69
|
+
right_bottom_dot_y: number;
|
70
|
+
/** Unix timestamp (seconds) */
|
71
|
+
created_at: number;
|
72
|
+
/** Unix timestamp (seconds) */
|
73
|
+
updated_at: number;
|
74
|
+
}
|
75
|
+
export interface AnalysisResponse {
|
76
|
+
analysis: Analysis;
|
77
|
+
skin_diseases: SkinDisease[];
|
78
|
+
}
|
79
|
+
export interface PartialAnalysisResponse {
|
80
|
+
analysis: PartialAnalysis;
|
81
|
+
/** @nullable */
|
82
|
+
skin_diseases: SkinDisease[] | null;
|
83
|
+
}
|
84
|
+
export interface AnalysisStartRequest {
|
85
|
+
photo_id: number;
|
86
|
+
}
|
87
|
+
export interface AnalysisStartResponse {
|
88
|
+
started: boolean;
|
89
|
+
photo_id?: number;
|
90
|
+
}
|
91
|
+
export type AnalysisStatusResponseOneOf = {
|
92
|
+
ready: boolean;
|
93
|
+
analysis: AnalysisResponse;
|
94
|
+
};
|
95
|
+
export type AnalysisStatusResponseOneOfTwo = {
|
96
|
+
ready: boolean;
|
97
|
+
analysis: PartialAnalysisResponse;
|
98
|
+
};
|
99
|
+
export type AnalysisStatusResponse = AnalysisStatusResponseOneOf | AnalysisStatusResponseOneOfTwo;
|
100
|
+
export interface ReportResponse {
|
101
|
+
[key: string]: unknown;
|
102
|
+
}
|
103
|
+
export interface StreakResponse {
|
104
|
+
/** Number of consecutive days with activity */
|
105
|
+
days: number;
|
106
|
+
/** Whether the streak is failed */
|
107
|
+
is_failed: boolean;
|
108
|
+
}
|
109
|
+
/**
|
110
|
+
* Photo identifier
|
111
|
+
*/
|
112
|
+
export type PhotoIdQueryParameter = number;
|
113
|
+
export type GetPhotoByIdParams = {
|
114
|
+
/**
|
115
|
+
* Photo identifier
|
116
|
+
*/
|
117
|
+
photo_id: PhotoIdQueryParameter;
|
118
|
+
};
|
119
|
+
export type UploadPhotoBody = {
|
120
|
+
file: Blob;
|
121
|
+
};
|
122
|
+
export type GetPhotoAnalysisParams = {
|
123
|
+
/**
|
124
|
+
* Photo identifier
|
125
|
+
*/
|
126
|
+
photo_id: PhotoIdQueryParameter;
|
127
|
+
};
|
128
|
+
export type GetAnalysisStatusParams = {
|
129
|
+
/**
|
130
|
+
* Photo identifier
|
131
|
+
*/
|
132
|
+
photo_id: PhotoIdQueryParameter;
|
133
|
+
};
|
134
|
+
export type GetReportByPhotoIdParams = {
|
135
|
+
/**
|
136
|
+
* Photo identifier
|
137
|
+
*/
|
138
|
+
photo_id: PhotoIdQueryParameter;
|
139
|
+
};
|
140
|
+
/**
|
141
|
+
* @summary Get onboarding state
|
142
|
+
*/
|
143
|
+
export declare const getOnboarding: <TData = AxiosResponse<Onboarding>>(options?: AxiosRequestConfig) => Promise<TData>;
|
144
|
+
/**
|
145
|
+
* @summary Update onboarding step
|
146
|
+
*/
|
147
|
+
export declare const updateOnboarding: <TData = AxiosResponse<Onboarding>>(onboardingUpdateRequest: OnboardingUpdateRequest, options?: AxiosRequestConfig) => Promise<TData>;
|
148
|
+
/**
|
149
|
+
* @summary Get photo metadata
|
150
|
+
*/
|
151
|
+
export declare const getPhotoById: <TData = AxiosResponse<Photo>>(params: GetPhotoByIdParams, options?: AxiosRequestConfig) => Promise<TData>;
|
152
|
+
/**
|
153
|
+
* @summary Upload a new photo
|
154
|
+
*/
|
155
|
+
export declare const uploadPhoto: <TData = AxiosResponse<Photo>>(uploadPhotoBody: UploadPhotoBody, options?: AxiosRequestConfig) => Promise<TData>;
|
156
|
+
/**
|
157
|
+
* @summary List user's photos (gallery)
|
158
|
+
*/
|
159
|
+
export declare const listPhotos: <TData = AxiosResponse<PhotoListResponse>>(options?: AxiosRequestConfig) => Promise<TData>;
|
160
|
+
/**
|
161
|
+
* @summary Get finished analysis for a photo
|
162
|
+
*/
|
163
|
+
export declare const getPhotoAnalysis: <TData = AxiosResponse<AnalysisResponse>>(params: GetPhotoAnalysisParams, options?: AxiosRequestConfig) => Promise<TData>;
|
164
|
+
/**
|
165
|
+
* @summary Start processing analysis for a photo
|
166
|
+
*/
|
167
|
+
export declare const startAnalysis: <TData = AxiosResponse<AnalysisStartResponse>>(analysisStartRequest: AnalysisStartRequest, options?: AxiosRequestConfig) => Promise<TData>;
|
168
|
+
/**
|
169
|
+
* @summary Get analysis processing status
|
170
|
+
*/
|
171
|
+
export declare const getAnalysisStatus: <TData = AxiosResponse<AnalysisStatusResponse>>(params: GetAnalysisStatusParams, options?: AxiosRequestConfig) => Promise<TData>;
|
172
|
+
/**
|
173
|
+
* @summary Get latest analysis (current state)
|
174
|
+
*/
|
175
|
+
export declare const getLatestAnalysis: <TData = AxiosResponse<AnalysisResponse>>(options?: AxiosRequestConfig) => Promise<TData>;
|
176
|
+
/**
|
177
|
+
* @summary Get report for a specific photo (xlsx file)
|
178
|
+
*/
|
179
|
+
export declare const getReportByPhotoId: <TData = AxiosResponse<ReportResponse>>(params: GetReportByPhotoIdParams, options?: AxiosRequestConfig) => Promise<TData>;
|
180
|
+
/**
|
181
|
+
* @summary Get current streak in days
|
182
|
+
*/
|
183
|
+
export declare const getStreak: <TData = AxiosResponse<StreakResponse>>(options?: AxiosRequestConfig) => Promise<TData>;
|
184
|
+
export type GetOnboardingResult = AxiosResponse<Onboarding>;
|
185
|
+
export type UpdateOnboardingResult = AxiosResponse<Onboarding>;
|
186
|
+
export type GetPhotoByIdResult = AxiosResponse<Photo>;
|
187
|
+
export type UploadPhotoResult = AxiosResponse<Photo>;
|
188
|
+
export type ListPhotosResult = AxiosResponse<PhotoListResponse>;
|
189
|
+
export type GetPhotoAnalysisResult = AxiosResponse<AnalysisResponse>;
|
190
|
+
export type StartAnalysisResult = AxiosResponse<AnalysisStartResponse>;
|
191
|
+
export type GetAnalysisStatusResult = AxiosResponse<AnalysisStatusResponse>;
|
192
|
+
export type GetLatestAnalysisResult = AxiosResponse<AnalysisResponse>;
|
193
|
+
export type GetReportByPhotoIdResult = AxiosResponse<ReportResponse>;
|
194
|
+
export type GetStreakResult = AxiosResponse<StreakResponse>;
|
@@ -0,0 +1,89 @@
|
|
1
|
+
/**
|
2
|
+
* Generated by orval v7.11.2 🍺
|
3
|
+
* Do not edit manually.
|
4
|
+
* Hack Care API
|
5
|
+
* Hack Care API.
|
6
|
+
|
7
|
+
* OpenAPI spec version: 1.0.0
|
8
|
+
*/
|
9
|
+
import axios from "axios";
|
10
|
+
/**
|
11
|
+
* @summary Get onboarding state
|
12
|
+
*/
|
13
|
+
export const getOnboarding = (options) => {
|
14
|
+
return axios.get(`/onboarding`, options);
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
* @summary Update onboarding step
|
18
|
+
*/
|
19
|
+
export const updateOnboarding = (onboardingUpdateRequest, options) => {
|
20
|
+
return axios.put(`/onboarding`, onboardingUpdateRequest, options);
|
21
|
+
};
|
22
|
+
/**
|
23
|
+
* @summary Get photo metadata
|
24
|
+
*/
|
25
|
+
export const getPhotoById = (params, options) => {
|
26
|
+
return axios.get(`/photo`, {
|
27
|
+
...options,
|
28
|
+
params: { ...params, ...options?.params },
|
29
|
+
});
|
30
|
+
};
|
31
|
+
/**
|
32
|
+
* @summary Upload a new photo
|
33
|
+
*/
|
34
|
+
export const uploadPhoto = (uploadPhotoBody, options) => {
|
35
|
+
const formData = new FormData();
|
36
|
+
formData.append(`file`, uploadPhotoBody.file);
|
37
|
+
return axios.post(`/photo`, formData, options);
|
38
|
+
};
|
39
|
+
/**
|
40
|
+
* @summary List user's photos (gallery)
|
41
|
+
*/
|
42
|
+
export const listPhotos = (options) => {
|
43
|
+
return axios.get(`/photo/all`, options);
|
44
|
+
};
|
45
|
+
/**
|
46
|
+
* @summary Get finished analysis for a photo
|
47
|
+
*/
|
48
|
+
export const getPhotoAnalysis = (params, options) => {
|
49
|
+
return axios.get(`/analysis`, {
|
50
|
+
...options,
|
51
|
+
params: { ...params, ...options?.params },
|
52
|
+
});
|
53
|
+
};
|
54
|
+
/**
|
55
|
+
* @summary Start processing analysis for a photo
|
56
|
+
*/
|
57
|
+
export const startAnalysis = (analysisStartRequest, options) => {
|
58
|
+
return axios.post(`/analysis/start`, analysisStartRequest, options);
|
59
|
+
};
|
60
|
+
/**
|
61
|
+
* @summary Get analysis processing status
|
62
|
+
*/
|
63
|
+
export const getAnalysisStatus = (params, options) => {
|
64
|
+
return axios.get(`/analysis/status`, {
|
65
|
+
...options,
|
66
|
+
params: { ...params, ...options?.params },
|
67
|
+
});
|
68
|
+
};
|
69
|
+
/**
|
70
|
+
* @summary Get latest analysis (current state)
|
71
|
+
*/
|
72
|
+
export const getLatestAnalysis = (options) => {
|
73
|
+
return axios.get(`/analysis/latest`, options);
|
74
|
+
};
|
75
|
+
/**
|
76
|
+
* @summary Get report for a specific photo (xlsx file)
|
77
|
+
*/
|
78
|
+
export const getReportByPhotoId = (params, options) => {
|
79
|
+
return axios.get(`/report`, {
|
80
|
+
...options,
|
81
|
+
params: { ...params, ...options?.params },
|
82
|
+
});
|
83
|
+
};
|
84
|
+
/**
|
85
|
+
* @summary Get current streak in days
|
86
|
+
*/
|
87
|
+
export const getStreak = (options) => {
|
88
|
+
return axios.get(`/streak`, options);
|
89
|
+
};
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * as generated from "./__generated__";
|
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * as generated from "./__generated__";
|
package/package.json
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"name": "hackathon-care-fe-sdk",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "",
|
5
|
+
"private": false,
|
6
|
+
"type": "module",
|
7
|
+
"main": "dist/index.js",
|
8
|
+
"types": "dist/index.d.ts",
|
9
|
+
"exports": {
|
10
|
+
".": {
|
11
|
+
"types": "./dist/index.d.ts",
|
12
|
+
"import": "./dist/index.js",
|
13
|
+
"default": "./dist/index.js"
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"files": [
|
17
|
+
"dist"
|
18
|
+
],
|
19
|
+
"sideEffects": false,
|
20
|
+
"keywords": [],
|
21
|
+
"author": "raedyk",
|
22
|
+
"license": "ISC",
|
23
|
+
"engines": {
|
24
|
+
"node": ">=18"
|
25
|
+
},
|
26
|
+
"dependencies": {
|
27
|
+
"axios": "1.12.2"
|
28
|
+
},
|
29
|
+
"devDependencies": {
|
30
|
+
"typescript": "5.8.3"
|
31
|
+
},
|
32
|
+
"scripts": {
|
33
|
+
"build": "tsc -p tsconfig.json"
|
34
|
+
}
|
35
|
+
}
|