web-core-tcm 0.0.1 → 0.0.6

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 (66) hide show
  1. package/package.json +15 -2
  2. package/src/coreApi/api/algorithm/comprehensiveAlgorithm.ts +20 -0
  3. package/src/coreApi/api/algorithm/index.ts +44 -0
  4. package/src/coreApi/api/algorithm/inquiriesAlgorithm.ts +19 -0
  5. package/src/coreApi/api/algorithm/inspectionsAlgorithm.ts +11 -0
  6. package/src/coreApi/api/algorithm/lisemsAlgorithm.ts +16 -0
  7. package/src/coreApi/api/algorithm/pulsationsAlgorithm.ts +9 -0
  8. package/src/coreApi/api/authorization/alova/apiDefinitions.ts +23 -0
  9. package/src/coreApi/api/authorization/alova/createApis.ts +99 -0
  10. package/src/coreApi/api/authorization/alova/globals.d.ts +373 -0
  11. package/src/coreApi/api/authorization/alova/implement/authorization.ts +12 -0
  12. package/src/coreApi/api/authorization/alova/index.ts +21 -0
  13. package/src/coreApi/api/authorization/authorization.ts +16 -0
  14. package/src/coreApi/api/check/alova/apiDefinitions.ts +30 -0
  15. package/src/coreApi/api/check/alova/createApis.ts +99 -0
  16. package/src/coreApi/api/check/alova/globals.d.ts +1248 -0
  17. package/src/coreApi/api/check/alova/implement/check.ts +119 -0
  18. package/src/coreApi/api/check/alova/index.ts +21 -0
  19. package/src/coreApi/api/check/check.ts +164 -0
  20. package/src/coreApi/api/config/alova/index.ts +72 -0
  21. package/src/coreApi/api/config/index.ts +128 -0
  22. package/src/coreApi/api/device/device.js +58 -0
  23. package/src/coreApi/api/doctor/alova/apiDefinitions.ts +28 -0
  24. package/src/coreApi/api/doctor/alova/createApis.ts +99 -0
  25. package/src/coreApi/api/doctor/alova/globals.d.ts +550 -0
  26. package/src/coreApi/api/doctor/alova/implement/doctor.ts +37 -0
  27. package/src/coreApi/api/doctor/alova/index.ts +21 -0
  28. package/src/coreApi/api/doctor/doctor.ts +53 -0
  29. package/src/coreApi/api/metric/implement/metric.ts +98 -0
  30. package/src/coreApi/api/metric/metric.ts +114 -0
  31. package/src/coreApi/api/oauth/alova/apiDefinitions.ts +26 -0
  32. package/src/coreApi/api/oauth/alova/createApis.ts +99 -0
  33. package/src/coreApi/api/oauth/alova/globals.d.ts +451 -0
  34. package/src/coreApi/api/oauth/alova/implement/oauth.ts +19 -0
  35. package/src/coreApi/api/oauth/alova/index.ts +20 -0
  36. package/src/coreApi/api/oauth/oauth.ts +15 -0
  37. package/src/coreApi/api/outpatient/alova/apiDefinitions.ts +27 -0
  38. package/src/coreApi/api/outpatient/alova/createApis.ts +99 -0
  39. package/src/coreApi/api/outpatient/alova/globals.d.ts +676 -0
  40. package/src/coreApi/api/outpatient/alova/implement/outpatient.ts +66 -0
  41. package/src/coreApi/api/outpatient/alova/index.ts +21 -0
  42. package/src/coreApi/api/outpatient/outpatient.ts +62 -0
  43. package/src/coreApi/api/patient/alova/apiDefinitions.ts +41 -0
  44. package/src/coreApi/api/patient/alova/createApis.ts +99 -0
  45. package/src/coreApi/api/patient/alova/globals.d.ts +1677 -0
  46. package/src/coreApi/api/patient/alova/implement/meta.ts +488 -0
  47. package/src/coreApi/api/patient/alova/implement/patient.ts +77 -0
  48. package/src/coreApi/api/patient/alova/index.ts +21 -0
  49. package/src/coreApi/api/patient/core.ts +131 -0
  50. package/src/coreApi/api/patient/meta.ts +466 -0
  51. package/src/coreApi/api/patient/patient.ts +98 -0
  52. package/src/coreApi/api/prescription/alova/apiDefinitions.ts +29 -0
  53. package/src/coreApi/api/prescription/alova/createApis.ts +99 -0
  54. package/src/coreApi/api/prescription/alova/globals.d.ts +959 -0
  55. package/src/coreApi/api/prescription/alova/implement/herbal.ts +48 -0
  56. package/src/coreApi/api/prescription/alova/implement/prescription.ts +45 -0
  57. package/src/coreApi/api/prescription/alova/index.ts +21 -0
  58. package/src/coreApi/api/prescription/herbal.ts +44 -0
  59. package/src/coreApi/api/prescription/prescription.ts +68 -0
  60. package/src/coreApi/api/scientist/alova/apiDefinitions.ts +27 -0
  61. package/src/coreApi/api/scientist/alova/createApis.ts +99 -0
  62. package/src/coreApi/api/scientist/alova/globals.d.ts +438 -0
  63. package/src/coreApi/api/scientist/alova/implement/scientist.ts +29 -0
  64. package/src/coreApi/api/scientist/alova/index.ts +21 -0
  65. package/src/coreApi/api/scientist/scientist.ts +49 -0
  66. package/src/api/test/test.ts +0 -4
@@ -0,0 +1,438 @@
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<Responded, any, RequestConfig, Response, ResponseHeader, L1Cache, L2Cache, SE>,
40
+ any,
41
+ Responded
42
+ >,
43
+ 'params'
44
+ >
45
+ : never;
46
+
47
+ // Extract the return type of transform function that define in $$userConfigMap, if it not exists, use the default type.
48
+ type ExtractUserDefinedTransformed<
49
+ DefinitionKey extends keyof typeof apiDefinitions,
50
+ Default
51
+ > = DefinitionKey extends keyof UserMethodConfigMap
52
+ ? UserMethodConfigMap[DefinitionKey]['transform'] extends (...args: any[]) => any
53
+ ? Awaited<ReturnType<UserMethodConfigMap[DefinitionKey]['transform']>>
54
+ : Default
55
+ : Default;
56
+ type Alova2Method<
57
+ Responded,
58
+ DefinitionKey extends keyof typeof apiDefinitions,
59
+ CurrentConfig extends Alova2MethodConfig<any>
60
+ > =
61
+ CollapsedAlova extends Alova<
62
+ AlovaGenerics<
63
+ any,
64
+ any,
65
+ infer RequestConfig,
66
+ infer Response,
67
+ infer ResponseHeader,
68
+ infer L1Cache,
69
+ infer L2Cache,
70
+ infer SE
71
+ >
72
+ >
73
+ ? Method<
74
+ AlovaGenerics<
75
+ CurrentConfig extends undefined
76
+ ? ExtractUserDefinedTransformed<DefinitionKey, Responded>
77
+ : CurrentConfig['transform'] extends (...args: any[]) => any
78
+ ? Awaited<ReturnType<CurrentConfig['transform']>>
79
+ : ExtractUserDefinedTransformed<DefinitionKey, Responded>,
80
+ any,
81
+ RequestConfig,
82
+ Response,
83
+ ResponseHeader,
84
+ L1Cache,
85
+ L2Cache,
86
+ SE
87
+ >
88
+ >
89
+ : never;
90
+
91
+ export interface ScientistState {
92
+ id?: string;
93
+ name?: string;
94
+ createdTimestamp?: string;
95
+ updatedTimestamp?: string;
96
+ identityNumber?: string;
97
+ gender?: string;
98
+ phoneNumber?: string;
99
+ birthdate?: string;
100
+ }
101
+ export interface SortObject {
102
+ empty?: boolean;
103
+ sorted?: boolean;
104
+ unsorted?: boolean;
105
+ }
106
+ export interface PageableObject {
107
+ offset?: number;
108
+ sort?: SortObject;
109
+ pageSize?: number;
110
+ paged?: boolean;
111
+ pageNumber?: number;
112
+ unpaged?: boolean;
113
+ }
114
+ export interface PageScientistState {
115
+ totalPages?: number;
116
+ totalElements?: number;
117
+ size?: number;
118
+ content?: ScientistState[];
119
+ number?: number;
120
+ sort?: SortObject;
121
+ numberOfElements?: number;
122
+ pageable?: PageableObject;
123
+ first?: boolean;
124
+ last?: boolean;
125
+ empty?: boolean;
126
+ }
127
+ declare global {
128
+ interface scientistApi {
129
+ scientistStateRestful: {
130
+ /**
131
+ * ---
132
+ *
133
+ * [GET]
134
+ *
135
+ * **path:** /科研/服务/{id}
136
+ *
137
+ * ---
138
+ *
139
+ * **Path Parameters**
140
+ * ```ts
141
+ * type PathParameters = {
142
+ * id: string
143
+ * }
144
+ * ```
145
+ *
146
+ * ---
147
+ *
148
+ * **Response**
149
+ * ```ts
150
+ * type Response = {
151
+ * id?: string
152
+ * name?: string
153
+ * createdTimestamp?: string
154
+ * updatedTimestamp?: string
155
+ * identityNumber?: string
156
+ * gender?: string
157
+ * phoneNumber?: string
158
+ * birthdate?: string
159
+ * }
160
+ * ```
161
+ */
162
+ getScientistState<
163
+ Config extends Alova2MethodConfig<ScientistState> & {
164
+ pathParams: {
165
+ id: string;
166
+ };
167
+ }
168
+ >(
169
+ config: Config
170
+ ): Alova2Method<ScientistState, 'scientistStateRestful.getScientistState', Config>;
171
+ /**
172
+ * ---
173
+ *
174
+ * [PUT]
175
+ *
176
+ * **path:** /科研/服务/{id}
177
+ *
178
+ * ---
179
+ *
180
+ * **Path Parameters**
181
+ * ```ts
182
+ * type PathParameters = {
183
+ * id: string
184
+ * }
185
+ * ```
186
+ *
187
+ * ---
188
+ *
189
+ * **RequestBody**
190
+ * ```ts
191
+ * type RequestBody = {
192
+ * id?: string
193
+ * name?: string
194
+ * createdTimestamp?: string
195
+ * updatedTimestamp?: string
196
+ * identityNumber?: string
197
+ * gender?: string
198
+ * phoneNumber?: string
199
+ * birthdate?: string
200
+ * }
201
+ * ```
202
+ *
203
+ * ---
204
+ *
205
+ * **Response**
206
+ * ```ts
207
+ * type Response = {
208
+ * id?: string
209
+ * name?: string
210
+ * createdTimestamp?: string
211
+ * updatedTimestamp?: string
212
+ * identityNumber?: string
213
+ * gender?: string
214
+ * phoneNumber?: string
215
+ * birthdate?: string
216
+ * }
217
+ * ```
218
+ */
219
+ putScientistState<
220
+ Config extends Alova2MethodConfig<ScientistState> & {
221
+ pathParams: {
222
+ id: string;
223
+ };
224
+ data: ScientistState;
225
+ }
226
+ >(
227
+ config: Config
228
+ ): Alova2Method<ScientistState, 'scientistStateRestful.putScientistState', Config>;
229
+ /**
230
+ * ---
231
+ *
232
+ * [DELETE]
233
+ *
234
+ * **path:** /科研/服务/{id}
235
+ *
236
+ * ---
237
+ *
238
+ * **Path Parameters**
239
+ * ```ts
240
+ * type PathParameters = {
241
+ * id: string
242
+ * }
243
+ * ```
244
+ *
245
+ * ---
246
+ *
247
+ * **Response**
248
+ * ```ts
249
+ * type Response = null
250
+ * ```
251
+ */
252
+ deleteScientistState<
253
+ Config extends Alova2MethodConfig<null> & {
254
+ pathParams: {
255
+ id: string;
256
+ };
257
+ }
258
+ >(
259
+ config: Config
260
+ ): Alova2Method<null, 'scientistStateRestful.deleteScientistState', Config>;
261
+ /**
262
+ * ---
263
+ *
264
+ * [GET]
265
+ *
266
+ * **path:** /科研/服务
267
+ *
268
+ * ---
269
+ *
270
+ * **Query Parameters**
271
+ * ```ts
272
+ * type QueryParameters = {
273
+ * name?: string
274
+ * phoneNumber?: string
275
+ * pageSize: number
276
+ * page: number
277
+ * }
278
+ * ```
279
+ *
280
+ * ---
281
+ *
282
+ * **Response**
283
+ * ```ts
284
+ * type Response = {
285
+ * totalPages?: number
286
+ * totalElements?: number
287
+ * size?: number
288
+ * // [items] start
289
+ * // [items] end
290
+ * content?: Array<{
291
+ * id?: string
292
+ * name?: string
293
+ * createdTimestamp?: string
294
+ * updatedTimestamp?: string
295
+ * identityNumber?: string
296
+ * gender?: string
297
+ * phoneNumber?: string
298
+ * birthdate?: string
299
+ * }>
300
+ * number?: number
301
+ * sort?: {
302
+ * empty?: boolean
303
+ * sorted?: boolean
304
+ * unsorted?: boolean
305
+ * }
306
+ * numberOfElements?: number
307
+ * pageable?: {
308
+ * offset?: number
309
+ * sort?: {
310
+ * empty?: boolean
311
+ * sorted?: boolean
312
+ * unsorted?: boolean
313
+ * }
314
+ * pageSize?: number
315
+ * paged?: boolean
316
+ * pageNumber?: number
317
+ * unpaged?: boolean
318
+ * }
319
+ * first?: boolean
320
+ * last?: boolean
321
+ * empty?: boolean
322
+ * }
323
+ * ```
324
+ */
325
+ queryScientistState<
326
+ Config extends Alova2MethodConfig<PageScientistState> & {
327
+ params: {
328
+ name?: string;
329
+ phoneNumber?: string;
330
+ pageSize: number;
331
+ page: number;
332
+ };
333
+ }
334
+ >(
335
+ config: Config
336
+ ): Alova2Method<PageScientistState, 'scientistStateRestful.queryScientistState', Config>;
337
+ /**
338
+ * ---
339
+ *
340
+ * [POST]
341
+ *
342
+ * **path:** /科研/服务
343
+ *
344
+ * ---
345
+ *
346
+ * **RequestBody**
347
+ * ```ts
348
+ * type RequestBody = {
349
+ * id?: string
350
+ * name?: string
351
+ * createdTimestamp?: string
352
+ * updatedTimestamp?: string
353
+ * identityNumber?: string
354
+ * gender?: string
355
+ * phoneNumber?: string
356
+ * birthdate?: string
357
+ * }
358
+ * ```
359
+ *
360
+ * ---
361
+ *
362
+ * **Response**
363
+ * ```ts
364
+ * type Response = {
365
+ * id?: string
366
+ * name?: string
367
+ * createdTimestamp?: string
368
+ * updatedTimestamp?: string
369
+ * identityNumber?: string
370
+ * gender?: string
371
+ * phoneNumber?: string
372
+ * birthdate?: string
373
+ * }
374
+ * ```
375
+ */
376
+ postScientistState<
377
+ Config extends Alova2MethodConfig<ScientistState> & {
378
+ data: ScientistState;
379
+ }
380
+ >(
381
+ config: Config
382
+ ): Alova2Method<ScientistState, 'scientistStateRestful.postScientistState', Config>;
383
+ /**
384
+ * ---
385
+ *
386
+ * [GET]
387
+ *
388
+ * **path:** /科研/服务/统计/科研/日期
389
+ *
390
+ * ---
391
+ *
392
+ * **Response**
393
+ * ```ts
394
+ * type Response = null[][]
395
+ * ```
396
+ */
397
+ datesOfScientist<Config extends Alova2MethodConfig<null[][]>>(
398
+ config?: Config
399
+ ): Alova2Method<null[][], 'scientistStateRestful.datesOfScientist', Config>;
400
+ /**
401
+ * ---
402
+ *
403
+ * [GET]
404
+ *
405
+ * **path:** /科研/服务/统计/科研/总数
406
+ *
407
+ * ---
408
+ *
409
+ * **Response**
410
+ * ```ts
411
+ * type Response = number
412
+ * ```
413
+ */
414
+ totalOfScientist<Config extends Alova2MethodConfig<number>>(
415
+ config?: Config
416
+ ): Alova2Method<number, 'scientistStateRestful.totalOfScientist', Config>;
417
+ /**
418
+ * ---
419
+ *
420
+ * [GET]
421
+ *
422
+ * **path:** /科研/服务/统计/科研/今日
423
+ *
424
+ * ---
425
+ *
426
+ * **Response**
427
+ * ```ts
428
+ * type Response = number
429
+ * ```
430
+ */
431
+ todayOfScientistByToday<Config extends Alova2MethodConfig<number>>(
432
+ config?: Config
433
+ ): Alova2Method<number, 'scientistStateRestful.todayOfScientistByToday', Config>;
434
+ };
435
+ }
436
+
437
+ var scientistApi: scientistApi;
438
+ }
@@ -0,0 +1,29 @@
1
+ import { Scientist } from 'src/api/scientist/scientist';
2
+
3
+ export class AlovaScientist extends Scientist{
4
+
5
+ override async get() {
6
+ return this.of(await scientistApi.scientistStateRestful.getScientistState({
7
+ pathParams: {
8
+ id: this.id,
9
+ },
10
+ async transform(res) {
11
+ return new AlovaScientist().of(res);
12
+ },
13
+ }).send());
14
+ }
15
+
16
+ override async put() {
17
+ return this.of(await scientistApi.scientistStateRestful.putScientistState({
18
+ pathParams: {
19
+ id: this.id,
20
+ },
21
+ data: this.state(),
22
+ }).send(true));
23
+ }
24
+ async post() {
25
+ return this.of(await scientistApi.scientistStateRestful.postScientistState({
26
+ data: this.state()
27
+ }).send(true));
28
+ }
29
+ }
@@ -0,0 +1,21 @@
1
+ import { createAlova } from 'alova';
2
+ import fetchAdapter from 'alova/fetch';
3
+ import { createApis, withConfigType, mountApis } from './createApis';
4
+ import { onAuthRequired, responded } from 'src/api/config/alova';
5
+ import { getServiceEndpoint, ServiceType } from 'src/api/config';
6
+
7
+ export const alovaInstance = createAlova({
8
+ baseURL: getServiceEndpoint(ServiceType.Scientist),
9
+ requestAdapter: fetchAdapter(),
10
+ beforeRequest: onAuthRequired(() => {}),
11
+ cacheFor: null,
12
+ responded: responded
13
+ });
14
+
15
+ export const $$userConfigMap = withConfigType({});
16
+
17
+ const Apis = createApis(alovaInstance, $$userConfigMap);
18
+
19
+ mountApis(Apis);
20
+
21
+ export default Apis;
@@ -0,0 +1,49 @@
1
+ import { NetworkObject } from 'src/api/patient/core';
2
+ import type { IBuilder } from 'builder-pattern';
3
+ import { Builder } from 'builder-pattern';
4
+ import type { ScientistState } from 'src/api/scientist/alova/globals';
5
+ import { getName } from 'src/util/string';
6
+
7
+ export abstract class Scientist extends NetworkObject{
8
+ static override builder(): IBuilder<Scientist>{
9
+ return Builder(this._default) as unknown as IBuilder<Scientist>;
10
+ }
11
+ static override default(): typeof Scientist {
12
+ return this._default as unknown as typeof Scientist;
13
+ }
14
+ id: string = '';
15
+ name: string = '';
16
+ createdTimestamp: string = '';
17
+ updatedTimestamp: string = '';
18
+ gender: string = '';
19
+ identityNumber: string = '';
20
+ phoneNumber: string = '';
21
+ birthdate: string = '';
22
+
23
+ override of(json: ScientistState){
24
+ if(json.id != undefined)this.id = json.id;
25
+ if(json.name != undefined)this.name = getName(json.name);
26
+ if(json.gender != undefined)this.gender = json.gender;
27
+ if(json.identityNumber != undefined)this.identityNumber = json.identityNumber;
28
+ if(json.phoneNumber != undefined)this.phoneNumber = json.phoneNumber;
29
+ if(json.birthdate != undefined)this.birthdate = json.birthdate;
30
+ if(json.createdTimestamp != undefined)this.createdTimestamp = json.createdTimestamp;
31
+ if(json.updatedTimestamp != undefined)this.updatedTimestamp = json.updatedTimestamp;
32
+ return Promise.resolve(this);
33
+ }
34
+ override state(){
35
+ return {
36
+ id: this.id,
37
+ name: this.name,
38
+ createdTimestamp: this.createdTimestamp,
39
+ updatedTimestamp: this.updatedTimestamp,
40
+ gender: this.gender,
41
+ identityNumber: this.identityNumber,
42
+ phoneNumber: this.phoneNumber,
43
+ birthdate: this.birthdate,
44
+ } as ScientistState
45
+ }
46
+ abstract get(): Promise<this>
47
+ abstract put(): Promise<this>
48
+ abstract post(): Promise<this>;
49
+ }
@@ -1,4 +0,0 @@
1
- export function isNumber(value: any): value is number {
2
- console.log("OvO");
3
- return typeof value === 'number'
4
- }