@hapaul/api 0.1.39 → 0.1.41
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 +72 -13
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -521,6 +521,23 @@ interface paths {
|
|
|
521
521
|
patch: operations["updateBaby"];
|
|
522
522
|
trace?: never;
|
|
523
523
|
};
|
|
524
|
+
"/baby/unfollowBaby": {
|
|
525
|
+
parameters: {
|
|
526
|
+
query?: never;
|
|
527
|
+
header?: never;
|
|
528
|
+
path?: never;
|
|
529
|
+
cookie?: never;
|
|
530
|
+
};
|
|
531
|
+
get?: never;
|
|
532
|
+
put?: never;
|
|
533
|
+
post?: never;
|
|
534
|
+
delete?: never;
|
|
535
|
+
options?: never;
|
|
536
|
+
head?: never;
|
|
537
|
+
/** Unfollow baby */
|
|
538
|
+
patch: operations["unfollowBaby"];
|
|
539
|
+
trace?: never;
|
|
540
|
+
};
|
|
524
541
|
"/babyInvitation/createInvitation": {
|
|
525
542
|
parameters: {
|
|
526
543
|
query?: never;
|
|
@@ -876,9 +893,15 @@ interface components {
|
|
|
876
893
|
account: string;
|
|
877
894
|
password: string;
|
|
878
895
|
};
|
|
879
|
-
|
|
896
|
+
DeletePermissionParams: {
|
|
897
|
+
/** Format: uuid */
|
|
898
|
+
id: string;
|
|
899
|
+
};
|
|
880
900
|
/** @description User id list */
|
|
881
|
-
|
|
901
|
+
DeleteUserDto: {
|
|
902
|
+
/** Format: uuid */
|
|
903
|
+
id: string;
|
|
904
|
+
};
|
|
882
905
|
Feeding: {
|
|
883
906
|
/** Format: uuid */
|
|
884
907
|
id: string;
|
|
@@ -946,6 +969,8 @@ interface components {
|
|
|
946
969
|
/** @enum {string} */
|
|
947
970
|
HealthRecordKind: "height" | "weight";
|
|
948
971
|
InvitationPreview: {
|
|
972
|
+
/** Format: uuid */
|
|
973
|
+
invitationId: string;
|
|
949
974
|
invitationCode: string;
|
|
950
975
|
babyName: string;
|
|
951
976
|
inviterName: string;
|
|
@@ -1124,6 +1149,8 @@ interface components {
|
|
|
1124
1149
|
};
|
|
1125
1150
|
ResponseJson: components["schemas"]["Null"];
|
|
1126
1151
|
ResponseJson_InvitationPreview: {
|
|
1152
|
+
/** Format: uuid */
|
|
1153
|
+
invitationId: string;
|
|
1127
1154
|
invitationCode: string;
|
|
1128
1155
|
babyName: string;
|
|
1129
1156
|
inviterName: string;
|
|
@@ -1303,7 +1330,7 @@ interface components {
|
|
|
1303
1330
|
ResponseJson_Vec_SessionDto: {
|
|
1304
1331
|
/** Format: uuid */
|
|
1305
1332
|
id: string;
|
|
1306
|
-
platform?:
|
|
1333
|
+
platform?: null | components["schemas"]["LoginPlatform"];
|
|
1307
1334
|
agent?: string | null;
|
|
1308
1335
|
/** Format: date-time */
|
|
1309
1336
|
createdAt: string;
|
|
@@ -1330,7 +1357,7 @@ interface components {
|
|
|
1330
1357
|
SessionDto: {
|
|
1331
1358
|
/** Format: uuid */
|
|
1332
1359
|
id: string;
|
|
1333
|
-
platform?:
|
|
1360
|
+
platform?: null | components["schemas"]["LoginPlatform"];
|
|
1334
1361
|
agent?: string | null;
|
|
1335
1362
|
/** Format: date-time */
|
|
1336
1363
|
createdAt: string;
|
|
@@ -1353,6 +1380,12 @@ interface components {
|
|
|
1353
1380
|
SortUrinationDefecationParams: "datetime";
|
|
1354
1381
|
/** @enum {string} */
|
|
1355
1382
|
ThirdParty: "wechat" | "github";
|
|
1383
|
+
UnfollowBabyParams: {
|
|
1384
|
+
/** Format: uuid */
|
|
1385
|
+
babyId: string;
|
|
1386
|
+
/** Format: uuid */
|
|
1387
|
+
userId: string;
|
|
1388
|
+
};
|
|
1356
1389
|
UpdateBabyParams: {
|
|
1357
1390
|
/** Format: uuid */
|
|
1358
1391
|
id: string;
|
|
@@ -1361,7 +1394,7 @@ interface components {
|
|
|
1361
1394
|
UpdateFeedingParams: {
|
|
1362
1395
|
/** Format: uuid */
|
|
1363
1396
|
id: string;
|
|
1364
|
-
/** Format:
|
|
1397
|
+
/** Format: int32 */
|
|
1365
1398
|
quantity?: number | null;
|
|
1366
1399
|
/** Format: date-time */
|
|
1367
1400
|
datetime?: string | null;
|
|
@@ -1381,7 +1414,7 @@ interface components {
|
|
|
1381
1414
|
description?: string | null;
|
|
1382
1415
|
};
|
|
1383
1416
|
/** @description Role update params */
|
|
1384
|
-
|
|
1417
|
+
UpdateRoleDto: {
|
|
1385
1418
|
/** Format: uuid */
|
|
1386
1419
|
id: string;
|
|
1387
1420
|
name?: string | null;
|
|
@@ -1629,7 +1662,7 @@ interface operations {
|
|
|
1629
1662
|
};
|
|
1630
1663
|
requestBody: {
|
|
1631
1664
|
content: {
|
|
1632
|
-
"application/json": components["schemas"]["
|
|
1665
|
+
"application/json": components["schemas"]["DeletePermissionParams"];
|
|
1633
1666
|
};
|
|
1634
1667
|
};
|
|
1635
1668
|
responses: {
|
|
@@ -1725,7 +1758,7 @@ interface operations {
|
|
|
1725
1758
|
};
|
|
1726
1759
|
requestBody: {
|
|
1727
1760
|
content: {
|
|
1728
|
-
"application/json": components["schemas"]["
|
|
1761
|
+
"application/json": components["schemas"]["DeleteUserDto"];
|
|
1729
1762
|
};
|
|
1730
1763
|
};
|
|
1731
1764
|
responses: {
|
|
@@ -1749,7 +1782,7 @@ interface operations {
|
|
|
1749
1782
|
};
|
|
1750
1783
|
requestBody: {
|
|
1751
1784
|
content: {
|
|
1752
|
-
"application/json": components["schemas"]["
|
|
1785
|
+
"application/json": components["schemas"]["UpdateRoleDto"];
|
|
1753
1786
|
};
|
|
1754
1787
|
};
|
|
1755
1788
|
responses: {
|
|
@@ -1903,7 +1936,7 @@ interface operations {
|
|
|
1903
1936
|
};
|
|
1904
1937
|
requestBody: {
|
|
1905
1938
|
content: {
|
|
1906
|
-
"application/json": components["schemas"]["
|
|
1939
|
+
"application/json": components["schemas"]["DeleteUserDto"];
|
|
1907
1940
|
};
|
|
1908
1941
|
};
|
|
1909
1942
|
responses: {
|
|
@@ -2161,7 +2194,8 @@ interface operations {
|
|
|
2161
2194
|
deleteBabies: {
|
|
2162
2195
|
parameters: {
|
|
2163
2196
|
query: {
|
|
2164
|
-
|
|
2197
|
+
userId: string;
|
|
2198
|
+
babyId: string;
|
|
2165
2199
|
};
|
|
2166
2200
|
header?: never;
|
|
2167
2201
|
path?: never;
|
|
@@ -2204,6 +2238,30 @@ interface operations {
|
|
|
2204
2238
|
};
|
|
2205
2239
|
};
|
|
2206
2240
|
};
|
|
2241
|
+
unfollowBaby: {
|
|
2242
|
+
parameters: {
|
|
2243
|
+
query?: never;
|
|
2244
|
+
header?: never;
|
|
2245
|
+
path?: never;
|
|
2246
|
+
cookie?: never;
|
|
2247
|
+
};
|
|
2248
|
+
requestBody: {
|
|
2249
|
+
content: {
|
|
2250
|
+
"application/json": components["schemas"]["UnfollowBabyParams"];
|
|
2251
|
+
};
|
|
2252
|
+
};
|
|
2253
|
+
responses: {
|
|
2254
|
+
/** @description ok */
|
|
2255
|
+
200: {
|
|
2256
|
+
headers: {
|
|
2257
|
+
[name: string]: unknown;
|
|
2258
|
+
};
|
|
2259
|
+
content: {
|
|
2260
|
+
"application/json": components["schemas"]["ResponseJson_Null"];
|
|
2261
|
+
};
|
|
2262
|
+
};
|
|
2263
|
+
};
|
|
2264
|
+
};
|
|
2207
2265
|
createInvitation: {
|
|
2208
2266
|
parameters: {
|
|
2209
2267
|
query?: never;
|
|
@@ -2347,7 +2405,7 @@ interface operations {
|
|
|
2347
2405
|
deleteFeedings: {
|
|
2348
2406
|
parameters: {
|
|
2349
2407
|
query: {
|
|
2350
|
-
|
|
2408
|
+
id: string;
|
|
2351
2409
|
};
|
|
2352
2410
|
header?: never;
|
|
2353
2411
|
path?: never;
|
|
@@ -2441,7 +2499,7 @@ interface operations {
|
|
|
2441
2499
|
deleteHealthRecords: {
|
|
2442
2500
|
parameters: {
|
|
2443
2501
|
query: {
|
|
2444
|
-
|
|
2502
|
+
id: string;
|
|
2445
2503
|
};
|
|
2446
2504
|
header?: never;
|
|
2447
2505
|
path?: never;
|
|
@@ -2652,6 +2710,7 @@ interface Middleware<C> {
|
|
|
2652
2710
|
onResponse?: (config: RequestConfig<any, any, C>, response: Response) => Response | Promise<Response>;
|
|
2653
2711
|
onError?: (config: RequestLooseConfig<C>, response: Response, error: {
|
|
2654
2712
|
status: number;
|
|
2713
|
+
code: string;
|
|
2655
2714
|
message: string;
|
|
2656
2715
|
}) => void;
|
|
2657
2716
|
}
|
package/dist/index.js
CHANGED
|
@@ -75,9 +75,12 @@ var Client = class {
|
|
|
75
75
|
response
|
|
76
76
|
};
|
|
77
77
|
if (!isOk) {
|
|
78
|
+
let code = "";
|
|
78
79
|
let message = response.statusText;
|
|
80
|
+
if (typeof error === "object" && "code" in error) code = error.code;
|
|
79
81
|
if (typeof error === "object" && "message" in error) message = error.message;
|
|
80
82
|
for (const middleware of this.middlewares) middleware.onError?.(requestConfig, response, {
|
|
83
|
+
code,
|
|
81
84
|
status,
|
|
82
85
|
message
|
|
83
86
|
});
|