@flarehr/superhero-basic-profile 0.1.2217 → 0.1.2219

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 (76) hide show
  1. package/dist/assets/delete.dcc7b157.svg +5 -0
  2. package/dist/assets/dialog-warning.cc77f3ba.svg +5 -0
  3. package/dist/assets/pencil.05fe6be6.svg +5 -0
  4. package/dist/index.html +20 -0
  5. package/dist/superhero-basic-profile.js +50 -0
  6. package/package.json +1 -1
  7. package/dist/App.jsx +0 -4
  8. package/dist/Basic.Profile.Domain/AnalyticsEvent.jsx +0 -102
  9. package/dist/Basic.Profile.Domain/Audit.jsx +0 -149
  10. package/dist/Basic.Profile.Domain/Commands.jsx +0 -68
  11. package/dist/Basic.Profile.Domain/CommonTypes.jsx +0 -194
  12. package/dist/Basic.Profile.Domain/Config/Api/Admin/Read.jsx +0 -58
  13. package/dist/Basic.Profile.Domain/Config/Api/Admin/Write.jsx +0 -23
  14. package/dist/Basic.Profile.Domain/Config/Api/FlareAdminShell/Read.jsx +0 -35
  15. package/dist/Basic.Profile.Domain/Config/Commands.jsx +0 -72
  16. package/dist/Basic.Profile.Domain/Config/ConfigCommandHandler.jsx +0 -197
  17. package/dist/Basic.Profile.Domain/Config/Dto.jsx +0 -181
  18. package/dist/Basic.Profile.Domain/Config/Types.jsx +0 -152
  19. package/dist/Basic.Profile.Domain/DateTimeProvider.jsx +0 -23
  20. package/dist/Basic.Profile.Domain/DomainAggregates.jsx +0 -801
  21. package/dist/Basic.Profile.Domain/DomainPrimitives.jsx +0 -426
  22. package/dist/Basic.Profile.Domain/Dto/Aggregates.jsx +0 -564
  23. package/dist/Basic.Profile.Domain/Dto/AnalyticsEvent.jsx +0 -157
  24. package/dist/Basic.Profile.Domain/Dto/Api/Backend/Common.jsx +0 -102
  25. package/dist/Basic.Profile.Domain/Dto/Api/Backend/Read.jsx +0 -85
  26. package/dist/Basic.Profile.Domain/Dto/Api/Backend/Write.jsx +0 -16
  27. package/dist/Basic.Profile.Domain/Dto/Api/Common.jsx +0 -427
  28. package/dist/Basic.Profile.Domain/Dto/Api/External/Read.jsx +0 -118
  29. package/dist/Basic.Profile.Domain/Dto/Api/External/ReadV2.jsx +0 -6
  30. package/dist/Basic.Profile.Domain/Dto/Api/External/Write.jsx +0 -184
  31. package/dist/Basic.Profile.Domain/Dto/Api/External/WriteV2.jsx +0 -439
  32. package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Read.jsx +0 -38
  33. package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Write.jsx +0 -199
  34. package/dist/Basic.Profile.Domain/Dto/Api/Internal/Read.jsx +0 -125
  35. package/dist/Basic.Profile.Domain/Dto/Audit.jsx +0 -121
  36. package/dist/Basic.Profile.Domain/Dto/Commands.jsx +0 -256
  37. package/dist/Basic.Profile.Domain/Dto/Common.jsx +0 -84
  38. package/dist/Basic.Profile.Domain/Dto/Events.jsx +0 -220
  39. package/dist/Basic.Profile.Domain/Dto/Primitives.jsx +0 -580
  40. package/dist/Basic.Profile.Domain/Dto/ProfileCreationModels.jsx +0 -324
  41. package/dist/Basic.Profile.Domain/Dto/Validation.jsx +0 -229
  42. package/dist/Basic.Profile.Domain/Events.jsx +0 -64
  43. package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Read.jsx +0 -140
  44. package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Validation.jsx +0 -499
  45. package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Write.jsx +0 -51
  46. package/dist/Basic.Profile.Domain/Import/Api/Read.jsx +0 -154
  47. package/dist/Basic.Profile.Domain/Import/CommonTypes.jsx +0 -187
  48. package/dist/Basic.Profile.Domain/Import/Dto.jsx +0 -475
  49. package/dist/Basic.Profile.Domain/Import/ImportCommandHandler.jsx +0 -531
  50. package/dist/Basic.Profile.Domain/Import/Types.jsx +0 -405
  51. package/dist/Basic.Profile.Domain/JwtPayload.jsx +0 -44
  52. package/dist/Basic.Profile.Domain/Metadata.jsx +0 -257
  53. package/dist/Basic.Profile.Domain/ProfileCommandHandler.jsx +0 -261
  54. package/dist/Basic.Profile.Domain/ProfileModels.jsx +0 -59
  55. package/dist/Basic.Profile.Domain/Utils.jsx +0 -372
  56. package/dist/Common/PreactCustomElement.jsx +0 -8
  57. package/dist/Common/Resources.jsx +0 -20
  58. package/dist/Common/Tailwind.jsx +0 -8
  59. package/dist/Common/Utils.jsx +0 -18
  60. package/dist/Directory/App.jsx +0 -192
  61. package/dist/Directory/BackendServices/Common.jsx +0 -115
  62. package/dist/Directory/BackendServices/ConfigService.jsx +0 -168
  63. package/dist/Directory/BackendServices/ImportService.jsx +0 -137
  64. package/dist/Directory/Common.jsx +0 -93
  65. package/dist/Directory/Config/Components.jsx +0 -173
  66. package/dist/Directory/Config/Types.jsx +0 -187
  67. package/dist/Directory/PastImports/PastImports.jsx +0 -81
  68. package/dist/Directory/ProfileImport/ProfileImport.jsx +0 -284
  69. package/dist/Directory/ProfileImport/Types.jsx +0 -91
  70. package/dist/Directory/TabNav.jsx +0 -24
  71. package/dist/Directory/Types.jsx +0 -101
  72. package/dist/Directory/User.jsx +0 -117
  73. package/dist/HeadlessUI/Dialog.jsx +0 -66
  74. package/dist/HeadlessUI/ModalDialog.jsx +0 -74
  75. package/dist/HeadlessUI/Switch.jsx +0 -66
  76. package/dist/HeadlessUI/Transition.jsx +0 -66
@@ -1,580 +0,0 @@
1
- import { PartnerIdModule_value, AccountIdModule_value, ProfileIdModule_value, ProfileId as ProfileId_1, RelationshipModule_ofDomain, FullNameModule_ofDomain, EmergencyContact, RelationshipModule_toDomain, FullNameModule_toDomain, PurgedAddress as PurgedAddress_1, Address as Address_1, DateOfBirth, MobilePhone, Email, Title, Gender, Name as Name_1, ExternalId, PartnerId, AccountId } from "../DomainPrimitives.jsx";
2
- import { compare, printf, toText, isNullOrWhiteSpace } from "../../fable_modules/fable-library-js.4.20.0/String.js";
3
- import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.20.0/Result.js";
4
- import { Union, Record } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
5
- import { class_type, int32_type, anonRecord_type, union_type, record_type, option_type, string_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
6
- import { requireEmail, requireNonEmpty } from "../Utils.jsx";
7
- import { Metadata as Metadata_1, ProfileEventMetadata, StreamId, DomainMetadata, AdminNameModule_value, AdminName, Source, SelfOperationType, AdminOperationType, InternalOperationType } from "../Metadata.jsx";
8
-
9
- export function AccountId_toDomain(Item) {
10
- return new AccountId(Item);
11
- }
12
-
13
- export function AccountId_ofDomain(_arg) {
14
- return _arg.fields[0];
15
- }
16
-
17
- export function PartnerId_toDomain(Item) {
18
- return new PartnerId(Item);
19
- }
20
-
21
- export function PartnerId_ofDomain(_arg) {
22
- return _arg.fields[0];
23
- }
24
-
25
- export function ExternalId_toDomain(value) {
26
- if (isNullOrWhiteSpace(value)) {
27
- return new FSharpResult$2(1, ["ExternalId cannot be an empty string"]);
28
- }
29
- else {
30
- return new FSharpResult$2(0, [new ExternalId(value)]);
31
- }
32
- }
33
-
34
- export function ExternalId_ofDomain(_arg) {
35
- return _arg.fields[0];
36
- }
37
-
38
- export class Name extends Record {
39
- constructor(FirstName, MiddleName, LastName) {
40
- super();
41
- this.FirstName = FirstName;
42
- this.MiddleName = MiddleName;
43
- this.LastName = LastName;
44
- }
45
- }
46
-
47
- export function Name_$reflection() {
48
- return record_type("Dto.Primitives.Name", [], Name, () => [["FirstName", string_type], ["MiddleName", option_type(string_type)], ["LastName", string_type]]);
49
- }
50
-
51
- export function NameModule_toDomain(name) {
52
- const input_2 = requireNonEmpty("FirstName", name.FirstName);
53
- if (input_2.tag === 1) {
54
- return new FSharpResult$2(1, [input_2.fields[0]]);
55
- }
56
- else {
57
- const input = requireNonEmpty("LastName", name.LastName);
58
- if (input.tag === 1) {
59
- return new FSharpResult$2(1, [input.fields[0]]);
60
- }
61
- else {
62
- return new FSharpResult$2(0, [new Name_1(input_2.fields[0], name.MiddleName, input.fields[0])]);
63
- }
64
- }
65
- }
66
-
67
- export function NameModule_ofDomain(name) {
68
- return new Name(name.FirstName, name.MiddleName, name.LastName);
69
- }
70
-
71
- export function Gender_toDomain(gender) {
72
- switch (gender) {
73
- case "Male":
74
- return new FSharpResult$2(0, [new Gender(0, [])]);
75
- case "Female":
76
- return new FSharpResult$2(0, [new Gender(1, [])]);
77
- case "Intersex":
78
- return new FSharpResult$2(0, [new Gender(2, [])]);
79
- case "Transgender":
80
- return new FSharpResult$2(0, [new Gender(3, [])]);
81
- case "PreferNotToAnswer":
82
- return new FSharpResult$2(0, [new Gender(4, [])]);
83
- case "Other":
84
- return new FSharpResult$2(0, [new Gender(5, [])]);
85
- case "NotSet":
86
- return new FSharpResult$2(0, [new Gender(6, [])]);
87
- default:
88
- return new FSharpResult$2(1, [toText(printf("Gender %s not supported"))(gender)]);
89
- }
90
- }
91
-
92
- export function Gender_ofDomain(gender) {
93
- switch (gender.tag) {
94
- case 1:
95
- return "Female";
96
- case 2:
97
- return "Intersex";
98
- case 3:
99
- return "Transgender";
100
- case 4:
101
- return "PreferNotToAnswer";
102
- case 5:
103
- return "Other";
104
- case 6:
105
- return "NotSet";
106
- default:
107
- return "Male";
108
- }
109
- }
110
-
111
- export function Title_toDomain(title) {
112
- const input_1 = requireNonEmpty("Title", title);
113
- if (input_1.tag === 1) {
114
- return new FSharpResult$2(1, [input_1.fields[0]]);
115
- }
116
- else {
117
- return new FSharpResult$2(0, [new Title(input_1.fields[0])]);
118
- }
119
- }
120
-
121
- export function Title_ofDomain(_arg) {
122
- return _arg.fields[0];
123
- }
124
-
125
- export function Email_toDomain(email) {
126
- let input_3;
127
- const input_1 = requireNonEmpty("Email", email);
128
- input_3 = ((input_1.tag === 1) ? (new FSharpResult$2(1, [input_1.fields[0]])) : requireEmail(input_1.fields[0]));
129
- if (input_3.tag === 1) {
130
- return new FSharpResult$2(1, [input_3.fields[0]]);
131
- }
132
- else {
133
- return new FSharpResult$2(0, [new Email(input_3.fields[0])]);
134
- }
135
- }
136
-
137
- export function Email_ofDomain(_arg) {
138
- return _arg.fields[0];
139
- }
140
-
141
- export function Email_areEqual(emailOne, emailTwo) {
142
- return compare(Email_ofDomain(emailOne), Email_ofDomain(emailTwo), 5) === 0;
143
- }
144
-
145
- export function MobilePhone_toDomain(mobilePhone) {
146
- const input_1 = requireNonEmpty("MobilePhone", mobilePhone);
147
- if (input_1.tag === 1) {
148
- return new FSharpResult$2(1, [input_1.fields[0]]);
149
- }
150
- else {
151
- return new FSharpResult$2(0, [new MobilePhone(input_1.fields[0])]);
152
- }
153
- }
154
-
155
- export function MobilePhone_ofDomain(_arg) {
156
- return _arg.fields[0];
157
- }
158
-
159
- export function DateOfBirth_toDomain(dateOfBirth) {
160
- const input_1 = requireNonEmpty("DateOfBirth", dateOfBirth);
161
- if (input_1.tag === 1) {
162
- return new FSharpResult$2(1, [input_1.fields[0]]);
163
- }
164
- else {
165
- return new FSharpResult$2(0, [new DateOfBirth(input_1.fields[0])]);
166
- }
167
- }
168
-
169
- export function DateOfBirth_ofDomain(_arg) {
170
- return _arg.fields[0];
171
- }
172
-
173
- export class Address extends Record {
174
- constructor(AddressLine1, AddressLine2, City, State, Postcode, CountryCode) {
175
- super();
176
- this.AddressLine1 = AddressLine1;
177
- this.AddressLine2 = AddressLine2;
178
- this.City = City;
179
- this.State = State;
180
- this.Postcode = Postcode;
181
- this.CountryCode = CountryCode;
182
- }
183
- }
184
-
185
- export function Address_$reflection() {
186
- return record_type("Dto.Primitives.Address", [], Address, () => [["AddressLine1", string_type], ["AddressLine2", option_type(string_type)], ["City", string_type], ["State", string_type], ["Postcode", string_type], ["CountryCode", string_type]]);
187
- }
188
-
189
- export function AddressModule_toDomain(address) {
190
- const input_8 = requireNonEmpty("AddressLine1", address.AddressLine1);
191
- if (input_8.tag === 1) {
192
- return new FSharpResult$2(1, [input_8.fields[0]]);
193
- }
194
- else {
195
- const input_6 = requireNonEmpty("City", address.City);
196
- if (input_6.tag === 1) {
197
- return new FSharpResult$2(1, [input_6.fields[0]]);
198
- }
199
- else {
200
- const input_4 = requireNonEmpty("State", address.State);
201
- if (input_4.tag === 1) {
202
- return new FSharpResult$2(1, [input_4.fields[0]]);
203
- }
204
- else {
205
- const input_2 = requireNonEmpty("Postcode", address.Postcode);
206
- if (input_2.tag === 1) {
207
- return new FSharpResult$2(1, [input_2.fields[0]]);
208
- }
209
- else {
210
- const input = requireNonEmpty("CountryCode", address.CountryCode);
211
- if (input.tag === 1) {
212
- return new FSharpResult$2(1, [input.fields[0]]);
213
- }
214
- else {
215
- return new FSharpResult$2(0, [new Address_1(input_8.fields[0], address.AddressLine2, input_6.fields[0], input_4.fields[0], input_2.fields[0], input.fields[0])]);
216
- }
217
- }
218
- }
219
- }
220
- }
221
- }
222
-
223
- export function AddressModule_ofDomain(address) {
224
- return new Address(address.AddressLine1, address.AddressLine2, address.City, address.State, address.Postcode, address.CountryCode);
225
- }
226
-
227
- export class PurgedAddress extends Record {
228
- constructor(City, State, Postcode, CountryCode) {
229
- super();
230
- this.City = City;
231
- this.State = State;
232
- this.Postcode = Postcode;
233
- this.CountryCode = CountryCode;
234
- }
235
- }
236
-
237
- export function PurgedAddress_$reflection() {
238
- return record_type("Dto.Primitives.PurgedAddress", [], PurgedAddress, () => [["City", string_type], ["State", string_type], ["Postcode", string_type], ["CountryCode", string_type]]);
239
- }
240
-
241
- export function PurgedAddressModule_toDomain(address) {
242
- const input_6 = requireNonEmpty("City", address.City);
243
- if (input_6.tag === 1) {
244
- return new FSharpResult$2(1, [input_6.fields[0]]);
245
- }
246
- else {
247
- const input_4 = requireNonEmpty("State", address.State);
248
- if (input_4.tag === 1) {
249
- return new FSharpResult$2(1, [input_4.fields[0]]);
250
- }
251
- else {
252
- const input_2 = requireNonEmpty("Postcode", address.Postcode);
253
- if (input_2.tag === 1) {
254
- return new FSharpResult$2(1, [input_2.fields[0]]);
255
- }
256
- else {
257
- const input = requireNonEmpty("CountryCode", address.CountryCode);
258
- if (input.tag === 1) {
259
- return new FSharpResult$2(1, [input.fields[0]]);
260
- }
261
- else {
262
- return new FSharpResult$2(0, [new PurgedAddress_1(input_6.fields[0], input_4.fields[0], input_2.fields[0], input.fields[0])]);
263
- }
264
- }
265
- }
266
- }
267
- }
268
-
269
- export function PurgedAddressModule_ofDomain(address) {
270
- return new PurgedAddress(address.City, address.State, address.Postcode, address.CountryCode);
271
- }
272
-
273
- export class EmergencyContactDto extends Record {
274
- constructor(FullName, Relationship, MobilePhone, Email, Address) {
275
- super();
276
- this.FullName = FullName;
277
- this.Relationship = Relationship;
278
- this.MobilePhone = MobilePhone;
279
- this.Email = Email;
280
- this.Address = Address;
281
- }
282
- }
283
-
284
- export function EmergencyContactDto_$reflection() {
285
- return record_type("Dto.Primitives.EmergencyContactDto", [], EmergencyContactDto, () => [["FullName", string_type], ["Relationship", string_type], ["MobilePhone", string_type], ["Email", option_type(string_type)], ["Address", option_type(Address_$reflection())]]);
286
- }
287
-
288
- export function EmergencyContactDtoModule_toDomain(contact) {
289
- const input_14 = FullNameModule_toDomain(contact.FullName);
290
- if (input_14.tag === 1) {
291
- return new FSharpResult$2(1, [input_14.fields[0]]);
292
- }
293
- else {
294
- const input_12 = RelationshipModule_toDomain(contact.Relationship);
295
- if (input_12.tag === 1) {
296
- return new FSharpResult$2(1, [input_12.fields[0]]);
297
- }
298
- else {
299
- const input_10 = MobilePhone_toDomain(contact.MobilePhone);
300
- if (input_10.tag === 1) {
301
- return new FSharpResult$2(1, [input_10.fields[0]]);
302
- }
303
- else {
304
- let input_8;
305
- const input_1 = contact.Email;
306
- if (input_1 != null) {
307
- const input_2 = Email_toDomain(input_1);
308
- input_8 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [input_2.fields[0]])));
309
- }
310
- else {
311
- input_8 = (new FSharpResult$2(0, [undefined]));
312
- }
313
- if (input_8.tag === 1) {
314
- return new FSharpResult$2(1, [input_8.fields[0]]);
315
- }
316
- else {
317
- let input_6;
318
- const input_4 = contact.Address;
319
- if (input_4 != null) {
320
- const input_5 = AddressModule_toDomain(input_4);
321
- input_6 = ((input_5.tag === 1) ? (new FSharpResult$2(1, [input_5.fields[0]])) : (new FSharpResult$2(0, [input_5.fields[0]])));
322
- }
323
- else {
324
- input_6 = (new FSharpResult$2(0, [undefined]));
325
- }
326
- if (input_6.tag === 1) {
327
- return new FSharpResult$2(1, [input_6.fields[0]]);
328
- }
329
- else {
330
- return new FSharpResult$2(0, [new EmergencyContact(input_14.fields[0], input_12.fields[0], input_10.fields[0], input_8.fields[0], input_6.fields[0])]);
331
- }
332
- }
333
- }
334
- }
335
- }
336
- }
337
-
338
- export function EmergencyContactDtoModule_ofDomain(contact) {
339
- let input_1, input_3;
340
- return new EmergencyContactDto(FullNameModule_ofDomain(contact.FullName), RelationshipModule_ofDomain(contact.Relationship), MobilePhone_ofDomain(contact.MobilePhone), (input_1 = contact.Email, (input_1 == null) ? undefined : Email_ofDomain(input_1)), (input_3 = contact.Address, (input_3 == null) ? undefined : AddressModule_ofDomain(input_3)));
341
- }
342
-
343
- export class UnusedDto extends Record {
344
- constructor(Unused) {
345
- super();
346
- this.Unused = Unused;
347
- }
348
- }
349
-
350
- export function UnusedDto_$reflection() {
351
- return record_type("Dto.Primitives.UnusedDto", [], UnusedDto, () => [["Unused", option_type(string_type)]]);
352
- }
353
-
354
- export const UnusedDtoModule_Default = new UnusedDto(undefined);
355
-
356
- export class InternalOperationTypeDto extends Union {
357
- constructor(tag, fields) {
358
- super();
359
- this.tag = tag;
360
- this.fields = fields;
361
- }
362
- cases() {
363
- return ["MessageQueue", "Unused"];
364
- }
365
- }
366
-
367
- export function InternalOperationTypeDto_$reflection() {
368
- return union_type("Dto.Primitives.InternalOperationTypeDto", [], InternalOperationTypeDto, () => [[["Item", UnusedDto_$reflection()]], [["Item", UnusedDto_$reflection()]]]);
369
- }
370
-
371
- export function InternalOperationTypeDtoModule_toDomain(dto) {
372
- if (dto.tag === 1) {
373
- return new InternalOperationType();
374
- }
375
- else {
376
- return new InternalOperationType();
377
- }
378
- }
379
-
380
- export function InternalOperationTypeDtoModule_ofDomain(internalOperationType) {
381
- return new InternalOperationTypeDto(0, [UnusedDtoModule_Default]);
382
- }
383
-
384
- export class AdminOperationTypeDto extends Union {
385
- constructor(tag, fields) {
386
- super();
387
- this.tag = tag;
388
- this.fields = fields;
389
- }
390
- cases() {
391
- return ["Direct", "Bulk"];
392
- }
393
- }
394
-
395
- export function AdminOperationTypeDto_$reflection() {
396
- return union_type("Dto.Primitives.AdminOperationTypeDto", [], AdminOperationTypeDto, () => [[["Item", UnusedDto_$reflection()]], [["Item", UnusedDto_$reflection()]]]);
397
- }
398
-
399
- export function AdminOperationTypeDtoModule_toDomain(dto) {
400
- if (dto.tag === 1) {
401
- return new AdminOperationType(1, []);
402
- }
403
- else {
404
- return new AdminOperationType(0, []);
405
- }
406
- }
407
-
408
- export function AdminOperationTypeDtoModule_ofDomain(adminOperationType) {
409
- if (adminOperationType.tag === 1) {
410
- return new AdminOperationTypeDto(1, [UnusedDtoModule_Default]);
411
- }
412
- else {
413
- return new AdminOperationTypeDto(0, [UnusedDtoModule_Default]);
414
- }
415
- }
416
-
417
- export class SelfOperationTypeDto extends Union {
418
- constructor(tag, fields) {
419
- super();
420
- this.tag = tag;
421
- this.fields = fields;
422
- }
423
- cases() {
424
- return ["Workflow", "Unused"];
425
- }
426
- }
427
-
428
- export function SelfOperationTypeDto_$reflection() {
429
- return union_type("Dto.Primitives.SelfOperationTypeDto", [], SelfOperationTypeDto, () => [[["Item", UnusedDto_$reflection()]], [["Item", UnusedDto_$reflection()]]]);
430
- }
431
-
432
- export function SelfOperationTypeDtoModule_toDomain(dto) {
433
- if (dto.tag === 1) {
434
- return new SelfOperationType();
435
- }
436
- else {
437
- return new SelfOperationType();
438
- }
439
- }
440
-
441
- export function SelfOperationTypeDtoModule_ofDomain(selfOperationType) {
442
- return new SelfOperationTypeDto(0, [UnusedDtoModule_Default]);
443
- }
444
-
445
- export class SourceDto extends Union {
446
- constructor(tag, fields) {
447
- super();
448
- this.tag = tag;
449
- this.fields = fields;
450
- }
451
- cases() {
452
- return ["ExternalApi", "InternalApi", "Self", "FlareAdmin", "SuperheroAdmin", "InternalOperation"];
453
- }
454
- }
455
-
456
- export function SourceDto_$reflection() {
457
- return union_type("Dto.Primitives.SourceDto", [], SourceDto, () => [[["Item", UnusedDto_$reflection()]], [["Item", UnusedDto_$reflection()]], [["Item", SelfOperationTypeDto_$reflection()]], [["Item", anonRecord_type(["Operation", AdminOperationTypeDto_$reflection()], ["ProfileId", string_type])]], [["Item", anonRecord_type(["AdminName", string_type], ["Email", string_type])]], [["Item", InternalOperationTypeDto_$reflection()]]]);
458
- }
459
-
460
- export function SourceDtoModule_toDomain(sourceDto) {
461
- switch (sourceDto.tag) {
462
- case 1:
463
- return new Source(1, []);
464
- case 2:
465
- return new Source(2, [SelfOperationTypeDtoModule_toDomain(sourceDto.fields[0])]);
466
- case 3: {
467
- const adminDetails = sourceDto.fields[0];
468
- return new Source(3, [{
469
- Operation: AdminOperationTypeDtoModule_toDomain(adminDetails.Operation),
470
- ProfileId: new ProfileId_1(adminDetails.ProfileId),
471
- }]);
472
- }
473
- case 4: {
474
- const details = sourceDto.fields[0];
475
- return new Source(4, [{
476
- AdminName: new AdminName(details.AdminName),
477
- Email: new Email(details.Email),
478
- }]);
479
- }
480
- case 5:
481
- return new Source(5, [InternalOperationTypeDtoModule_toDomain(sourceDto.fields[0])]);
482
- default:
483
- return new Source(0, []);
484
- }
485
- }
486
-
487
- export function SourceDtoModule_ofDomain(source) {
488
- let ProfileId;
489
- switch (source.tag) {
490
- case 1:
491
- return new SourceDto(1, [UnusedDtoModule_Default]);
492
- case 2:
493
- return new SourceDto(2, [SelfOperationTypeDtoModule_ofDomain(source.fields[0])]);
494
- case 3: {
495
- const adminDetails = source.fields[0];
496
- return new SourceDto(3, [(ProfileId = ProfileIdModule_value(adminDetails.ProfileId), {
497
- Operation: AdminOperationTypeDtoModule_ofDomain(adminDetails.Operation),
498
- ProfileId: ProfileId,
499
- })]);
500
- }
501
- case 4: {
502
- const details = source.fields[0];
503
- return new SourceDto(4, [{
504
- AdminName: AdminNameModule_value(details.AdminName),
505
- Email: Email_ofDomain(details.Email),
506
- }]);
507
- }
508
- case 5:
509
- return new SourceDto(5, [InternalOperationTypeDtoModule_ofDomain(source.fields[0])]);
510
- default:
511
- return new SourceDto(0, [UnusedDtoModule_Default]);
512
- }
513
- }
514
-
515
- export class Metadata extends Record {
516
- constructor(StreamId, Version, Timestamp) {
517
- super();
518
- this.StreamId = StreamId;
519
- this.Version = (Version | 0);
520
- this.Timestamp = Timestamp;
521
- }
522
- }
523
-
524
- export function Metadata_$reflection() {
525
- return record_type("Dto.Primitives.Metadata", [], Metadata, () => [["StreamId", string_type], ["Version", int32_type], ["Timestamp", class_type("System.DateTime")]]);
526
- }
527
-
528
- export class DomainMetadataDto extends Record {
529
- constructor(AccountId, PartnerId, Source) {
530
- super();
531
- this.AccountId = AccountId;
532
- this.PartnerId = PartnerId;
533
- this.Source = Source;
534
- }
535
- }
536
-
537
- export function DomainMetadataDto_$reflection() {
538
- return record_type("Dto.Primitives.DomainMetadataDto", [], DomainMetadataDto, () => [["AccountId", string_type], ["PartnerId", string_type], ["Source", SourceDto_$reflection()]]);
539
- }
540
-
541
- export function DomainMetadataDtoModule_toDomain(domainMetadataDto) {
542
- return new DomainMetadata(new AccountId(domainMetadataDto.AccountId), new PartnerId(domainMetadataDto.PartnerId), SourceDtoModule_toDomain(domainMetadataDto.Source));
543
- }
544
-
545
- export function DomainMetadataDtoModule_ofDomain(domainMetadata) {
546
- return new DomainMetadataDto(AccountIdModule_value(domainMetadata.AccountId), PartnerIdModule_value(domainMetadata.PartnerId), SourceDtoModule_ofDomain(domainMetadata.Source));
547
- }
548
-
549
- export class ProfileEventMetadataDto extends Record {
550
- constructor(StreamId, Version, Timestamp, Domain) {
551
- super();
552
- this.StreamId = StreamId;
553
- this.Version = (Version | 0);
554
- this.Timestamp = Timestamp;
555
- this.Domain = Domain;
556
- }
557
- }
558
-
559
- export function ProfileEventMetadataDto_$reflection() {
560
- return record_type("Dto.Primitives.ProfileEventMetadataDto", [], ProfileEventMetadataDto, () => [["StreamId", string_type], ["Version", int32_type], ["Timestamp", class_type("System.DateTime")], ["Domain", option_type(DomainMetadataDto_$reflection())]]);
561
- }
562
-
563
- export function ProfileEventMetadataDtoModule_toDomain(metadataDto) {
564
- let input_1;
565
- return new ProfileEventMetadata(new StreamId(metadataDto.StreamId), metadataDto.Version, metadataDto.Timestamp, (input_1 = metadataDto.Domain, (input_1 == null) ? undefined : DomainMetadataDtoModule_toDomain(input_1)));
566
- }
567
-
568
- export function ProfileEventMetadataDtoModule_ofDomain(metadata) {
569
- let input_1;
570
- return new ProfileEventMetadataDto(metadata.StreamId.fields[0], metadata.Version, metadata.Timestamp, (input_1 = metadata.Domain, (input_1 == null) ? undefined : DomainMetadataDtoModule_ofDomain(input_1)));
571
- }
572
-
573
- export function MetadataModule_toDomain(metadata) {
574
- return new Metadata_1(new StreamId(metadata.StreamId), metadata.Version, metadata.Timestamp);
575
- }
576
-
577
- export function MetadataModule_ofDomain(metadata) {
578
- return new Metadata(metadata.StreamId.fields[0], metadata.Version, metadata.Timestamp);
579
- }
580
-