@shaxpir/duiduidui-models 1.9.30 → 1.9.31

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.
@@ -40,6 +40,24 @@ export declare class Logger {
40
40
  withClientServiceName(serviceName: string): Logger;
41
41
  withClientNodeName(nodeName: string): Logger;
42
42
  withClientVersion(version: string): Logger;
43
+ withPlatform(platform: string): Logger;
44
+ withDeviceModel(model: string): Logger;
45
+ withDeviceBrand(brand: string): Logger;
46
+ withOsVersion(version: string): Logger;
47
+ withScreenWidth(width: number): Logger;
48
+ withScreenHeight(height: number): Logger;
49
+ withPixelRatio(ratio: number): Logger;
50
+ withLocale(locale: string): Logger;
51
+ withTimezone(timezone: string): Logger;
52
+ withIsTablet(isTablet: boolean): Logger;
53
+ withDeviceYearClass(yearClass: number): Logger;
54
+ withQueryName(queryName: string): Logger;
55
+ withResultCount(count: number): Logger;
56
+ withRowCount(count: number): Logger;
57
+ withRequestedCount(count: number): Logger;
58
+ withFromCache(fromCache: boolean): Logger;
59
+ withSearchQuery(query: string): Logger;
60
+ withSuccess(success: boolean): Logger;
43
61
  withTopic(topic: string): Logger;
44
62
  withSubtopic(subtopic: string): Logger;
45
63
  withName(name: string): Logger;
@@ -79,6 +97,24 @@ export interface LogFields {
79
97
  client_service_name?: string;
80
98
  client_node_name?: string;
81
99
  client_version?: string;
100
+ platform?: string;
101
+ device_model?: string;
102
+ device_brand?: string;
103
+ os_version?: string;
104
+ screen_width?: number;
105
+ screen_height?: number;
106
+ pixel_ratio?: number;
107
+ locale?: string;
108
+ timezone?: string;
109
+ is_tablet?: boolean;
110
+ device_year_class?: number;
111
+ query_name?: string;
112
+ result_count?: number;
113
+ row_count?: number;
114
+ requested_count?: number;
115
+ from_cache?: boolean;
116
+ search_query?: string;
117
+ success?: boolean;
82
118
  context?: string;
83
119
  name?: string;
84
120
  topic?: string;
@@ -139,6 +139,78 @@ class Logger {
139
139
  this.withField('client_version', version);
140
140
  return this;
141
141
  }
142
+ withPlatform(platform) {
143
+ this.withField('platform', platform);
144
+ return this;
145
+ }
146
+ withDeviceModel(model) {
147
+ this.withField('device_model', model);
148
+ return this;
149
+ }
150
+ withDeviceBrand(brand) {
151
+ this.withField('device_brand', brand);
152
+ return this;
153
+ }
154
+ withOsVersion(version) {
155
+ this.withField('os_version', version);
156
+ return this;
157
+ }
158
+ withScreenWidth(width) {
159
+ this.withField('screen_width', width);
160
+ return this;
161
+ }
162
+ withScreenHeight(height) {
163
+ this.withField('screen_height', height);
164
+ return this;
165
+ }
166
+ withPixelRatio(ratio) {
167
+ this.withField('pixel_ratio', ratio);
168
+ return this;
169
+ }
170
+ withLocale(locale) {
171
+ this.withField('locale', locale);
172
+ return this;
173
+ }
174
+ withTimezone(timezone) {
175
+ this.withField('timezone', timezone);
176
+ return this;
177
+ }
178
+ withIsTablet(isTablet) {
179
+ this.withField('is_tablet', isTablet);
180
+ return this;
181
+ }
182
+ withDeviceYearClass(yearClass) {
183
+ this.withField('device_year_class', yearClass);
184
+ return this;
185
+ }
186
+ withQueryName(queryName) {
187
+ this.withField('query_name', queryName);
188
+ return this;
189
+ }
190
+ withResultCount(count) {
191
+ this.withField('result_count', count);
192
+ return this;
193
+ }
194
+ withRowCount(count) {
195
+ this.withField('row_count', count);
196
+ return this;
197
+ }
198
+ withRequestedCount(count) {
199
+ this.withField('requested_count', count);
200
+ return this;
201
+ }
202
+ withFromCache(fromCache) {
203
+ this.withField('from_cache', fromCache);
204
+ return this;
205
+ }
206
+ withSearchQuery(query) {
207
+ this.withField('search_query', query);
208
+ return this;
209
+ }
210
+ withSuccess(success) {
211
+ this.withField('success', success);
212
+ return this;
213
+ }
142
214
  withTopic(topic) {
143
215
  this.withField('topic', topic);
144
216
  return this;
@@ -347,6 +419,14 @@ class Logger {
347
419
  case 'client_service_name':
348
420
  case 'client_node_name':
349
421
  case 'client_version':
422
+ case 'platform':
423
+ case 'device_model':
424
+ case 'device_brand':
425
+ case 'os_version':
426
+ case 'locale':
427
+ case 'timezone':
428
+ case 'query_name':
429
+ case 'search_query':
350
430
  case 'context':
351
431
  case 'topic':
352
432
  case 'subtopic':
@@ -386,6 +466,9 @@ class Logger {
386
466
  case 'using_jwt':
387
467
  case 'using_pass_hash':
388
468
  case 'ignore_conflict':
469
+ case 'is_tablet':
470
+ case 'from_cache':
471
+ case 'success':
389
472
  if (value != null && value != undefined && typeof value !== 'boolean') {
390
473
  ;
391
474
  throw new Error(Logger.makeTypeErrorMessage(key, value, 'boolean'));
@@ -396,6 +479,13 @@ class Logger {
396
479
  case 'duration_millis':
397
480
  case 'file_size':
398
481
  case 'doc_version':
482
+ case 'screen_width':
483
+ case 'screen_height':
484
+ case 'pixel_ratio':
485
+ case 'device_year_class':
486
+ case 'result_count':
487
+ case 'row_count':
488
+ case 'requested_count':
399
489
  if (value != null && value != undefined && typeof value !== 'number') {
400
490
  throw new Error(Logger.makeTypeErrorMessage(key, value, 'number'));
401
491
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.9.30",
3
+ "version": "1.9.31",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"