shcp-api-lib 1.0.0

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 (78) hide show
  1. package/README.md +74 -0
  2. package/dist/index.d.ts +5660 -0
  3. package/dist/index.esm.js +2954 -0
  4. package/dist/index.esm.js.map +1 -0
  5. package/dist/index.js +3038 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/types/src/api/app-client-api.d.ts +12 -0
  8. package/dist/types/src/api/app-client-page-config-api.d.ts +5 -0
  9. package/dist/types/src/api/app-client-setting-api.d.ts +5 -0
  10. package/dist/types/src/api/common-dict-api.d.ts +40 -0
  11. package/dist/types/src/api/common-file-api.d.ts +5 -0
  12. package/dist/types/src/api/common-right-api.d.ts +60 -0
  13. package/dist/types/src/api/consumer-api.d.ts +39 -0
  14. package/dist/types/src/api/consumer-bind-api.d.ts +15 -0
  15. package/dist/types/src/api/consumer-device-api.d.ts +24 -0
  16. package/dist/types/src/api/consumer-favorite-api.d.ts +8 -0
  17. package/dist/types/src/api/device-api.d.ts +19 -0
  18. package/dist/types/src/api/device-user-api.d.ts +29 -0
  19. package/dist/types/src/api/disease-care-right-api.d.ts +22 -0
  20. package/dist/types/src/api/health-common-api.d.ts +15 -0
  21. package/dist/types/src/api/health-metric-api.d.ts +9 -0
  22. package/dist/types/src/api/health-profile-api.d.ts +8 -0
  23. package/dist/types/src/api/health-self-assess-api.d.ts +8 -0
  24. package/dist/types/src/api/health-study-right-api.d.ts +23 -0
  25. package/dist/types/src/api/health-tool-api.d.ts +14 -0
  26. package/dist/types/src/api/help-center.d.ts +4 -0
  27. package/dist/types/src/api/im-user-api.d.ts +7 -0
  28. package/dist/types/src/api/index.d.ts +32 -0
  29. package/dist/types/src/api/km-article-api.d.ts +9 -0
  30. package/dist/types/src/api/km-form-api.d.ts +10 -0
  31. package/dist/types/src/api/km-form-rule-relation-api.d.ts +6 -0
  32. package/dist/types/src/api/login-api.d.ts +18 -0
  33. package/dist/types/src/api/marketing-api.d.ts +16 -0
  34. package/dist/types/src/api/message-record-api.d.ts +7 -0
  35. package/dist/types/src/api/mine-api.d.ts +8 -0
  36. package/dist/types/src/api/right-qrcode-api.d.ts +9 -0
  37. package/dist/types/src/api/right-service-config-api.d.ts +18 -0
  38. package/dist/types/src/api/system-right-api.d.ts +17 -0
  39. package/dist/types/src/api/user-group-api.d.ts +11 -0
  40. package/dist/types/src/constants/km-const.d.ts +59 -0
  41. package/dist/types/src/constants/metric.d.ts +17 -0
  42. package/dist/types/src/constants/qiniuUploader.d.ts +49 -0
  43. package/dist/types/src/constants/shcp-common.d.ts +428 -0
  44. package/dist/types/src/index.d.ts +4 -0
  45. package/dist/types/src/shcp-api-sdk.d.ts +26 -0
  46. package/dist/types/src/type/model/app-client-model.d.ts +138 -0
  47. package/dist/types/src/type/model/app-client-setting-model.d.ts +46 -0
  48. package/dist/types/src/type/model/blade-system-model.d.ts +34 -0
  49. package/dist/types/src/type/model/common-dict-model.d.ts +100 -0
  50. package/dist/types/src/type/model/common-file-model.d.ts +10 -0
  51. package/dist/types/src/type/model/common-model.d.ts +9 -0
  52. package/dist/types/src/type/model/common-right-model.d.ts +929 -0
  53. package/dist/types/src/type/model/consumer-bind-model.d.ts +175 -0
  54. package/dist/types/src/type/model/consumer-device-model.d.ts +114 -0
  55. package/dist/types/src/type/model/consumer-favorite-model.d.ts +105 -0
  56. package/dist/types/src/type/model/consumer-model.d.ts +214 -0
  57. package/dist/types/src/type/model/device-model.d.ts +295 -0
  58. package/dist/types/src/type/model/device-user-model.d.ts +53 -0
  59. package/dist/types/src/type/model/health-care-config-model.d.ts +301 -0
  60. package/dist/types/src/type/model/health-metric-model.d.ts +181 -0
  61. package/dist/types/src/type/model/health-profile-model.d.ts +83 -0
  62. package/dist/types/src/type/model/health-self-assess-model.d.ts +35 -0
  63. package/dist/types/src/type/model/health-tool-model.d.ts +105 -0
  64. package/dist/types/src/type/model/im-user-model.d.ts +44 -0
  65. package/dist/types/src/type/model/index.d.ts +30 -0
  66. package/dist/types/src/type/model/km-article-model.d.ts +275 -0
  67. package/dist/types/src/type/model/km-form-model.d.ts +745 -0
  68. package/dist/types/src/type/model/km-form-rule-relation-model.d.ts +31 -0
  69. package/dist/types/src/type/model/login-model.d.ts +90 -0
  70. package/dist/types/src/type/model/marketing-model.d.ts +142 -0
  71. package/dist/types/src/type/model/message-record-model.d.ts +59 -0
  72. package/dist/types/src/type/model/mine-model.d.ts +100 -0
  73. package/dist/types/src/type/model/right-qrcode-model.d.ts +143 -0
  74. package/dist/types/src/type/model/right-service-config-model.d.ts +2 -0
  75. package/dist/types/src/type/model/system-right-model.d.ts +134 -0
  76. package/dist/types/src/type/model/user-group-model.d.ts +45 -0
  77. package/dist/types/src/type/net-types.d.ts +37 -0
  78. package/package.json +47 -0
@@ -0,0 +1,181 @@
1
+ import { HealthServiceType, ServiceTaskCategory } from '../../constants/shcp-common';
2
+ import type { PageRequest } from './common-model';
3
+ export declare enum AggregateType {
4
+ BY_COUNT = 1,// 按次聚合
5
+ BY_DAY = 2,// 按天聚合
6
+ BY_HOUR = 3,// 按小时聚合
7
+ Unknown = 99
8
+ }
9
+ export interface HealthMetricTrendDTO {
10
+ consumerId: number;
11
+ tagId: number;
12
+ tagName: string;
13
+ unit: string;
14
+ aggregateType: AggregateType;
15
+ details: Detail[];
16
+ aggregation: Aggregation;
17
+ }
18
+ export interface Detail {
19
+ value: string | number;
20
+ max: string | number;
21
+ min: string | number;
22
+ eventTime: string;
23
+ }
24
+ export interface Aggregation {
25
+ avg: string;
26
+ max: string;
27
+ min: string;
28
+ count: number;
29
+ }
30
+ export interface HealthMetricTrendQuery {
31
+ consumerId: number | string;
32
+ tagIds: number[];
33
+ aggregateType: AggregateType;
34
+ eventTimeMin: string;
35
+ eventTimeMax: string;
36
+ }
37
+ /**
38
+ * 健康档案指标查询请求
39
+ */
40
+ export interface HealthMetricQuery extends PageRequest {
41
+ /**
42
+ * 消费者ID
43
+ */
44
+ consumerId: number | string;
45
+ /**
46
+ * 所属业务租户ID
47
+ */
48
+ tenantId?: string;
49
+ /**
50
+ * 指标更新的日志ID
51
+ */
52
+ logIds?: Set<number>;
53
+ /**
54
+ * 指标标签ID
55
+ */
56
+ tagIds?: Set<number>;
57
+ /**
58
+ * 业务时间最小值
59
+ */
60
+ eventTimeMin?: string;
61
+ /**
62
+ * 业务时间最大值
63
+ */
64
+ eventTimeMax?: string;
65
+ /**
66
+ * 是否查询指标的最新值
67
+ */
68
+ queryLatest?: boolean;
69
+ }
70
+ export interface HealthMetricDTO {
71
+ id: number;
72
+ consumerId: number;
73
+ tenantId: string;
74
+ logId: number;
75
+ tagId: number;
76
+ tagName: string;
77
+ tagCategoryId: number;
78
+ value: string;
79
+ unit: string;
80
+ eventTime?: string;
81
+ createTime?: string;
82
+ updateTime?: string;
83
+ }
84
+ export interface HealthMetricLogDTO {
85
+ id: number;
86
+ tenantId: string;
87
+ consumerId: number;
88
+ rightId: number;
89
+ serviceType: HealthServiceType;
90
+ flowId: number;
91
+ flowName: string;
92
+ taskCategory: ServiceTaskCategory;
93
+ taskId: number;
94
+ taskName: string;
95
+ remark: string;
96
+ eventTime: string;
97
+ createTime: string;
98
+ updateTime: string;
99
+ }
100
+ export interface BloodPressureLevelRange {
101
+ sort: number;
102
+ SBP: number[];
103
+ DBP: number[];
104
+ desc: string;
105
+ name: string;
106
+ tag: string;
107
+ color: string;
108
+ }
109
+ export interface BloodOxygenLevelRange {
110
+ sort: number;
111
+ value: number[];
112
+ desc: string;
113
+ name: string;
114
+ tag: string;
115
+ color: string;
116
+ }
117
+ export interface HeartRateLevelRange extends BloodOxygenLevelRange {
118
+ }
119
+ export interface BloodPressureMetricInfo {
120
+ time: Date;
121
+ DBP: number;
122
+ dbpLevel: BloodPressureLevelRange;
123
+ SBP: number;
124
+ sbpLevel: BloodPressureLevelRange;
125
+ }
126
+ export interface HeartRateMetricInfo {
127
+ time: string;
128
+ max: number | string;
129
+ min: number | string;
130
+ avg: number | string;
131
+ avgLevel: HeartRateLevelRange;
132
+ minLevel: HeartRateLevelRange;
133
+ maxLevel: HeartRateLevelRange;
134
+ }
135
+ export interface StepsMetricInfo {
136
+ time: string;
137
+ total: number | string;
138
+ }
139
+ export interface BloodOxygenMetricInfo {
140
+ time: Date;
141
+ max: number;
142
+ min: number;
143
+ avg: number;
144
+ avgLevel: BloodOxygenLevelRange;
145
+ minLevel: BloodOxygenLevelRange;
146
+ maxLevel: BloodOxygenLevelRange;
147
+ }
148
+ export interface BloodPressureExceptionInfo {
149
+ exceptionCount: number;
150
+ count: number;
151
+ normalTooHeight: number;
152
+ mildTooHeight: number;
153
+ moderateTooHeight: number;
154
+ severeTooHeight: number;
155
+ hypotension: number;
156
+ rangeDesc?: string[];
157
+ }
158
+ export interface HeartRateExceptionInfo {
159
+ exceptionCount: number;
160
+ count: number;
161
+ tooHeight: number;
162
+ tooLow: number;
163
+ rangeDesc?: string[];
164
+ }
165
+ export interface BloodOxygenExceptionInfo {
166
+ exceptionCount: number;
167
+ count: number;
168
+ tooHeight: number;
169
+ tooLow: number;
170
+ rangeDesc?: string[];
171
+ }
172
+ export type MetricRecordInfo = HeartRateMetricInfo | BloodOxygenMetricInfo | BloodPressureMetricInfo | StepsMetricInfo;
173
+ export type MetricExceptionInfo = BloodPressureExceptionInfo | HeartRateExceptionInfo | BloodOxygenExceptionInfo;
174
+ export interface MetricTrendInfo {
175
+ records: MetricRecordInfo[];
176
+ orgRecords?: MetricRecordInfo[];
177
+ stastic?: Aggregation;
178
+ exception?: MetricExceptionInfo;
179
+ }
180
+ export interface HealthMetric {
181
+ }
@@ -0,0 +1,83 @@
1
+ import { FileType, HealthRecordType, ServiceTaskCategory, ServiceTaskStatus } from '../../constants/shcp-common';
2
+ import { KMForm } from './km-form-model';
3
+ import type { Operator, ServiceTaskRequests } from './common-right-model';
4
+ export interface BaseProfileTaskDTO {
5
+ /**
6
+ * 任务ID
7
+ */
8
+ id: number;
9
+ /**
10
+ * 任务名称
11
+ */
12
+ name: string;
13
+ /**
14
+ * 指标对应的填写表单
15
+ */
16
+ form: KMForm.FormResultDTO;
17
+ }
18
+ export interface DiaryTaskSubmit extends ServiceTaskRequests.Submit {
19
+ }
20
+ export interface DiaryTaskFetch {
21
+ /** 消费者Id */
22
+ consumerId: number | string;
23
+ /** 指标上报使用的分类名称,如:饮食/饮酒/血压等 */
24
+ categoryName: string;
25
+ /** 操作人信息 */
26
+ operator: Operator;
27
+ /** 任务ID */
28
+ taskId?: number | string;
29
+ /** 权益ID */
30
+ rightId?: number | string;
31
+ }
32
+ export interface DiaryTaskDTO {
33
+ /** 任务ID */
34
+ id: number;
35
+ /** 任务名称 */
36
+ name: string;
37
+ /** 指标对应的填写表单 */
38
+ form: KMForm.FormResultDTO;
39
+ /** 任务当前状态 */
40
+ status: ServiceTaskStatus;
41
+ }
42
+ export interface ReportTaskDTO {
43
+ /** 任务ID */
44
+ id: number;
45
+ /** 任务名称 */
46
+ name: string;
47
+ /** 任务当前状态 */
48
+ status: ServiceTaskStatus;
49
+ context: {
50
+ recordType: HealthRecordType;
51
+ remark?: string;
52
+ records: HealthRecord[];
53
+ };
54
+ }
55
+ export interface ReportTaskSubmit {
56
+ /** 消费者Id */
57
+ consumerId: number | string;
58
+ /** 医疗记录的类型 */
59
+ recordType: HealthRecordType;
60
+ /** 权益ID */
61
+ rightId: number | string;
62
+ /** 医疗记录的列表 */
63
+ records: HealthRecord[];
64
+ /** 上传备注 */
65
+ remark: string;
66
+ /** 操作人信息 */
67
+ operator: Operator;
68
+ }
69
+ export interface ReportTaskFetch extends ServiceTaskRequests.Fetch {
70
+ category: ServiceTaskCategory;
71
+ }
72
+ export interface HealthRecord {
73
+ /** 医疗记录的类型 */
74
+ recordType: HealthRecordType;
75
+ /** 医疗记录产生的时间 */
76
+ recordTime: string;
77
+ /** 上传的文件名称 */
78
+ fileName: string;
79
+ /** 上传的文件Url */
80
+ fileUrl: string;
81
+ /** 上传的文件类型 */
82
+ fileType: FileType;
83
+ }
@@ -0,0 +1,35 @@
1
+ import type { ServiceTaskStatus } from '../../constants/shcp-common';
2
+ import type { KMForm } from './km-form-model';
3
+ import type { RightServiceConfigDTO } from './health-care-config-model';
4
+ export interface AssessmentTaskDTO {
5
+ /** 任务ID */
6
+ id: number;
7
+ /** 任务名称 */
8
+ name: string;
9
+ /** 任务当前状态 */
10
+ status: ServiceTaskStatus;
11
+ /** 任务关联的评估表单 */
12
+ form: KMForm.FormResultDTO;
13
+ /** 权益配置信息 */
14
+ config: HealthSelfAssessmentConfigDTO;
15
+ /** 任务流程记录 */
16
+ result: AssessmentResultDTO;
17
+ }
18
+ export interface HealthSelfAssessmentConfigDTO extends RightServiceConfigDTO {
19
+ /** 自测关联的表单ID */
20
+ formId: number;
21
+ /** 自测关联的表单名称 */
22
+ formName: string;
23
+ /** 自测关联的规则ID */
24
+ ruleId: number;
25
+ /** 自测表单题目的总分 */
26
+ totalScore: string;
27
+ }
28
+ export interface AssessmentResultDTO {
29
+ /** 总得分 */
30
+ totalScore: number;
31
+ /** 自测结果 */
32
+ resultDescription: string;
33
+ /** 建议 */
34
+ suggestion: string;
35
+ }
@@ -0,0 +1,105 @@
1
+ import { ServiceStartRequest } from './common-right-model';
2
+ import { RightServiceConfigDTO } from './health-care-config-model';
3
+ /**
4
+ * 文章分类
5
+ */
6
+ export interface ArticleCategory {
7
+ /**
8
+ * 分类名称
9
+ */
10
+ categoryName?: string;
11
+ /**
12
+ * 描述
13
+ */
14
+ remark?: string;
15
+ /**
16
+ * 封面图地址
17
+ */
18
+ coverUrl?: string;
19
+ /**
20
+ * 文章列表
21
+ */
22
+ articleItems?: ArticleItem[];
23
+ }
24
+ /**
25
+ * 文章列表
26
+ */
27
+ export interface ArticleItem {
28
+ /**
29
+ * 图标地址
30
+ */
31
+ iconUrl?: string;
32
+ /**
33
+ * 标题
34
+ */
35
+ title?: string;
36
+ /**
37
+ * 文章id
38
+ */
39
+ articleId?: string;
40
+ /**
41
+ * 副标题
42
+ */
43
+ subTitle?: string;
44
+ }
45
+ /**
46
+ * 健康工具类配置
47
+ */
48
+ export interface HealthToolConfigDTO extends RightServiceConfigDTO {
49
+ /**
50
+ * 工具页面链接的类型,取值: localPage/wxMiniProgram/h5Page
51
+ */
52
+ linkType?: string;
53
+ /**
54
+ * 工具对应的页面地址
55
+ */
56
+ linkUrl?: string;
57
+ /**
58
+ * 其他配置信息
59
+ */
60
+ others?: Record<string, any>;
61
+ /**
62
+ * 文章分类
63
+ */
64
+ articleCategories?: ArticleCategory[];
65
+ }
66
+ /**
67
+ * 健康工具.任务DTO对象
68
+ */
69
+ export interface HealthToolTaskDTO {
70
+ /**
71
+ * 配置信息
72
+ */
73
+ config?: HealthToolConfigDTO;
74
+ }
75
+ /**
76
+ * 健康工具任务发起请求
77
+ */
78
+ export interface HealthToolTaskStart extends ServiceStartRequest {
79
+ }
80
+ /**
81
+ * 健康工具任务获取请求
82
+ */
83
+ export interface HealthToolTaskFetch {
84
+ /**
85
+ * 权益ID
86
+ */
87
+ rightId?: number | string;
88
+ /**
89
+ * 用户id
90
+ */
91
+ consumerId?: number | string;
92
+ }
93
+ /**
94
+ * 健康工具.任务发起DTO对象
95
+ */
96
+ export interface HealthToolTaskStartDTO {
97
+ /**
98
+ * 工具页面链接的类型,取值: localPage/wxMiniProgram/h5Page
99
+ */
100
+ linkType?: string;
101
+ /**
102
+ * 工具对应的页面地址
103
+ */
104
+ linkUrl?: string;
105
+ }
@@ -0,0 +1,44 @@
1
+ import type { ShcpUserType } from '../../constants/shcp-common';
2
+ import type { ConsumerDTO } from './consumer-model';
3
+ import type { UserDTO } from './blade-system-model';
4
+ import type { RightDTO } from './common-right-model';
5
+ export interface IMUserRequest {
6
+ /**
7
+ * shcp用户id
8
+ */
9
+ shcpUserId: number | string;
10
+ /**
11
+ * 用户类型 1.C端消费用户、2.C端设备用户、3.租户端用户、4.系统
12
+ */
13
+ userType: ShcpUserType;
14
+ /**
15
+ * 用户登录时的终端类型 1:iOS,2:Android,3:Windows,4:OSX,5:WEB,6:小程序,7:linux,8:AndroidPad,9:IPad,10:Admin
16
+ */
17
+ platformID?: number;
18
+ /**
19
+ * IM用户id
20
+ */
21
+ userID?: string;
22
+ }
23
+ export interface IMUserDTO {
24
+ /** shcp用户ID */
25
+ shcpUserId: number;
26
+ /** 用户类型 1.C端消费用户、2.C端设备用户、3.租户端用户、4.系统 */
27
+ userType: ShcpUserType;
28
+ /** IM用户id */
29
+ imUserId: string;
30
+ /** IM用户token */
31
+ token: string;
32
+ /** IM用户token过期时间 */
33
+ expireTimeSeconds: number;
34
+ /** consumer用户信息 */
35
+ consumer?: ConsumerDTO;
36
+ /** tenantUser用户信息 */
37
+ tenantUser?: UserDTO;
38
+ /** 参加的权益列表 */
39
+ rights?: RightDTO[];
40
+ }
41
+ export interface IMUserQuery {
42
+ /** IM用户ids */
43
+ imUserIds: string[];
44
+ }
@@ -0,0 +1,30 @@
1
+ export * from './app-client-model';
2
+ export * from './app-client-setting-model';
3
+ export * from './blade-system-model';
4
+ export * from './common-dict-model';
5
+ export * from './common-model';
6
+ export * from './common-right-model';
7
+ export * from './common-file-model';
8
+ export * from './consumer-bind-model';
9
+ export * from './consumer-device-model';
10
+ export * from './consumer-favorite-model';
11
+ export * from './consumer-model';
12
+ export * from './device-model';
13
+ export * from './device-user-model';
14
+ export * from './health-care-config-model';
15
+ export * from './health-metric-model';
16
+ export * from './health-profile-model';
17
+ export * from './health-self-assess-model';
18
+ export * from './health-tool-model';
19
+ export * from './im-user-model';
20
+ export * from './km-article-model';
21
+ export * from './km-form-model';
22
+ export * from './km-form-rule-relation-model';
23
+ export * from './login-model';
24
+ export * from './marketing-model';
25
+ export * from './message-record-model';
26
+ export * from './mine-model';
27
+ export * from './right-qrcode-model';
28
+ export * from './right-service-config-model';
29
+ export * from './system-right-model';
30
+ export * from './user-group-model';