openchs-models 1.33.2 → 1.33.4

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 (153) hide show
  1. package/.circleci/config.yml +15 -5
  2. package/.commit-message.txt +21 -0
  3. package/.nvmrc +1 -1
  4. package/Makefile +32 -10
  5. package/REALM_V12_NOTES.md +46 -0
  6. package/dist/AbstractEncounter.js +4 -105
  7. package/dist/AddressLevel.js +5 -62
  8. package/dist/ApprovalStatus.js +4 -17
  9. package/dist/BaseEntity.js +5 -42
  10. package/dist/BeneficiaryModePin.js +4 -13
  11. package/dist/Checklist.js +6 -52
  12. package/dist/ChecklistDetail.js +4 -22
  13. package/dist/ChecklistItem.js +16 -96
  14. package/dist/ChecklistItemDetail.js +4 -43
  15. package/dist/ChecklistItemStatus.js +4 -33
  16. package/dist/Comment.js +6 -51
  17. package/dist/CommentThread.js +4 -26
  18. package/dist/CompositeDuration.js +1 -18
  19. package/dist/Concept.js +5 -107
  20. package/dist/ConceptAnswer.js +4 -21
  21. package/dist/CustomDashboardCache.js +4 -38
  22. package/dist/CustomFilter.js +5 -15
  23. package/dist/Dashboard.js +4 -23
  24. package/dist/DashboardCache.js +4 -23
  25. package/dist/DashboardSection.js +4 -24
  26. package/dist/DashboardSectionCardMapping.js +4 -21
  27. package/dist/Displayable.js +3 -11
  28. package/dist/Documentation.js +4 -21
  29. package/dist/DocumentationItem.js +4 -20
  30. package/dist/Duration.js +4 -39
  31. package/dist/Encounter.js +6 -41
  32. package/dist/EncounterType.js +4 -26
  33. package/dist/EntityApprovalStatus.js +6 -56
  34. package/dist/EntityMetaData.js +7 -105
  35. package/dist/EntityQueue.js +4 -15
  36. package/dist/EntityRule.js +1 -29
  37. package/dist/EntitySyncStatus.js +4 -19
  38. package/dist/Extension.js +4 -18
  39. package/dist/Family.js +4 -56
  40. package/dist/FileFormat.js +0 -7
  41. package/dist/Gender.js +4 -17
  42. package/dist/GroupDashboard.js +4 -23
  43. package/dist/GroupPrivileges.js +4 -28
  44. package/dist/GroupRole.js +4 -34
  45. package/dist/GroupSubject.js +6 -59
  46. package/dist/Groups.js +4 -14
  47. package/dist/Identifier.js +4 -20
  48. package/dist/IdentifierAssignment.js +6 -45
  49. package/dist/IdentifierSource.js +4 -15
  50. package/dist/Individual.js +17 -265
  51. package/dist/LocaleMapping.js +4 -13
  52. package/dist/LocationHierarchy.js +4 -25
  53. package/dist/Media.js +35 -35
  54. package/dist/MediaQueue.js +4 -26
  55. package/dist/MigrationsHelper.js +15 -22
  56. package/dist/MyGroups.js +4 -14
  57. package/dist/News.js +4 -31
  58. package/dist/Observation.js +4 -54
  59. package/dist/ObservationsHolder.js +104 -216
  60. package/dist/OrganisationConfig.js +4 -19
  61. package/dist/PersistedObject.js +1 -19
  62. package/dist/PhoneNumber.js +0 -11
  63. package/dist/PlatformTranslation.js +4 -17
  64. package/dist/Privilege.js +5 -22
  65. package/dist/Program.js +4 -39
  66. package/dist/ProgramEncounter.js +6 -48
  67. package/dist/ProgramEnrolment.js +8 -162
  68. package/dist/ReferenceEntity.js +1 -10
  69. package/dist/ReportCard.js +5 -60
  70. package/dist/ResetSync.js +4 -17
  71. package/dist/Rule.js +4 -28
  72. package/dist/RuleDependency.js +4 -17
  73. package/dist/RuleFailureTelemetry.js +4 -36
  74. package/dist/Schema.js +16 -268
  75. package/dist/SchemaNames.js +3 -46
  76. package/dist/Settings.js +4 -53
  77. package/dist/StandardReportCardType.js +4 -39
  78. package/dist/SubjectMigration.js +6 -45
  79. package/dist/SubjectType.js +6 -72
  80. package/dist/SyncTelemetry.js +4 -40
  81. package/dist/Translation.js +4 -17
  82. package/dist/UserInfo.js +4 -33
  83. package/dist/application/DashboardCacheFilter.js +4 -24
  84. package/dist/application/Filter.js +3 -16
  85. package/dist/application/Form.js +6 -93
  86. package/dist/application/FormElement.js +5 -100
  87. package/dist/application/FormElementGroup.js +4 -75
  88. package/dist/application/FormElementStatus.js +1 -11
  89. package/dist/application/FormMapping.js +6 -44
  90. package/dist/application/Format.js +4 -20
  91. package/dist/application/KeyValue.js +4 -19
  92. package/dist/application/MenuItem.js +4 -35
  93. package/dist/application/MultiSelectFilter.js +1 -11
  94. package/dist/application/NullProgramEnrolment.js +0 -8
  95. package/dist/application/SingleSelectFilter.js +1 -12
  96. package/dist/application/StaticFormElementGroup.js +0 -11
  97. package/dist/application/StringKeyNumericValue.js +4 -17
  98. package/dist/application/ValidationResult.js +6 -20
  99. package/dist/application/ValidationResults.js +1 -14
  100. package/dist/application/WorkItem.js +4 -20
  101. package/dist/application/WorkList.js +1 -24
  102. package/dist/application/WorkLists.js +1 -13
  103. package/dist/assignment/UserSubjectAssignment.js +6 -26
  104. package/dist/draft/DraftEncounter.js +4 -40
  105. package/dist/draft/DraftSubject.js +4 -46
  106. package/dist/error/IgnorableSyncError.js +1 -6
  107. package/dist/error/SyncError.js +1 -6
  108. package/dist/framework/ArrayHelper.js +3 -11
  109. package/dist/framework/DefinedObjectSchema.js +4 -12
  110. package/dist/framework/RealmCollectionHelper.js +1 -9
  111. package/dist/framework/RealmListProxy.js +1 -10
  112. package/dist/framework/RealmObjectSchema.js +1 -11
  113. package/dist/framework/RealmProxy.js +2 -31
  114. package/dist/framework/RealmResultsProxy.js +3 -37
  115. package/dist/framework/RealmResultsProxyHandler.js +2 -5
  116. package/dist/geo/Point.js +4 -17
  117. package/dist/index.js +2 -137
  118. package/dist/location/Locations.js +1 -6
  119. package/dist/observation/MultipleCodedValues.js +1 -21
  120. package/dist/observation/PrimitiveValue.js +1 -17
  121. package/dist/observation/QuestionGroup.js +1 -36
  122. package/dist/observation/RepeatableQuestionGroup.js +4 -27
  123. package/dist/observation/SingleCodedValue.js +1 -15
  124. package/dist/program/SubjectProgramEligibility.js +6 -56
  125. package/dist/relationship/IndividualRelation.js +6 -18
  126. package/dist/relationship/IndividualRelationGenderMapping.js +4 -22
  127. package/dist/relationship/IndividualRelationship.js +6 -51
  128. package/dist/relationship/IndividualRelationshipType.js +4 -24
  129. package/dist/relationship/IndividualRelative.js +4 -31
  130. package/dist/reports/DashboardFilter.js +4 -20
  131. package/dist/reports/DashboardFilterConfig.js +5 -85
  132. package/dist/reports/NestedReportCardResult.js +5 -35
  133. package/dist/reports/Range.js +4 -13
  134. package/dist/reports/ReportCardResult.js +5 -24
  135. package/dist/service/MetaDataService.js +1 -30
  136. package/dist/task/Task.js +6 -62
  137. package/dist/task/TaskStatus.js +4 -21
  138. package/dist/task/TaskType.js +4 -23
  139. package/dist/task/TaskUnAssignment.js +6 -30
  140. package/dist/utility/AgeUtil.js +1 -15
  141. package/dist/utility/ArrayUtil.js +1 -6
  142. package/dist/utility/AuditUtil.js +1 -8
  143. package/dist/utility/DateTimeUtil.js +1 -8
  144. package/dist/utility/General.js +4 -71
  145. package/dist/utility/JsonStringify.js +15 -28
  146. package/dist/utility/MergeUtil.js +1 -10
  147. package/dist/utility/ResourceUtil.js +1 -7
  148. package/dist/videos/Video.js +4 -23
  149. package/dist/videos/VideoTelemetric.js +6 -37
  150. package/package.json +6 -3
  151. package/scripts/validateSchemas.js +40 -0
  152. package/tsconfig.json +1 -1
  153. package/yarn.lock +0 -6744
@@ -4,196 +4,146 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _ReferenceEntity = _interopRequireDefault(require("./ReferenceEntity"));
9
-
10
8
  var _General = _interopRequireDefault(require("./utility/General"));
11
-
12
9
  var _Format = _interopRequireDefault(require("./application/Format"));
13
-
14
10
  var _ResourceUtil = _interopRequireDefault(require("./utility/ResourceUtil"));
15
-
16
11
  var _SchemaNames = _interopRequireDefault(require("./SchemaNames"));
17
-
18
12
  var _lodash = _interopRequireDefault(require("lodash"));
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
-
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
16
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
17
  class SubjectType extends _ReferenceEntity.default {
25
18
  constructor(that = null) {
26
19
  super(that);
27
20
  }
28
-
29
21
  get name() {
30
22
  return this.that.name;
31
23
  }
32
-
33
24
  set name(x) {
34
25
  this.that.name = x;
35
26
  }
36
-
37
27
  get group() {
38
28
  return this.that.group;
39
29
  }
40
-
41
30
  set group(x) {
42
31
  this.that.group = x;
43
32
  }
44
-
45
33
  get household() {
46
34
  return this.that.household;
47
35
  }
48
-
49
36
  set household(x) {
50
37
  this.that.household = x;
51
38
  }
52
-
53
39
  get active() {
54
40
  return this.that.active;
55
41
  }
56
-
57
42
  set active(x) {
58
43
  this.that.active = x;
59
44
  }
60
-
61
45
  get type() {
62
46
  return this.that.type;
63
47
  }
64
-
65
48
  set type(x) {
66
49
  this.that.type = x;
67
50
  }
68
-
69
51
  get subjectSummaryRule() {
70
52
  return this.that.subjectSummaryRule;
71
53
  }
72
-
73
54
  set subjectSummaryRule(x) {
74
55
  this.that.subjectSummaryRule = x;
75
56
  }
76
-
77
57
  get programEligibilityCheckRule() {
78
58
  return this.that.programEligibilityCheckRule;
79
59
  }
80
-
81
60
  set programEligibilityCheckRule(x) {
82
61
  this.that.programEligibilityCheckRule = x;
83
62
  }
84
-
85
63
  get memberAdditionEligibilityCheckRule() {
86
64
  return this.that.memberAdditionEligibilityCheckRule;
87
65
  }
88
-
89
66
  set memberAdditionEligibilityCheckRule(x) {
90
67
  this.that.memberAdditionEligibilityCheckRule = x;
91
68
  }
92
-
93
69
  get uniqueName() {
94
70
  return this.that.uniqueName;
95
71
  }
96
-
97
72
  set uniqueName(x) {
98
73
  this.that.uniqueName = x;
99
74
  }
100
-
101
75
  get validFirstNameFormat() {
102
76
  return this.toEntity("validFirstNameFormat", _Format.default);
103
77
  }
104
-
105
78
  set validFirstNameFormat(x) {
106
79
  this.that.validFirstNameFormat = this.fromObject(x);
107
80
  }
108
-
109
81
  get validMiddleNameFormat() {
110
82
  return this.toEntity("validMiddleNameFormat", _Format.default);
111
83
  }
112
-
113
84
  set validMiddleNameFormat(x) {
114
85
  this.that.validMiddleNameFormat = this.fromObject(x);
115
86
  }
116
-
117
87
  get validLastNameFormat() {
118
88
  return this.toEntity("validLastNameFormat", _Format.default);
119
89
  }
120
-
121
90
  set validLastNameFormat(x) {
122
91
  this.that.validLastNameFormat = this.fromObject(x);
123
92
  }
124
-
125
93
  get iconFileS3Key() {
126
94
  return this.that.iconFileS3Key;
127
95
  }
128
-
129
96
  set iconFileS3Key(x) {
130
97
  this.that.iconFileS3Key = x;
131
98
  }
132
-
133
99
  get syncRegistrationConcept1() {
134
100
  return this.that.syncRegistrationConcept1;
135
101
  }
136
-
137
102
  set syncRegistrationConcept1(x) {
138
103
  this.that.syncRegistrationConcept1 = x;
139
104
  }
140
-
141
105
  get syncRegistrationConcept2() {
142
106
  return this.that.syncRegistrationConcept2;
143
107
  }
144
-
145
108
  set syncRegistrationConcept2(x) {
146
109
  this.that.syncRegistrationConcept2 = x;
147
110
  }
148
-
149
111
  get allowProfilePicture() {
150
112
  return this.that.allowProfilePicture;
151
113
  }
152
-
153
114
  set allowProfilePicture(x) {
154
115
  this.that.allowProfilePicture = x;
155
116
  }
156
-
157
117
  get allowMiddleName() {
158
118
  return this.that.allowMiddleName;
159
119
  }
160
-
161
120
  set allowMiddleName(x) {
162
121
  this.that.allowMiddleName = x;
163
122
  }
164
-
165
123
  get lastNameOptional() {
166
124
  return this.that.lastNameOptional;
167
125
  }
168
-
169
126
  set lastNameOptional(x) {
170
127
  this.that.lastNameOptional = x;
171
128
  }
172
-
173
129
  get nameHelpText() {
174
130
  return this.that.nameHelpText;
175
131
  }
176
-
177
132
  set nameHelpText(x) {
178
133
  this.that.nameHelpText = x;
179
134
  }
180
-
181
135
  get directlyAssignable() {
182
136
  return this.that.directlyAssignable;
183
137
  }
184
-
185
138
  set directlyAssignable(x) {
186
139
  this.that.directlyAssignable = x;
187
140
  }
188
-
189
141
  get settings() {
190
142
  return this.that.settings;
191
143
  }
192
-
193
144
  set settings(x) {
194
145
  this.that.settings = x;
195
146
  }
196
-
197
147
  static create(name, group = false, household = false, type) {
198
148
  let subjectType = new SubjectType();
199
149
  subjectType.uuid = _General.default.randomUUID();
@@ -203,10 +153,9 @@ class SubjectType extends _ReferenceEntity.default {
203
153
  subjectType.type = type;
204
154
  return subjectType;
205
155
  }
206
-
207
156
  static fromResource(operationalSubjectType) {
208
- const subjectType = new SubjectType(); //assuming here that the base name is not needed. When needed we will introduce it.
209
-
157
+ const subjectType = new SubjectType();
158
+ //assuming here that the base name is not needed. When needed we will introduce it.
210
159
  subjectType.name = operationalSubjectType.name;
211
160
  subjectType.uuid = operationalSubjectType.subjectTypeUUID;
212
161
  subjectType.voided = !!operationalSubjectType.voided;
@@ -232,7 +181,6 @@ class SubjectType extends _ReferenceEntity.default {
232
181
  subjectType.settings = !_lodash.default.isNil(operationalSubjectType.settings) ? JSON.stringify(operationalSubjectType.settings) : '{}';
233
182
  return subjectType;
234
183
  }
235
-
236
184
  clone() {
237
185
  const cloned = new SubjectType();
238
186
  cloned.uuid = this.uuid;
@@ -261,45 +209,34 @@ class SubjectType extends _ReferenceEntity.default {
261
209
  cloned.settings = this.settings;
262
210
  return cloned;
263
211
  }
264
-
265
212
  isPerson() {
266
213
  return this.type === SubjectType.types.Person;
267
214
  }
268
-
269
215
  isIndividual() {
270
216
  return this.type === SubjectType.types.Individual;
271
217
  }
272
-
273
218
  isUser() {
274
219
  return this.type === SubjectType.types.User;
275
220
  }
276
-
277
221
  registerIcon() {
278
222
  return this.isPerson() ? "account-plus" : "plus-box";
279
223
  }
280
-
281
224
  isGroup() {
282
225
  return this.group;
283
226
  }
284
-
285
227
  isHousehold() {
286
228
  return this.household;
287
229
  }
288
-
289
230
  isIconSetup() {
290
231
  return !_lodash.default.isNil(this.iconFileS3Key);
291
232
  }
292
-
293
233
  getSettings() {
294
234
  return JSON.parse(this.settings);
295
235
  }
296
-
297
236
  getSetting(settingName) {
298
237
  return this.getSettings()[settingName];
299
238
  }
300
-
301
239
  }
302
-
303
240
  _defineProperty(SubjectType, "schema", {
304
241
  name: 'SubjectType',
305
242
  primaryKey: 'uuid',
@@ -392,7 +329,6 @@ _defineProperty(SubjectType, "schema", {
392
329
  }
393
330
  }
394
331
  });
395
-
396
332
  _defineProperty(SubjectType, "types", {
397
333
  Person: 'Person',
398
334
  Individual: 'Individual',
@@ -400,11 +336,9 @@ _defineProperty(SubjectType, "types", {
400
336
  Household: 'Household',
401
337
  User: 'User'
402
338
  });
403
-
404
339
  _defineProperty(SubjectType, "settingKeys", {
405
340
  displayRegistrationDetails: 'displayRegistrationDetails',
406
341
  displayPlannedEncounters: 'displayPlannedEncounters'
407
342
  });
408
-
409
343
  var _default = SubjectType;
410
344
  exports.default = _default;
@@ -4,106 +4,80 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
9
-
10
8
  var _lodash = _interopRequireDefault(require("lodash"));
11
-
12
9
  var _General = _interopRequireDefault(require("./utility/General"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
-
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
14
  class SyncTelemetry extends _BaseEntity.default {
19
15
  constructor(that = null) {
20
16
  super(that);
21
17
  }
22
-
23
18
  get appVersion() {
24
19
  return this.that.appVersion;
25
20
  }
26
-
27
21
  set appVersion(x) {
28
22
  this.that.appVersion = x;
29
23
  }
30
-
31
24
  get androidVersion() {
32
25
  return this.that.androidVersion;
33
26
  }
34
-
35
27
  set androidVersion(x) {
36
28
  this.that.androidVersion = x;
37
29
  }
38
-
39
30
  get deviceName() {
40
31
  return this.that.deviceName;
41
32
  }
42
-
43
33
  set deviceName(x) {
44
34
  this.that.deviceName = x;
45
35
  }
46
-
47
36
  get syncStatus() {
48
37
  return this.that.syncStatus;
49
38
  }
50
-
51
39
  set syncStatus(x) {
52
40
  this.that.syncStatus = x;
53
41
  }
54
-
55
42
  get syncStartTime() {
56
43
  return this.that.syncStartTime;
57
44
  }
58
-
59
45
  set syncStartTime(x) {
60
46
  this.that.syncStartTime = x;
61
47
  }
62
-
63
48
  get syncEndTime() {
64
49
  return this.that.syncEndTime;
65
50
  }
66
-
67
51
  set syncEndTime(x) {
68
52
  this.that.syncEndTime = x;
69
53
  }
70
-
71
54
  get entityStatus() {
72
55
  return this.that.entityStatus;
73
56
  }
74
-
75
57
  set entityStatus(x) {
76
58
  this.that.entityStatus = x;
77
59
  }
78
-
79
60
  get syncSource() {
80
61
  return this.that.syncSource;
81
62
  }
82
-
83
63
  set syncSource(x) {
84
64
  this.that.syncSource = x;
85
65
  }
86
-
87
66
  get deviceInfo() {
88
67
  return this.that.deviceInfo;
89
68
  }
90
-
91
69
  set deviceInfo(x) {
92
70
  this.that.deviceInfo = x;
93
71
  }
94
-
95
72
  get appInfo() {
96
73
  return this.that.appInfo;
97
74
  }
98
-
99
75
  set appInfo(x) {
100
76
  this.that.appInfo = x;
101
77
  }
102
-
103
78
  static fromResource() {
104
79
  throw new Error("This should never be called because server always returns an empty array for this resource");
105
80
  }
106
-
107
81
  static newInstance(allEntitiesMetaData) {
108
82
  const syncTelemetry = new SyncTelemetry();
109
83
  syncTelemetry.uuid = _General.default.randomUUID();
@@ -124,33 +98,26 @@ class SyncTelemetry extends _BaseEntity.default {
124
98
  syncTelemetry.setEntityStatus(initialEntityStatus);
125
99
  return syncTelemetry;
126
100
  }
127
-
128
101
  setEntityStatus(statusObject) {
129
102
  this.entityStatus = JSON.stringify(statusObject);
130
103
  }
131
-
132
104
  getEntityStatus() {
133
105
  return JSON.parse(this.entityStatus);
134
106
  }
135
-
136
107
  getDeviceInfo() {
137
108
  //Data will be fixed in the next release for this.
138
109
  return this.deviceInfo === '' ? {} : JSON.parse(this.deviceInfo);
139
110
  }
140
-
141
111
  getAppInfo() {
142
112
  return this.appInfo === '' ? {} : JSON.parse(this.appInfo);
143
113
  }
144
-
145
114
  get toResource() {
146
115
  const resource = _lodash.default.pick(this, ["uuid", "syncStatus", "syncStartTime", "syncEndTime", "appVersion", "androidVersion", "deviceName", "syncSource"]);
147
-
148
116
  resource.entityStatus = this.getEntityStatus();
149
117
  resource.deviceInfo = this.getDeviceInfo();
150
118
  resource.appInfo = this.getAppInfo();
151
119
  return resource;
152
120
  }
153
-
154
121
  clone() {
155
122
  const syncTelemetry = new SyncTelemetry();
156
123
  syncTelemetry.uuid = this.uuid;
@@ -167,9 +134,7 @@ class SyncTelemetry extends _BaseEntity.default {
167
134
  syncTelemetry.syncSource = this.syncSource;
168
135
  return syncTelemetry;
169
136
  }
170
-
171
137
  }
172
-
173
138
  _defineProperty(SyncTelemetry, "schema", {
174
139
  name: "SyncTelemetry",
175
140
  primaryKey: "uuid",
@@ -187,6 +152,5 @@ _defineProperty(SyncTelemetry, "schema", {
187
152
  appInfo: "string?"
188
153
  }
189
154
  });
190
-
191
155
  var _default = SyncTelemetry;
192
156
  exports.default = _default;
@@ -4,36 +4,28 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _lodash = _interopRequireDefault(require("lodash"));
9
-
10
8
  var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
-
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
13
  class Translation extends _BaseEntity.default {
17
14
  constructor(that = null) {
18
15
  super(that);
19
16
  }
20
-
21
17
  get language() {
22
18
  return this.that.language;
23
19
  }
24
-
25
20
  set language(x) {
26
21
  this.that.language = x;
27
22
  }
28
-
29
23
  get translations() {
30
24
  return this.that.translations;
31
25
  }
32
-
33
26
  set translations(x) {
34
27
  this.that.translations = x;
35
28
  }
36
-
37
29
  static fromResource(resource) {
38
30
  let translation = new Translation();
39
31
  translation.uuid = resource.uuid;
@@ -41,20 +33,16 @@ class Translation extends _BaseEntity.default {
41
33
  translation.translations = _lodash.default.isNil(resource.translationJson) ? "{}" : JSON.stringify(resource.translationJson);
42
34
  return translation;
43
35
  }
44
-
45
36
  getTranslations() {
46
37
  return JSON.parse(this.that.translations);
47
38
  }
48
-
49
39
  clone() {
50
40
  let translation = new Translation();
51
41
  translation.uuid = this.uuid;
52
42
  translation.language = this.language;
53
43
  translation.translations = this.translations;
54
44
  }
55
-
56
45
  }
57
-
58
46
  _defineProperty(Translation, "schema", {
59
47
  name: "Translation",
60
48
  primaryKey: "uuid",
@@ -64,6 +52,5 @@ _defineProperty(Translation, "schema", {
64
52
  translations: "string"
65
53
  }
66
54
  });
67
-
68
55
  var _default = Translation;
69
56
  exports.default = _default;
package/dist/UserInfo.js CHANGED
@@ -4,68 +4,52 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _lodash = _interopRequireDefault(require("lodash"));
9
-
10
8
  var _BaseEntity = _interopRequireDefault(require("./BaseEntity"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
-
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
13
  class UserInfo extends _BaseEntity.default {
17
14
  constructor(that = null) {
18
15
  super(that);
19
16
  }
20
-
21
17
  get username() {
22
18
  return this.that.username;
23
19
  }
24
-
25
20
  set username(x) {
26
21
  this.that.username = x;
27
22
  }
28
-
29
23
  get organisationName() {
30
24
  return this.that.organisationName;
31
25
  }
32
-
33
26
  set organisationName(x) {
34
27
  this.that.organisationName = x;
35
28
  }
36
-
37
29
  get settings() {
38
30
  return this.that.settings;
39
31
  }
40
-
41
32
  set settings(x) {
42
33
  this.that.settings = x;
43
34
  }
44
-
45
35
  get name() {
46
36
  return this.that.name;
47
37
  }
48
-
49
38
  set name(x) {
50
39
  this.that.name = x;
51
40
  }
52
-
53
41
  get syncSettings() {
54
42
  return this.that.syncSettings;
55
43
  }
56
-
57
44
  set syncSettings(x) {
58
45
  this.that.syncSettings = x;
59
46
  }
60
-
61
47
  get userUUID() {
62
48
  return this.that.userUUID;
63
49
  }
64
-
65
50
  set userUUID(x) {
66
51
  this.that.userUUID = x;
67
52
  }
68
-
69
53
  static fromResource(resource) {
70
54
  let userInfo = new UserInfo();
71
55
  userInfo.username = resource.username;
@@ -77,30 +61,23 @@ class UserInfo extends _BaseEntity.default {
77
61
  userInfo.userUUID = resource.userUUID;
78
62
  return userInfo;
79
63
  }
80
-
81
64
  setSettings(settingsObject) {
82
65
  this.settings = JSON.stringify(settingsObject);
83
66
  }
84
-
85
67
  getSettings() {
86
68
  return JSON.parse(this.settings);
87
69
  }
88
-
89
70
  getSyncSettings() {
90
71
  return JSON.parse(this.syncSettings);
91
72
  }
92
-
93
73
  getDisplayUsername() {
94
74
  return _lodash.default.isNil(this.name) ? this.username : this.name;
95
75
  }
96
-
97
76
  get toResource() {
98
77
  const resource = _lodash.default.pick(this, ["uuid"]);
99
-
100
78
  resource.settings = this.getSettings();
101
79
  return resource;
102
80
  }
103
-
104
81
  clone() {
105
82
  let userInfo = new UserInfo();
106
83
  userInfo.username = this.username;
@@ -111,20 +88,15 @@ class UserInfo extends _BaseEntity.default {
111
88
  userInfo.name = this.name;
112
89
  return userInfo;
113
90
  }
114
-
115
91
  static createEmptyInstance() {
116
92
  const userInfo = new UserInfo();
117
93
  userInfo.settings = UserInfo.DEFAULT_SETTINGS;
118
94
  userInfo.syncSettings = '{}';
119
95
  return userInfo;
120
96
  }
121
-
122
97
  }
123
-
124
98
  _defineProperty(UserInfo, "UUID", "ce9ad8ee-193e-49ee-8626-49802c8b4bd7");
125
-
126
99
  _defineProperty(UserInfo, "DEFAULT_SETTINGS", '{"trackLocation": false, "locale": "en", "disableAutoRefresh": false, "disableAutoSync": false}');
127
-
128
100
  _defineProperty(UserInfo, "schema", {
129
101
  name: "UserInfo",
130
102
  primaryKey: "uuid",
@@ -147,6 +119,5 @@ _defineProperty(UserInfo, "schema", {
147
119
  }
148
120
  }
149
121
  });
150
-
151
122
  var _default = UserInfo;
152
123
  exports.default = _default;