web-core-tcm 0.0.24 → 0.0.25

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.
Files changed (126) hide show
  1. package/.editorconfig +7 -0
  2. package/.github/workflows/test.yml +29 -0
  3. package/.prettierrc.json +5 -0
  4. package/.vscode/extensions.json +15 -0
  5. package/.vscode/settings.json +9 -0
  6. package/eslint.config.js +83 -0
  7. package/index.html +24 -0
  8. package/package.json +1 -4
  9. package/postcss.config.js +29 -0
  10. package/public/favicon.ico +0 -0
  11. package/public/icons/favicon-128x128.png +0 -0
  12. package/public/icons/favicon-16x16.png +0 -0
  13. package/public/icons/favicon-32x32.png +0 -0
  14. package/public/icons/favicon-96x96.png +0 -0
  15. package/quasar.config.ts +233 -0
  16. package/src/App.vue +7 -0
  17. package/src/api/algorithm/comprehensiveAlgorithm.ts +20 -0
  18. package/src/api/algorithm/index.ts +50 -0
  19. package/src/api/algorithm/inquiriesAlgorithm.ts +16 -0
  20. package/src/api/algorithm/inspectionsAlgorithm.ts +11 -0
  21. package/src/api/algorithm/lisemsAlgorithm.ts +16 -0
  22. package/src/api/algorithm/pulsationsAlgorithm.ts +8 -0
  23. package/src/api/authorization/alova/apiDefinitions.ts +23 -0
  24. package/src/api/authorization/alova/createApis.ts +114 -0
  25. package/src/api/authorization/alova/globals.d.ts +394 -0
  26. package/src/api/authorization/alova/implement/authorization.ts +14 -0
  27. package/src/api/authorization/alova/implement/index.ts +1 -0
  28. package/src/api/authorization/alova/index.ts +22 -0
  29. package/src/api/authorization/authorization.ts +16 -0
  30. package/src/api/authorization/index.ts +2 -0
  31. package/src/api/check/alova/apiDefinitions.ts +30 -0
  32. package/src/api/check/alova/createApis.ts +114 -0
  33. package/src/api/check/alova/globals.d.ts +1257 -0
  34. package/src/api/check/alova/implement/check.ts +165 -0
  35. package/src/api/check/alova/implement/index.ts +1 -0
  36. package/src/api/check/alova/index.ts +22 -0
  37. package/src/api/check/check.ts +217 -0
  38. package/src/api/check/index.ts +2 -0
  39. package/src/api/config/alova/index.ts +71 -0
  40. package/src/api/config/index.ts +132 -0
  41. package/src/api/device/device.js +58 -0
  42. package/src/api/doctor/alova/apiDefinitions.ts +28 -0
  43. package/src/api/doctor/alova/createApis.ts +114 -0
  44. package/src/api/doctor/alova/globals.d.ts +559 -0
  45. package/src/api/doctor/alova/implement/doctor.ts +51 -0
  46. package/src/api/doctor/alova/implement/index.ts +1 -0
  47. package/src/api/doctor/alova/index.ts +23 -0
  48. package/src/api/doctor/doctor.ts +53 -0
  49. package/src/api/doctor/index.ts +2 -0
  50. package/src/api/index.ts +12 -0
  51. package/src/api/metric/implement/index.ts +1 -0
  52. package/src/api/metric/implement/metric.ts +108 -0
  53. package/src/api/metric/index.ts +2 -0
  54. package/src/api/metric/metric.ts +114 -0
  55. package/src/api/oauth/alova/apiDefinitions.ts +26 -0
  56. package/src/api/oauth/alova/createApis.ts +114 -0
  57. package/src/api/oauth/alova/globals.d.ts +460 -0
  58. package/src/api/oauth/alova/implement/index.ts +1 -0
  59. package/src/api/oauth/alova/implement/oauth.ts +24 -0
  60. package/src/api/oauth/alova/index.ts +21 -0
  61. package/src/api/oauth/index.ts +2 -0
  62. package/src/api/oauth/oauth.ts +19 -0
  63. package/src/api/outpatient/alova/apiDefinitions.ts +27 -0
  64. package/src/api/outpatient/alova/createApis.ts +114 -0
  65. package/src/api/outpatient/alova/globals.d.ts +685 -0
  66. package/src/api/outpatient/alova/implement/index.ts +1 -0
  67. package/src/api/outpatient/alova/implement/outpatient.ts +91 -0
  68. package/src/api/outpatient/alova/index.ts +22 -0
  69. package/src/api/outpatient/index.ts +2 -0
  70. package/src/api/outpatient/outpatient.ts +67 -0
  71. package/src/api/patient/alova/apiDefinitions.ts +41 -0
  72. package/src/api/patient/alova/createApis.ts +114 -0
  73. package/src/api/patient/alova/globals.d.ts +1690 -0
  74. package/src/api/patient/alova/implement/index.ts +2 -0
  75. package/src/api/patient/alova/implement/meta.ts +517 -0
  76. package/src/api/patient/alova/implement/patient.ts +99 -0
  77. package/src/api/patient/alova/index.ts +22 -0
  78. package/src/api/patient/core.ts +133 -0
  79. package/src/api/patient/index.ts +4 -0
  80. package/src/api/patient/meta.ts +570 -0
  81. package/src/api/patient/patient.ts +98 -0
  82. package/src/api/prescription/alova/apiDefinitions.ts +29 -0
  83. package/src/api/prescription/alova/createApis.ts +114 -0
  84. package/src/api/prescription/alova/globals.d.ts +968 -0
  85. package/src/api/prescription/alova/implement/herbal.ts +68 -0
  86. package/src/api/prescription/alova/implement/index.ts +2 -0
  87. package/src/api/prescription/alova/implement/prescription.ts +62 -0
  88. package/src/api/prescription/alova/index.ts +22 -0
  89. package/src/api/prescription/herbal.ts +51 -0
  90. package/src/api/prescription/index.ts +3 -0
  91. package/src/api/prescription/prescription.ts +76 -0
  92. package/src/api/scientist/alova/apiDefinitions.ts +27 -0
  93. package/src/api/scientist/alova/createApis.ts +114 -0
  94. package/src/api/scientist/alova/globals.d.ts +447 -0
  95. package/src/api/scientist/alova/implement/index.ts +1 -0
  96. package/src/api/scientist/alova/implement/scientist.ts +40 -0
  97. package/src/api/scientist/alova/index.ts +24 -0
  98. package/src/api/scientist/index.ts +2 -0
  99. package/src/api/scientist/scientist.ts +49 -0
  100. package/src/assets/quasar-logo-vertical.svg +15 -0
  101. package/src/boot/.gitkeep +0 -0
  102. package/src/components/ExampleComponent.vue +37 -0
  103. package/src/components/models.ts +8 -0
  104. package/src/css/app.scss +1 -0
  105. package/src/css/quasar.variables.scss +25 -0
  106. package/src/env.d.ts +7 -0
  107. package/src/index.ts +3 -0
  108. package/src/layouts/UserLayout.vue +108 -0
  109. package/src/pages/LoginPage.vue +29 -0
  110. package/src/proto/Images.proto +7 -0
  111. package/src/proto/WaveMap.proto +10 -0
  112. package/src/proto/index.ts +2 -0
  113. package/src/proto/types/Images_pb.ts +48 -0
  114. package/src/proto/types/WaveMap_pb.ts +59 -0
  115. package/src/router/index.ts +37 -0
  116. package/src/router/routes.ts +14 -0
  117. package/src/util/RichTextUtil.ts +5 -0
  118. package/src/util/datetime.ts +43 -0
  119. package/src/util/export.ts +46 -0
  120. package/src/util/helper.ts +159 -0
  121. package/src/util/image.ts +28 -0
  122. package/src/util/number.ts +146 -0
  123. package/src/util/s256.js +27 -0
  124. package/src/util/secret.ts +60 -0
  125. package/src/util/string.ts +121 -0
  126. package/tsconfig.json +7 -0
@@ -0,0 +1,460 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * OpenAPI definition - version v0
5
+ *
6
+ *
7
+ *
8
+ * OpenAPI version: 3.1.0
9
+ *
10
+ *
11
+ * NOTE: This file is auto generated by the alova's vscode plugin.
12
+ *
13
+ * https://alova.js.org/devtools/vscode
14
+ *
15
+ * **Do not edit the file manually.**
16
+ */
17
+ import type { Alova, AlovaMethodCreateConfig, AlovaGenerics, Method } from 'alova';
18
+ import type { $$userConfigMap, alovaInstance } from './index';
19
+ import type apiDefinitions from './apiDefinitions';
20
+
21
+ type CollapsedAlova = typeof alovaInstance;
22
+ type UserMethodConfigMap = typeof $$userConfigMap;
23
+
24
+ type Alova2MethodConfig<Responded> =
25
+ CollapsedAlova extends Alova<
26
+ AlovaGenerics<
27
+ any,
28
+ any,
29
+ infer RequestConfig,
30
+ infer Response,
31
+ infer ResponseHeader,
32
+ infer L1Cache,
33
+ infer L2Cache,
34
+ infer SE
35
+ >
36
+ >
37
+ ? Omit<
38
+ AlovaMethodCreateConfig<
39
+ AlovaGenerics<
40
+ Responded,
41
+ any,
42
+ RequestConfig,
43
+ Response,
44
+ ResponseHeader,
45
+ L1Cache,
46
+ L2Cache,
47
+ SE
48
+ >,
49
+ any,
50
+ Responded
51
+ >,
52
+ 'params'
53
+ >
54
+ : never;
55
+
56
+ // Extract the return type of transform function that define in $$userConfigMap, if it not exists, use the default type.
57
+ type ExtractUserDefinedTransformed<
58
+ DefinitionKey extends keyof typeof apiDefinitions,
59
+ Default,
60
+ > = DefinitionKey extends keyof UserMethodConfigMap
61
+ ? UserMethodConfigMap[DefinitionKey]['transform'] extends (...args: any[]) => any
62
+ ? Awaited<ReturnType<UserMethodConfigMap[DefinitionKey]['transform']>>
63
+ : Default
64
+ : Default;
65
+ type Alova2Method<
66
+ Responded,
67
+ DefinitionKey extends keyof typeof apiDefinitions,
68
+ CurrentConfig extends Alova2MethodConfig<any>,
69
+ > =
70
+ CollapsedAlova extends Alova<
71
+ AlovaGenerics<
72
+ any,
73
+ any,
74
+ infer RequestConfig,
75
+ infer Response,
76
+ infer ResponseHeader,
77
+ infer L1Cache,
78
+ infer L2Cache,
79
+ infer SE
80
+ >
81
+ >
82
+ ? Method<
83
+ AlovaGenerics<
84
+ CurrentConfig extends undefined
85
+ ? ExtractUserDefinedTransformed<DefinitionKey, Responded>
86
+ : CurrentConfig['transform'] extends (...args: any[]) => any
87
+ ? Awaited<ReturnType<CurrentConfig['transform']>>
88
+ : ExtractUserDefinedTransformed<DefinitionKey, Responded>,
89
+ any,
90
+ RequestConfig,
91
+ Response,
92
+ ResponseHeader,
93
+ L1Cache,
94
+ L2Cache,
95
+ SE
96
+ >
97
+ >
98
+ : never;
99
+
100
+ export interface UserState {
101
+ id?: string;
102
+ name?: string;
103
+ phoneNumber?: string;
104
+ identityNumber?: string;
105
+ gender?: string;
106
+ createdTimestamp?: string;
107
+ updatedTimestamp?: string;
108
+ }
109
+ export interface PhoneVerifyRequest {
110
+ phoneNumber?: string;
111
+ code?: string;
112
+ id?: string;
113
+ }
114
+ export interface UserGetResponse {
115
+ status?: number;
116
+ user?: UserState;
117
+ }
118
+ export interface UserPutResponse {
119
+ status?: number;
120
+ user?: UserState;
121
+ }
122
+ export interface PhoneVerifyResponse {
123
+ status?: number;
124
+ token?: string;
125
+ users?: UserState[];
126
+ message?: string;
127
+ }
128
+ export interface Model {
129
+ bizId?: string;
130
+ outId?: string;
131
+ requestId?: string;
132
+ verifyCode?: string;
133
+ }
134
+ export interface SendSmsVerifyCodeResponseBody {
135
+ accessDeniedDetail?: string;
136
+ code?: string;
137
+ message?: string;
138
+ model?: Model;
139
+ success?: boolean;
140
+ }
141
+ export interface SendSmsVerifyCodeResponse {
142
+ headers?: Record<string, string>;
143
+ statusCode?: number;
144
+ body?: SendSmsVerifyCodeResponseBody;
145
+ }
146
+ export interface TokenInfo {
147
+ accessToken?: string;
148
+ jwtToken?: string;
149
+ }
150
+ export interface GetAuthTokenResponseBody {
151
+ code?: string;
152
+ message?: string;
153
+ requestId?: string;
154
+ tokenInfo?: TokenInfo;
155
+ }
156
+ export interface GetAuthTokenResponse {
157
+ headers?: Record<string, string>;
158
+ statusCode?: number;
159
+ body?: GetAuthTokenResponseBody;
160
+ }
161
+ export interface GetClientResponse {
162
+ status?: number;
163
+ clientDescription?: string;
164
+ }
165
+ declare global {
166
+ interface oauthApi {
167
+ userStateRestful: {
168
+ /**
169
+ * ---
170
+ *
171
+ * [GET]
172
+ *
173
+ * **path:** /互联/服务/用户
174
+ *
175
+ * ---
176
+ *
177
+ * **Response**
178
+ * ```ts
179
+ * type Response = {
180
+ * status?: number
181
+ * user?: {
182
+ * id?: string
183
+ * name?: string
184
+ * phoneNumber?: string
185
+ * identityNumber?: string
186
+ * gender?: string
187
+ * createdTimestamp?: string
188
+ * updatedTimestamp?: string
189
+ * }
190
+ * }
191
+ * ```
192
+ */
193
+ getUserState<Config extends Alova2MethodConfig<UserGetResponse>>(
194
+ config?: Config,
195
+ ): Alova2Method<UserGetResponse, 'userStateRestful.getUserState', Config>;
196
+ /**
197
+ * ---
198
+ *
199
+ * [PUT]
200
+ *
201
+ * **path:** /互联/服务/用户
202
+ *
203
+ * ---
204
+ *
205
+ * **RequestBody**
206
+ * ```ts
207
+ * type RequestBody = {
208
+ * id?: string
209
+ * name?: string
210
+ * phoneNumber?: string
211
+ * identityNumber?: string
212
+ * gender?: string
213
+ * createdTimestamp?: string
214
+ * updatedTimestamp?: string
215
+ * }
216
+ * ```
217
+ *
218
+ * ---
219
+ *
220
+ * **Response**
221
+ * ```ts
222
+ * type Response = {
223
+ * status?: number
224
+ * user?: {
225
+ * id?: string
226
+ * name?: string
227
+ * phoneNumber?: string
228
+ * identityNumber?: string
229
+ * gender?: string
230
+ * createdTimestamp?: string
231
+ * updatedTimestamp?: string
232
+ * }
233
+ * }
234
+ * ```
235
+ */
236
+ putUserState<
237
+ Config extends Alova2MethodConfig<UserPutResponse> & {
238
+ data: UserState;
239
+ },
240
+ >(
241
+ config: Config,
242
+ ): Alova2Method<UserPutResponse, 'userStateRestful.putUserState', Config>;
243
+ };
244
+ phoneVerifyRestful: {
245
+ /**
246
+ * ---
247
+ *
248
+ * [POST]
249
+ *
250
+ * **path:** /互联/服务/电话/验证短信
251
+ *
252
+ * ---
253
+ *
254
+ * **RequestBody**
255
+ * ```ts
256
+ * type RequestBody = {
257
+ * phoneNumber?: string
258
+ * code?: string
259
+ * id?: string
260
+ * }
261
+ * ```
262
+ *
263
+ * ---
264
+ *
265
+ * **Response**
266
+ * ```ts
267
+ * type Response = {
268
+ * status?: number
269
+ * token?: string
270
+ * // [items] start
271
+ * // [items] end
272
+ * users?: Array<{
273
+ * id?: string
274
+ * name?: string
275
+ * phoneNumber?: string
276
+ * identityNumber?: string
277
+ * gender?: string
278
+ * createdTimestamp?: string
279
+ * updatedTimestamp?: string
280
+ * }>
281
+ * message?: string
282
+ * }
283
+ * ```
284
+ */
285
+ verifySMSCode<
286
+ Config extends Alova2MethodConfig<PhoneVerifyResponse> & {
287
+ data: PhoneVerifyRequest;
288
+ },
289
+ >(
290
+ config: Config,
291
+ ): Alova2Method<PhoneVerifyResponse, 'phoneVerifyRestful.verifySMSCode', Config>;
292
+ /**
293
+ * ---
294
+ *
295
+ * [GET]
296
+ *
297
+ * **path:** /互联/服务/电话/发送短信
298
+ *
299
+ * ---
300
+ *
301
+ * **Query Parameters**
302
+ * ```ts
303
+ * type QueryParameters = {
304
+ * phoneNumber: string
305
+ * }
306
+ * ```
307
+ *
308
+ * ---
309
+ *
310
+ * **Response**
311
+ * ```ts
312
+ * type Response = {
313
+ * headers?: Record<string, string>
314
+ * statusCode?: number
315
+ * body?: {
316
+ * accessDeniedDetail?: string
317
+ * code?: string
318
+ * message?: string
319
+ * model?: {
320
+ * bizId?: string
321
+ * outId?: string
322
+ * requestId?: string
323
+ * verifyCode?: string
324
+ * }
325
+ * success?: boolean
326
+ * }
327
+ * }
328
+ * ```
329
+ */
330
+ sendSMSCode<
331
+ Config extends Alova2MethodConfig<SendSmsVerifyCodeResponse> & {
332
+ params: {
333
+ phoneNumber: string;
334
+ };
335
+ },
336
+ >(
337
+ config: Config,
338
+ ): Alova2Method<SendSmsVerifyCodeResponse, 'phoneVerifyRestful.sendSMSCode', Config>;
339
+ /**
340
+ * ---
341
+ *
342
+ * [GET]
343
+ *
344
+ * **path:** /互联/服务/电话/令牌认证
345
+ *
346
+ * ---
347
+ *
348
+ * **Query Parameters**
349
+ * ```ts
350
+ * type QueryParameters = {
351
+ * bizType: number
352
+ * }
353
+ * ```
354
+ *
355
+ * ---
356
+ *
357
+ * **Response**
358
+ * ```ts
359
+ * type Response = {
360
+ * headers?: Record<string, string>
361
+ * statusCode?: number
362
+ * body?: {
363
+ * code?: string
364
+ * message?: string
365
+ * requestId?: string
366
+ * tokenInfo?: {
367
+ * accessToken?: string
368
+ * jwtToken?: string
369
+ * }
370
+ * }
371
+ * }
372
+ * ```
373
+ */
374
+ authToken<
375
+ Config extends Alova2MethodConfig<GetAuthTokenResponse> & {
376
+ params: {
377
+ bizType: number;
378
+ };
379
+ },
380
+ >(
381
+ config: Config,
382
+ ): Alova2Method<GetAuthTokenResponse, 'phoneVerifyRestful.authToken', Config>;
383
+ };
384
+ authorizationRestful: {
385
+ /**
386
+ * ---
387
+ *
388
+ * [GET]
389
+ *
390
+ * **path:** /互联/服务/授权/许可
391
+ *
392
+ * ---
393
+ *
394
+ * **Query Parameters**
395
+ * ```ts
396
+ * type QueryParameters = {
397
+ * client_id: string
398
+ * scope: string
399
+ * state: string
400
+ * }
401
+ * ```
402
+ *
403
+ * ---
404
+ *
405
+ * **Response**
406
+ * ```ts
407
+ * type Response = string
408
+ * ```
409
+ */
410
+ consent<
411
+ Config extends Alova2MethodConfig<string> & {
412
+ params: {
413
+ client_id: string;
414
+ scope: string;
415
+ state: string;
416
+ };
417
+ },
418
+ >(
419
+ config: Config,
420
+ ): Alova2Method<string, 'authorizationRestful.consent', Config>;
421
+ /**
422
+ * ---
423
+ *
424
+ * [GET]
425
+ *
426
+ * **path:** /互联/服务/授权/客户端介绍
427
+ *
428
+ * ---
429
+ *
430
+ * **Query Parameters**
431
+ * ```ts
432
+ * type QueryParameters = {
433
+ * client_id: string
434
+ * }
435
+ * ```
436
+ *
437
+ * ---
438
+ *
439
+ * **Response**
440
+ * ```ts
441
+ * type Response = {
442
+ * status?: number
443
+ * clientDescription?: string
444
+ * }
445
+ * ```
446
+ */
447
+ getClientDescription<
448
+ Config extends Alova2MethodConfig<GetClientResponse> & {
449
+ params: {
450
+ client_id: string;
451
+ };
452
+ },
453
+ >(
454
+ config: Config,
455
+ ): Alova2Method<GetClientResponse, 'authorizationRestful.getClientDescription', Config>;
456
+ };
457
+ }
458
+
459
+ var oauthApi: oauthApi;
460
+ }
@@ -0,0 +1 @@
1
+ export * from './oauth';
@@ -0,0 +1,24 @@
1
+ import { OAuth } from 'src/api/oauth/oauth';
2
+ import { alovaInstance } from 'src/api/oauth/alova';
3
+
4
+ export class AlovaOAuth extends OAuth {
5
+ static override async getYincToken(
6
+ code: string,
7
+ redirect_uri: string,
8
+ client_id: string,
9
+ code_verifier: string,
10
+ ) {
11
+ const formData = new FormData();
12
+ formData.append('code', code);
13
+ formData.append('grant_type', 'authorization_code');
14
+ formData.append('redirect_uri', redirect_uri);
15
+ formData.append('client_id', client_id);
16
+ formData.append('code_verifier', code_verifier);
17
+ const method = alovaInstance.Post<string>('/互联/服务/互联/令牌', formData, {
18
+ transform(data) {
19
+ return (data as { access_token: string }).access_token;
20
+ },
21
+ });
22
+ return method.send();
23
+ }
24
+ }
@@ -0,0 +1,21 @@
1
+ import { createAlova } from 'alova';
2
+ import fetchAdapter from 'alova/fetch';
3
+ import { createApis, withConfigType, mountApis } from './createApis';
4
+ import { responded } from 'src/api/config/alova';
5
+ import { getServiceEndpoint, ServiceType } from 'src/api/config';
6
+
7
+ export const alovaInstance = createAlova({
8
+ baseURL: getServiceEndpoint(ServiceType.OAuth),
9
+ requestAdapter: fetchAdapter(),
10
+ cacheFor: null,
11
+ responded: responded,
12
+ });
13
+
14
+ export const $$userConfigMap = withConfigType({});
15
+
16
+ const Apis = createApis(alovaInstance, $$userConfigMap);
17
+
18
+ mountApis(Apis);
19
+
20
+ export default Apis;
21
+ export * from './implement';
@@ -0,0 +1,2 @@
1
+ export * from './oauth';
2
+ export * from './alova';
@@ -0,0 +1,19 @@
1
+ import type { IBuilder } from 'builder-pattern';
2
+ import { Builder } from 'builder-pattern';
3
+ export abstract class OAuth {
4
+ static _default: typeof OAuth;
5
+ static builder(): IBuilder<OAuth> {
6
+ return Builder(this._default) as unknown as IBuilder<OAuth>;
7
+ }
8
+ static default(): typeof OAuth {
9
+ return this._default as unknown as typeof OAuth;
10
+ }
11
+ static getYincToken(
12
+ code: string,
13
+ redirect_uri: string,
14
+ client_id: string,
15
+ code_verifier: string,
16
+ ): Promise<string> {
17
+ return OAuth.default().getYincToken(code, redirect_uri, client_id, code_verifier);
18
+ }
19
+ }
@@ -0,0 +1,27 @@
1
+ /// <reference types='./globals.d.ts' />
2
+ /* tslint:disable */
3
+
4
+ /**
5
+ * OpenAPI definition - version v0
6
+ *
7
+ *
8
+ *
9
+ * OpenAPI version: 3.1.0
10
+ *
11
+ *
12
+ * NOTE: This file is auto generated by the alova's vscode plugin.
13
+ *
14
+ * https://alova.js.org/devtools/vscode
15
+ *
16
+ * **Do not edit the file manually.**
17
+ */
18
+ export default {
19
+ 'queuerRestful.getQueuerState': ['GET', '/门诊/服务/排队/{id}'],
20
+ 'queuerRestful.putQueuerState': ['PUT', '/门诊/服务/排队/{id}'],
21
+ 'queuerRestful.deleteQueuerState': ['DELETE', '/门诊/服务/排队/{id}'],
22
+ 'queuerRestful.queryQueuerState': ['GET', '/门诊/服务/排队'],
23
+ 'queuerRestful.postQueuerState': ['POST', '/门诊/服务/排队'],
24
+ 'metricRestful.datesOfQueuerState': ['GET', '/门诊/服务/统计/排队/日期'],
25
+ 'metricRestful.totalOfQueuerState': ['GET', '/门诊/服务/统计/排队/总数'],
26
+ 'metricRestful.totalOfQueuerTodayState': ['GET', '/门诊/服务/统计/排队/今日'],
27
+ };
@@ -0,0 +1,114 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * OpenAPI definition - version v0
5
+ *
6
+ *
7
+ *
8
+ * OpenAPI version: 3.1.0
9
+ *
10
+ *
11
+ * NOTE: This file is auto generated by the alova's vscode plugin.
12
+ *
13
+ * https://alova.js.org/devtools/vscode
14
+ *
15
+ * **Do not edit the file manually.**
16
+ */
17
+ import type { Alova, MethodType, AlovaGenerics, AlovaMethodCreateConfig } from 'alova';
18
+ import { Method } from 'alova';
19
+ import apiDefinitions from './apiDefinitions';
20
+
21
+ const cache = Object.create(null);
22
+ const createFunctionalProxy = (
23
+ array: (string | symbol)[],
24
+ alovaInstance: Alova<AlovaGenerics>,
25
+ configMap: any,
26
+ ) => {
27
+ const apiPathKey = array.join('.') as keyof typeof apiDefinitions;
28
+ if (cache[apiPathKey]) {
29
+ return cache[apiPathKey];
30
+ }
31
+ // create a new proxy instance
32
+ const proxy = new Proxy(function () {}, {
33
+ get(_, property) {
34
+ // record the target property, so that it can get the completed accessing paths
35
+ const newArray = [...array, property];
36
+ // always return a new proxy to continue recording accessing paths.
37
+ return createFunctionalProxy(newArray, alovaInstance, configMap);
38
+ },
39
+ apply(_, __, [config]) {
40
+ const apiItem = apiDefinitions[apiPathKey];
41
+ if (!apiItem) {
42
+ throw new Error(`the api path of \`${apiPathKey}\` is not found`);
43
+ }
44
+ const mergedConfig = {
45
+ ...configMap[apiPathKey],
46
+ ...config,
47
+ };
48
+ const [method, url] = apiItem;
49
+ const pathParams = mergedConfig.pathParams;
50
+ const urlReplaced = url!.replace(/\{([^}]+)\}/g, (_, key) => {
51
+ const pathParam = pathParams[key];
52
+ return pathParam;
53
+ });
54
+ delete mergedConfig.pathParams;
55
+ let data = mergedConfig.data;
56
+ if (
57
+ Object.prototype.toString.call(data) === '[object Object]' &&
58
+ typeof FormData !== 'undefined'
59
+ ) {
60
+ let hasBlobData = false;
61
+ const formData = new FormData();
62
+ for (const key in data) {
63
+ formData.append(key, data[key]);
64
+ if (data[key] instanceof Blob) {
65
+ hasBlobData = true;
66
+ }
67
+ }
68
+ data = hasBlobData ? formData : data;
69
+ }
70
+ return new Method(
71
+ method!.toUpperCase() as MethodType,
72
+ alovaInstance,
73
+ urlReplaced,
74
+ mergedConfig,
75
+ data,
76
+ );
77
+ },
78
+ });
79
+ cache[apiPathKey] = proxy;
80
+ return proxy;
81
+ };
82
+
83
+ export const createApis = (alovaInstance: Alova<AlovaGenerics>, configMap: any) => {
84
+ const Apis = new Proxy({} as outpatientApi, {
85
+ get(_, property) {
86
+ return createFunctionalProxy([property], alovaInstance, configMap);
87
+ },
88
+ });
89
+ return Apis;
90
+ };
91
+ export const mountApis = (Apis: outpatientApi) => {
92
+ // define global variable `Apis`
93
+ (globalThis as any).outpatientApi = Apis;
94
+ };
95
+ type MethodConfig<T> = AlovaMethodCreateConfig<
96
+ (typeof import('./index'))['alovaInstance'] extends Alova<infer AG> ? AG : any,
97
+ any,
98
+ T
99
+ >;
100
+ type APISofParameters<Tag extends string, Url extends string> = Tag extends keyof outpatientApi
101
+ ? Url extends keyof outpatientApi[Tag]
102
+ ? outpatientApi[Tag][Url] extends (...args: any) => any
103
+ ? Parameters<outpatientApi[Tag][Url]>
104
+ : any
105
+ : any
106
+ : any;
107
+ type MethodsConfigMap = {
108
+ [P in keyof typeof import('./apiDefinitions').default]?: MethodConfig<
109
+ P extends `${infer Tag}.${infer Url}`
110
+ ? Parameters<NonNullable<APISofParameters<Tag, Url>[0]>['transform']>[0]
111
+ : any
112
+ >;
113
+ };
114
+ export const withConfigType = <Config extends MethodsConfigMap>(config: Config) => config;