@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.
- package/dist/assets/delete.dcc7b157.svg +5 -0
- package/dist/assets/dialog-warning.cc77f3ba.svg +5 -0
- package/dist/assets/pencil.05fe6be6.svg +5 -0
- package/dist/index.html +20 -0
- package/dist/superhero-basic-profile.js +50 -0
- package/package.json +1 -1
- package/dist/App.jsx +0 -4
- package/dist/Basic.Profile.Domain/AnalyticsEvent.jsx +0 -102
- package/dist/Basic.Profile.Domain/Audit.jsx +0 -149
- package/dist/Basic.Profile.Domain/Commands.jsx +0 -68
- package/dist/Basic.Profile.Domain/CommonTypes.jsx +0 -194
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Read.jsx +0 -58
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Write.jsx +0 -23
- package/dist/Basic.Profile.Domain/Config/Api/FlareAdminShell/Read.jsx +0 -35
- package/dist/Basic.Profile.Domain/Config/Commands.jsx +0 -72
- package/dist/Basic.Profile.Domain/Config/ConfigCommandHandler.jsx +0 -197
- package/dist/Basic.Profile.Domain/Config/Dto.jsx +0 -181
- package/dist/Basic.Profile.Domain/Config/Types.jsx +0 -152
- package/dist/Basic.Profile.Domain/DateTimeProvider.jsx +0 -23
- package/dist/Basic.Profile.Domain/DomainAggregates.jsx +0 -801
- package/dist/Basic.Profile.Domain/DomainPrimitives.jsx +0 -426
- package/dist/Basic.Profile.Domain/Dto/Aggregates.jsx +0 -564
- package/dist/Basic.Profile.Domain/Dto/AnalyticsEvent.jsx +0 -157
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Common.jsx +0 -102
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Read.jsx +0 -85
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Write.jsx +0 -16
- package/dist/Basic.Profile.Domain/Dto/Api/Common.jsx +0 -427
- package/dist/Basic.Profile.Domain/Dto/Api/External/Read.jsx +0 -118
- package/dist/Basic.Profile.Domain/Dto/Api/External/ReadV2.jsx +0 -6
- package/dist/Basic.Profile.Domain/Dto/Api/External/Write.jsx +0 -184
- package/dist/Basic.Profile.Domain/Dto/Api/External/WriteV2.jsx +0 -439
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Read.jsx +0 -38
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Write.jsx +0 -199
- package/dist/Basic.Profile.Domain/Dto/Api/Internal/Read.jsx +0 -125
- package/dist/Basic.Profile.Domain/Dto/Audit.jsx +0 -121
- package/dist/Basic.Profile.Domain/Dto/Commands.jsx +0 -256
- package/dist/Basic.Profile.Domain/Dto/Common.jsx +0 -84
- package/dist/Basic.Profile.Domain/Dto/Events.jsx +0 -220
- package/dist/Basic.Profile.Domain/Dto/Primitives.jsx +0 -580
- package/dist/Basic.Profile.Domain/Dto/ProfileCreationModels.jsx +0 -324
- package/dist/Basic.Profile.Domain/Dto/Validation.jsx +0 -229
- package/dist/Basic.Profile.Domain/Events.jsx +0 -64
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Read.jsx +0 -140
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Validation.jsx +0 -499
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Write.jsx +0 -51
- package/dist/Basic.Profile.Domain/Import/Api/Read.jsx +0 -154
- package/dist/Basic.Profile.Domain/Import/CommonTypes.jsx +0 -187
- package/dist/Basic.Profile.Domain/Import/Dto.jsx +0 -475
- package/dist/Basic.Profile.Domain/Import/ImportCommandHandler.jsx +0 -531
- package/dist/Basic.Profile.Domain/Import/Types.jsx +0 -405
- package/dist/Basic.Profile.Domain/JwtPayload.jsx +0 -44
- package/dist/Basic.Profile.Domain/Metadata.jsx +0 -257
- package/dist/Basic.Profile.Domain/ProfileCommandHandler.jsx +0 -261
- package/dist/Basic.Profile.Domain/ProfileModels.jsx +0 -59
- package/dist/Basic.Profile.Domain/Utils.jsx +0 -372
- package/dist/Common/PreactCustomElement.jsx +0 -8
- package/dist/Common/Resources.jsx +0 -20
- package/dist/Common/Tailwind.jsx +0 -8
- package/dist/Common/Utils.jsx +0 -18
- package/dist/Directory/App.jsx +0 -192
- package/dist/Directory/BackendServices/Common.jsx +0 -115
- package/dist/Directory/BackendServices/ConfigService.jsx +0 -168
- package/dist/Directory/BackendServices/ImportService.jsx +0 -137
- package/dist/Directory/Common.jsx +0 -93
- package/dist/Directory/Config/Components.jsx +0 -173
- package/dist/Directory/Config/Types.jsx +0 -187
- package/dist/Directory/PastImports/PastImports.jsx +0 -81
- package/dist/Directory/ProfileImport/ProfileImport.jsx +0 -284
- package/dist/Directory/ProfileImport/Types.jsx +0 -91
- package/dist/Directory/TabNav.jsx +0 -24
- package/dist/Directory/Types.jsx +0 -101
- package/dist/Directory/User.jsx +0 -117
- package/dist/HeadlessUI/Dialog.jsx +0 -66
- package/dist/HeadlessUI/ModalDialog.jsx +0 -74
- package/dist/HeadlessUI/Switch.jsx +0 -66
- package/dist/HeadlessUI/Transition.jsx +0 -66
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { Record, Union } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { FullProfileCreationDetailsDtoModule_ofDomain, PartialProfileUpdateDetailsDtoModule_ofDomain, PartialProfileCreationDetailsDtoModule_ofDomain, FullProfileCreationDetailsDtoModule_toDomain, PartialProfileUpdateDetailsDtoModule_toDomain, PartialProfileCreationDetailsDtoModule_toDomain, PartialProfileUpdateDetailsDto_$reflection, PartialProfileCreationDetailsDto_$reflection, FullProfileCreationDetailsDto_$reflection } from "./ProfileCreationModels.jsx";
|
|
3
|
-
import { PartnerId_toDomain, AccountId_toDomain, PartnerId_ofDomain, AccountId_ofDomain, EmergencyContactDtoModule_ofDomain, AddressModule_ofDomain, DateOfBirth_ofDomain, MobilePhone_ofDomain, Email_ofDomain, Gender_ofDomain, Title_ofDomain, NameModule_ofDomain, EmergencyContactDtoModule_toDomain, AddressModule_toDomain, DateOfBirth_toDomain, MobilePhone_toDomain, Email_toDomain, Gender_toDomain, Title_toDomain, NameModule_toDomain, EmergencyContactDto_$reflection, Address_$reflection, Name_$reflection } from "./Primitives.jsx";
|
|
4
|
-
import { class_type, int32_type, record_type, union_type, list_type, string_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
5
|
-
import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
6
|
-
import { Command$1 as Command$1_1, CommandId, ProfileCommand } from "../Commands.jsx";
|
|
7
|
-
import { traverseResultM } from "../../fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js";
|
|
8
|
-
import { map } from "../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
9
|
-
import { ProfileCommandMetadata, StreamId, DomainMetadataModule_forInternalMessageQueue } from "../Metadata.jsx";
|
|
10
|
-
|
|
11
|
-
export class ProfileCommandDto extends Union {
|
|
12
|
-
constructor(tag, fields) {
|
|
13
|
-
super();
|
|
14
|
-
this.tag = tag;
|
|
15
|
-
this.fields = fields;
|
|
16
|
-
}
|
|
17
|
-
cases() {
|
|
18
|
-
return ["Create", "CreatePartial", "UpdatePartial", "PromotePartial", "Enable", "Disable", "Archive", "Restore", "ChangeName", "ChangeTitle", "ChangeGender", "ChangeEmail", "ChangeMobilePhone", "ChangeDateOfBirth", "ChangeAddress", "ChangeEmergencyContacts", "PurgePersonalData"];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function ProfileCommandDto_$reflection() {
|
|
23
|
-
return union_type("Dto.Commands.ProfileCommandDto", [], ProfileCommandDto, () => [[["Item", FullProfileCreationDetailsDto_$reflection()]], [["Item", PartialProfileCreationDetailsDto_$reflection()]], [["Item", PartialProfileUpdateDetailsDto_$reflection()]], [["Item", FullProfileCreationDetailsDto_$reflection()]], [], [], [], [], [["Item", Name_$reflection()]], [["Item", string_type]], [["Item", string_type]], [["Item", string_type]], [["Item", string_type]], [["Item", string_type]], [["Item", Address_$reflection()]], [["Item", list_type(EmergencyContactDto_$reflection())]], []]);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function ProfileCommandDtoModule_toDomain(command) {
|
|
27
|
-
switch (command.tag) {
|
|
28
|
-
case 1: {
|
|
29
|
-
const input_3 = PartialProfileCreationDetailsDtoModule_toDomain(command.fields[0]);
|
|
30
|
-
if (input_3.tag === 1) {
|
|
31
|
-
return new FSharpResult$2(1, [input_3.fields[0]]);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return new FSharpResult$2(0, [new ProfileCommand(1, [input_3.fields[0]])]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
case 2: {
|
|
38
|
-
const input_5 = PartialProfileUpdateDetailsDtoModule_toDomain(command.fields[0]);
|
|
39
|
-
if (input_5.tag === 1) {
|
|
40
|
-
return new FSharpResult$2(1, [input_5.fields[0]]);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
return new FSharpResult$2(0, [new ProfileCommand(2, [input_5.fields[0]])]);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
case 3: {
|
|
47
|
-
const input_7 = FullProfileCreationDetailsDtoModule_toDomain(command.fields[0]);
|
|
48
|
-
if (input_7.tag === 1) {
|
|
49
|
-
return new FSharpResult$2(1, [input_7.fields[0]]);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return new FSharpResult$2(0, [new ProfileCommand(3, [input_7.fields[0]])]);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
case 4:
|
|
56
|
-
return new FSharpResult$2(0, [new ProfileCommand(4, [])]);
|
|
57
|
-
case 5:
|
|
58
|
-
return new FSharpResult$2(0, [new ProfileCommand(5, [])]);
|
|
59
|
-
case 6:
|
|
60
|
-
return new FSharpResult$2(0, [new ProfileCommand(6, [])]);
|
|
61
|
-
case 7:
|
|
62
|
-
return new FSharpResult$2(0, [new ProfileCommand(7, [])]);
|
|
63
|
-
case 8: {
|
|
64
|
-
const input_9 = NameModule_toDomain(command.fields[0]);
|
|
65
|
-
if (input_9.tag === 1) {
|
|
66
|
-
return new FSharpResult$2(1, [input_9.fields[0]]);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
return new FSharpResult$2(0, [new ProfileCommand(8, [input_9.fields[0]])]);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
case 9: {
|
|
73
|
-
const input_11 = Title_toDomain(command.fields[0]);
|
|
74
|
-
if (input_11.tag === 1) {
|
|
75
|
-
return new FSharpResult$2(1, [input_11.fields[0]]);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
return new FSharpResult$2(0, [new ProfileCommand(9, [input_11.fields[0]])]);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
case 10: {
|
|
82
|
-
const input_13 = Gender_toDomain(command.fields[0]);
|
|
83
|
-
if (input_13.tag === 1) {
|
|
84
|
-
return new FSharpResult$2(1, [input_13.fields[0]]);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return new FSharpResult$2(0, [new ProfileCommand(10, [input_13.fields[0]])]);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
case 11: {
|
|
91
|
-
const input_15 = Email_toDomain(command.fields[0]);
|
|
92
|
-
if (input_15.tag === 1) {
|
|
93
|
-
return new FSharpResult$2(1, [input_15.fields[0]]);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
return new FSharpResult$2(0, [new ProfileCommand(11, [input_15.fields[0]])]);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
case 12: {
|
|
100
|
-
const input_17 = MobilePhone_toDomain(command.fields[0]);
|
|
101
|
-
if (input_17.tag === 1) {
|
|
102
|
-
return new FSharpResult$2(1, [input_17.fields[0]]);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
return new FSharpResult$2(0, [new ProfileCommand(12, [input_17.fields[0]])]);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
case 13: {
|
|
109
|
-
const input_19 = DateOfBirth_toDomain(command.fields[0]);
|
|
110
|
-
if (input_19.tag === 1) {
|
|
111
|
-
return new FSharpResult$2(1, [input_19.fields[0]]);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return new FSharpResult$2(0, [new ProfileCommand(13, [input_19.fields[0]])]);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
case 14: {
|
|
118
|
-
const input_21 = AddressModule_toDomain(command.fields[0]);
|
|
119
|
-
if (input_21.tag === 1) {
|
|
120
|
-
return new FSharpResult$2(1, [input_21.fields[0]]);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
return new FSharpResult$2(0, [new ProfileCommand(14, [input_21.fields[0]])]);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
case 16:
|
|
127
|
-
return new FSharpResult$2(0, [new ProfileCommand(16, [])]);
|
|
128
|
-
case 15: {
|
|
129
|
-
const input_23 = traverseResultM(EmergencyContactDtoModule_toDomain, command.fields[0]);
|
|
130
|
-
if (input_23.tag === 1) {
|
|
131
|
-
return new FSharpResult$2(1, [input_23.fields[0]]);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
return new FSharpResult$2(0, [new ProfileCommand(15, [input_23.fields[0]])]);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
default: {
|
|
138
|
-
const input_1 = FullProfileCreationDetailsDtoModule_toDomain(command.fields[0]);
|
|
139
|
-
if (input_1.tag === 1) {
|
|
140
|
-
return new FSharpResult$2(1, [input_1.fields[0]]);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
return new FSharpResult$2(0, [new ProfileCommand(0, [input_1.fields[0]])]);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export function ProfileCommandDtoModule_ofDomain(command) {
|
|
150
|
-
switch (command.tag) {
|
|
151
|
-
case 1:
|
|
152
|
-
return new ProfileCommandDto(1, [PartialProfileCreationDetailsDtoModule_ofDomain(command.fields[0])]);
|
|
153
|
-
case 2:
|
|
154
|
-
return new ProfileCommandDto(2, [PartialProfileUpdateDetailsDtoModule_ofDomain(command.fields[0])]);
|
|
155
|
-
case 3:
|
|
156
|
-
return new ProfileCommandDto(3, [FullProfileCreationDetailsDtoModule_ofDomain(command.fields[0])]);
|
|
157
|
-
case 4:
|
|
158
|
-
return new ProfileCommandDto(4, []);
|
|
159
|
-
case 5:
|
|
160
|
-
return new ProfileCommandDto(5, []);
|
|
161
|
-
case 6:
|
|
162
|
-
return new ProfileCommandDto(6, []);
|
|
163
|
-
case 7:
|
|
164
|
-
return new ProfileCommandDto(7, []);
|
|
165
|
-
case 8:
|
|
166
|
-
return new ProfileCommandDto(8, [NameModule_ofDomain(command.fields[0])]);
|
|
167
|
-
case 9:
|
|
168
|
-
return new ProfileCommandDto(9, [Title_ofDomain(command.fields[0])]);
|
|
169
|
-
case 10:
|
|
170
|
-
return new ProfileCommandDto(10, [Gender_ofDomain(command.fields[0])]);
|
|
171
|
-
case 11:
|
|
172
|
-
return new ProfileCommandDto(11, [Email_ofDomain(command.fields[0])]);
|
|
173
|
-
case 12:
|
|
174
|
-
return new ProfileCommandDto(12, [MobilePhone_ofDomain(command.fields[0])]);
|
|
175
|
-
case 13:
|
|
176
|
-
return new ProfileCommandDto(13, [DateOfBirth_ofDomain(command.fields[0])]);
|
|
177
|
-
case 14:
|
|
178
|
-
return new ProfileCommandDto(14, [AddressModule_ofDomain(command.fields[0])]);
|
|
179
|
-
case 16:
|
|
180
|
-
return new ProfileCommandDto(16, []);
|
|
181
|
-
case 15:
|
|
182
|
-
return new ProfileCommandDto(15, [map(EmergencyContactDtoModule_ofDomain, command.fields[0])]);
|
|
183
|
-
default:
|
|
184
|
-
return new ProfileCommandDto(0, [FullProfileCreationDetailsDtoModule_ofDomain(command.fields[0])]);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export class DomainMetadataDto extends Record {
|
|
189
|
-
constructor(AccountId, PartnerId) {
|
|
190
|
-
super();
|
|
191
|
-
this.AccountId = AccountId;
|
|
192
|
-
this.PartnerId = PartnerId;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export function DomainMetadataDto_$reflection() {
|
|
197
|
-
return record_type("Dto.Commands.DomainMetadataDto", [], DomainMetadataDto, () => [["AccountId", string_type], ["PartnerId", string_type]]);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export function DomainMetadataDtoModule_ofDomain(domainMetadata) {
|
|
201
|
-
return new DomainMetadataDto(AccountId_ofDomain(domainMetadata.AccountId), PartnerId_ofDomain(domainMetadata.PartnerId));
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export function DomainMetadataDtoModule_toDomain(dto) {
|
|
205
|
-
return DomainMetadataModule_forInternalMessageQueue(AccountId_toDomain(dto.AccountId), PartnerId_toDomain(dto.PartnerId));
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export class ProfileCommandMetadataDto extends Record {
|
|
209
|
-
constructor(StreamId, Version, Timestamp, Domain) {
|
|
210
|
-
super();
|
|
211
|
-
this.StreamId = StreamId;
|
|
212
|
-
this.Version = (Version | 0);
|
|
213
|
-
this.Timestamp = Timestamp;
|
|
214
|
-
this.Domain = Domain;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export function ProfileCommandMetadataDto_$reflection() {
|
|
219
|
-
return record_type("Dto.Commands.ProfileCommandMetadataDto", [], ProfileCommandMetadataDto, () => [["StreamId", string_type], ["Version", int32_type], ["Timestamp", class_type("System.DateTime")], ["Domain", DomainMetadataDto_$reflection()]]);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export function ProfileCommandMetadataDtoModule_toDomain(metadata) {
|
|
223
|
-
return new ProfileCommandMetadata(new StreamId(metadata.StreamId), metadata.Version, metadata.Timestamp, DomainMetadataDtoModule_toDomain(metadata.Domain));
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export function ProfileCommandMetadataDtoModule_ofDomain(metadata, domainMetadata) {
|
|
227
|
-
return new ProfileCommandMetadataDto(metadata.StreamId.fields[0], metadata.Version, metadata.Timestamp, DomainMetadataDtoModule_ofDomain(domainMetadata));
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export class Command$1 extends Record {
|
|
231
|
-
constructor(Id, Metadata, Data) {
|
|
232
|
-
super();
|
|
233
|
-
this.Id = Id;
|
|
234
|
-
this.Metadata = Metadata;
|
|
235
|
-
this.Data = Data;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export function Command$1_$reflection(gen0) {
|
|
240
|
-
return record_type("Dto.Commands.Command`1", [gen0], Command$1, () => [["Id", string_type], ["Metadata", ProfileCommandMetadataDto_$reflection()], ["Data", gen0]]);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export function Command_toDomain(command) {
|
|
244
|
-
const input_1 = ProfileCommandDtoModule_toDomain(command.Data);
|
|
245
|
-
if (input_1.tag === 1) {
|
|
246
|
-
return new FSharpResult$2(1, [input_1.fields[0]]);
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
return new FSharpResult$2(0, [new Command$1_1(new CommandId(command.Id), input_1.fields[0], ProfileCommandMetadataDtoModule_toDomain(command.Metadata))]);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export function Command_ofDomain(command, domainMetadata) {
|
|
254
|
-
return new Command$1(command.Id.fields[0], ProfileCommandMetadataDtoModule_ofDomain(command.Metadata, domainMetadata), ProfileCommandDtoModule_ofDomain(command.Data));
|
|
255
|
-
}
|
|
256
|
-
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { Record } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { class_type, int32_type, record_type, option_type, string_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { AppVersionModule_value, StreamIdModule_value } from "../Metadata.jsx";
|
|
4
|
-
import { UtcDateTimeModule_value } from "../DomainPrimitives.jsx";
|
|
5
|
-
import { CorrelationIdModule_value, CausationIdModule_value, EventIdModule_value } from "../CommonTypes.jsx";
|
|
6
|
-
|
|
7
|
-
export class UnusedDto extends Record {
|
|
8
|
-
constructor(Unused) {
|
|
9
|
-
super();
|
|
10
|
-
this.Unused = Unused;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function UnusedDto_$reflection() {
|
|
15
|
-
return record_type("Basic.Profile.Domain.Dto.Common.Persistence.UnusedDto", [], UnusedDto, () => [["Unused", option_type(string_type)]]);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const UnusedDtoModule_Default = new UnusedDto(undefined);
|
|
19
|
-
|
|
20
|
-
export class AggregateMetadataDto$1 extends Record {
|
|
21
|
-
constructor(StreamId, Version, CreatedAt, UpdatedAt, Domain) {
|
|
22
|
-
super();
|
|
23
|
-
this.StreamId = StreamId;
|
|
24
|
-
this.Version = (Version | 0);
|
|
25
|
-
this.CreatedAt = CreatedAt;
|
|
26
|
-
this.UpdatedAt = UpdatedAt;
|
|
27
|
-
this.Domain = Domain;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function AggregateMetadataDto$1_$reflection(gen0) {
|
|
32
|
-
return record_type("Basic.Profile.Domain.Dto.Common.Persistence.AggregateMetadataDto`1", [gen0], AggregateMetadataDto$1, () => [["StreamId", string_type], ["Version", int32_type], ["CreatedAt", class_type("System.DateTime")], ["UpdatedAt", class_type("System.DateTime")], ["Domain", gen0]]);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class AggregateDto$2 extends Record {
|
|
36
|
-
constructor(Data, Metadata) {
|
|
37
|
-
super();
|
|
38
|
-
this.Data = Data;
|
|
39
|
-
this.Metadata = Metadata;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function AggregateDto$2_$reflection(gen0, gen1) {
|
|
44
|
-
return record_type("Basic.Profile.Domain.Dto.Common.Persistence.AggregateDto`2", [gen0, gen1], AggregateDto$2, () => [["Data", gen0], ["Metadata", AggregateMetadataDto$1_$reflection(gen1)]]);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export class EventMetadataDto$1 extends Record {
|
|
48
|
-
constructor(StreamId, Version, Timestamp, AppVersion, Domain) {
|
|
49
|
-
super();
|
|
50
|
-
this.StreamId = StreamId;
|
|
51
|
-
this.Version = (Version | 0);
|
|
52
|
-
this.Timestamp = Timestamp;
|
|
53
|
-
this.AppVersion = AppVersion;
|
|
54
|
-
this.Domain = Domain;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function EventMetadataDto$1_$reflection(gen0) {
|
|
59
|
-
return record_type("Basic.Profile.Domain.Dto.Common.Persistence.EventMetadataDto`1", [gen0], EventMetadataDto$1, () => [["StreamId", string_type], ["Version", int32_type], ["Timestamp", class_type("System.DateTime")], ["AppVersion", string_type], ["Domain", gen0]]);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function EventMetadataDto_ofDomain(metadata, domainMetadataDto) {
|
|
63
|
-
return new EventMetadataDto$1(StreamIdModule_value(metadata.StreamId), metadata.Version, UtcDateTimeModule_value(metadata.Timestamp), AppVersionModule_value(metadata.AppVersion), domainMetadataDto);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export class EventDto$2 extends Record {
|
|
67
|
-
constructor(Id, CausationId, CorrelationId, Event$, Metadata) {
|
|
68
|
-
super();
|
|
69
|
-
this.Id = Id;
|
|
70
|
-
this.CausationId = CausationId;
|
|
71
|
-
this.CorrelationId = CorrelationId;
|
|
72
|
-
this.Event = Event$;
|
|
73
|
-
this.Metadata = Metadata;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function EventDto$2_$reflection(gen0, gen1) {
|
|
78
|
-
return record_type("Basic.Profile.Domain.Dto.Common.Persistence.EventDto`2", [gen0, gen1], EventDto$2, () => [["Id", class_type("System.Guid")], ["CausationId", string_type], ["CorrelationId", string_type], ["Event", gen0], ["Metadata", EventMetadataDto$1_$reflection(gen1)]]);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function EventDto_ofDomain(event, eventPayloadDto, domainMetadataDto) {
|
|
82
|
-
return new EventDto$2(EventIdModule_value(event.Id), CausationIdModule_value(event.CausationId), CorrelationIdModule_value(event.CorrelationId), eventPayloadDto, EventMetadataDto_ofDomain(event.Metadata, domainMetadataDto));
|
|
83
|
-
}
|
|
84
|
-
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { Record, Union } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { FullProfileCreationDetailsDtoModule_ofDomain, PartialProfileUpdateDetailsDtoModule_ofDomain, PartialProfileCreationDetailsDtoModule_ofDomain, FullProfileCreationDetailsDtoModule_toDomain, PartialProfileUpdateDetailsDtoModule_toDomain, PartialProfileCreationDetailsDtoModule_toDomain, PartialProfileUpdateDetailsDto_$reflection, PartialProfileCreationDetailsDto_$reflection, FullProfileCreationDetailsDto_$reflection } from "./ProfileCreationModels.jsx";
|
|
3
|
-
import { ProfileEventMetadataDtoModule_ofDomain, ProfileEventMetadataDtoModule_toDomain, ProfileEventMetadataDto_$reflection, EmergencyContactDtoModule_ofDomain, AddressModule_ofDomain, DateOfBirth_ofDomain, MobilePhone_ofDomain, Email_ofDomain, Gender_ofDomain, Title_ofDomain, NameModule_ofDomain, EmergencyContactDtoModule_toDomain, AddressModule_toDomain, DateOfBirth_toDomain, MobilePhone_toDomain, Email_toDomain, Gender_toDomain, Title_toDomain, NameModule_toDomain, EmergencyContactDto_$reflection, Address_$reflection, Name_$reflection } from "./Primitives.jsx";
|
|
4
|
-
import { record_type, class_type, union_type, list_type, string_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
5
|
-
import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
6
|
-
import { Event$1 as Event$1_1, EventId, ProfileEvent as ProfileEvent_1 } from "../Events.jsx";
|
|
7
|
-
import { traverseResultM } from "../../fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js";
|
|
8
|
-
import { map } from "../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
9
|
-
import { CommandId } from "../Commands.jsx";
|
|
10
|
-
|
|
11
|
-
export class ProfileEvent extends Union {
|
|
12
|
-
constructor(tag, fields) {
|
|
13
|
-
super();
|
|
14
|
-
this.tag = tag;
|
|
15
|
-
this.fields = fields;
|
|
16
|
-
}
|
|
17
|
-
cases() {
|
|
18
|
-
return ["ProfileCreated", "PartialCreated", "PartialUpdated", "PartialPromoted", "ProfileEnabled", "ProfileDisabled", "ProfileActivated", "ProfileDeactivated", "ProfileArchived", "ProfileRestored", "NameChanged", "TitleChanged", "GenderChanged", "EmailChanged", "MobilePhoneChanged", "DateOfBirthChanged", "AddressChanged", "EmergencyContactsChanged", "PersonalDataPurged"];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function ProfileEvent_$reflection() {
|
|
23
|
-
return union_type("Dto.Events.ProfileEvent", [], ProfileEvent, () => [[["Item", FullProfileCreationDetailsDto_$reflection()]], [["Item", PartialProfileCreationDetailsDto_$reflection()]], [["Item", PartialProfileUpdateDetailsDto_$reflection()]], [["Item", FullProfileCreationDetailsDto_$reflection()]], [], [], [], [], [], [], [["Item", Name_$reflection()]], [["Item", string_type]], [["Item", string_type]], [["Item", string_type]], [["Item", string_type]], [["Item", string_type]], [["Item", Address_$reflection()]], [["Item", list_type(EmergencyContactDto_$reflection())]], []]);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function ProfileEventModule_toDomain(event) {
|
|
27
|
-
switch (event.tag) {
|
|
28
|
-
case 1: {
|
|
29
|
-
const input_1 = PartialProfileCreationDetailsDtoModule_toDomain(event.fields[0]);
|
|
30
|
-
if (input_1.tag === 1) {
|
|
31
|
-
return new FSharpResult$2(1, [input_1.fields[0]]);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(1, [input_1.fields[0]])]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
case 2: {
|
|
38
|
-
const input_2 = PartialProfileUpdateDetailsDtoModule_toDomain(event.fields[0]);
|
|
39
|
-
if (input_2.tag === 1) {
|
|
40
|
-
return new FSharpResult$2(1, [input_2.fields[0]]);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(2, [input_2.fields[0]])]);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
case 3: {
|
|
47
|
-
const input_3 = FullProfileCreationDetailsDtoModule_toDomain(event.fields[0]);
|
|
48
|
-
if (input_3.tag === 1) {
|
|
49
|
-
return new FSharpResult$2(1, [input_3.fields[0]]);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(3, [input_3.fields[0]])]);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
case 4:
|
|
56
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(7, [])]);
|
|
57
|
-
case 5:
|
|
58
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(6, [])]);
|
|
59
|
-
case 6:
|
|
60
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(4, [])]);
|
|
61
|
-
case 7:
|
|
62
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(5, [])]);
|
|
63
|
-
case 8:
|
|
64
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(6, [])]);
|
|
65
|
-
case 9:
|
|
66
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(7, [])]);
|
|
67
|
-
case 10: {
|
|
68
|
-
const input_5 = NameModule_toDomain(event.fields[0]);
|
|
69
|
-
if (input_5.tag === 1) {
|
|
70
|
-
return new FSharpResult$2(1, [input_5.fields[0]]);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(8, [input_5.fields[0]])]);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
case 11: {
|
|
77
|
-
const input_7 = Title_toDomain(event.fields[0]);
|
|
78
|
-
if (input_7.tag === 1) {
|
|
79
|
-
return new FSharpResult$2(1, [input_7.fields[0]]);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(9, [input_7.fields[0]])]);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
case 12: {
|
|
86
|
-
const input_9 = Gender_toDomain(event.fields[0]);
|
|
87
|
-
if (input_9.tag === 1) {
|
|
88
|
-
return new FSharpResult$2(1, [input_9.fields[0]]);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(10, [input_9.fields[0]])]);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
case 13: {
|
|
95
|
-
const input_11 = Email_toDomain(event.fields[0]);
|
|
96
|
-
if (input_11.tag === 1) {
|
|
97
|
-
return new FSharpResult$2(1, [input_11.fields[0]]);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(11, [input_11.fields[0]])]);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
case 14: {
|
|
104
|
-
const input_13 = MobilePhone_toDomain(event.fields[0]);
|
|
105
|
-
if (input_13.tag === 1) {
|
|
106
|
-
return new FSharpResult$2(1, [input_13.fields[0]]);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(12, [input_13.fields[0]])]);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
case 15: {
|
|
113
|
-
const input_15 = DateOfBirth_toDomain(event.fields[0]);
|
|
114
|
-
if (input_15.tag === 1) {
|
|
115
|
-
return new FSharpResult$2(1, [input_15.fields[0]]);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(13, [input_15.fields[0]])]);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
case 16: {
|
|
122
|
-
const input_17 = AddressModule_toDomain(event.fields[0]);
|
|
123
|
-
if (input_17.tag === 1) {
|
|
124
|
-
return new FSharpResult$2(1, [input_17.fields[0]]);
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(14, [input_17.fields[0]])]);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
case 18:
|
|
131
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(16, [])]);
|
|
132
|
-
case 17: {
|
|
133
|
-
const input_18 = traverseResultM(EmergencyContactDtoModule_toDomain, event.fields[0]);
|
|
134
|
-
if (input_18.tag === 1) {
|
|
135
|
-
return new FSharpResult$2(1, [input_18.fields[0]]);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(15, [input_18.fields[0]])]);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
default: {
|
|
142
|
-
const input = FullProfileCreationDetailsDtoModule_toDomain(event.fields[0]);
|
|
143
|
-
if (input.tag === 1) {
|
|
144
|
-
return new FSharpResult$2(1, [input.fields[0]]);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
return new FSharpResult$2(0, [new ProfileEvent_1(0, [input.fields[0]])]);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export function ProfileEventModule_ofDomain(_arg) {
|
|
154
|
-
switch (_arg.tag) {
|
|
155
|
-
case 1:
|
|
156
|
-
return new ProfileEvent(1, [PartialProfileCreationDetailsDtoModule_ofDomain(_arg.fields[0])]);
|
|
157
|
-
case 2:
|
|
158
|
-
return new ProfileEvent(2, [PartialProfileUpdateDetailsDtoModule_ofDomain(_arg.fields[0])]);
|
|
159
|
-
case 3:
|
|
160
|
-
return new ProfileEvent(3, [FullProfileCreationDetailsDtoModule_ofDomain(_arg.fields[0])]);
|
|
161
|
-
case 4:
|
|
162
|
-
return new ProfileEvent(6, []);
|
|
163
|
-
case 5:
|
|
164
|
-
return new ProfileEvent(7, []);
|
|
165
|
-
case 6:
|
|
166
|
-
return new ProfileEvent(8, []);
|
|
167
|
-
case 7:
|
|
168
|
-
return new ProfileEvent(9, []);
|
|
169
|
-
case 8:
|
|
170
|
-
return new ProfileEvent(10, [NameModule_ofDomain(_arg.fields[0])]);
|
|
171
|
-
case 9:
|
|
172
|
-
return new ProfileEvent(11, [Title_ofDomain(_arg.fields[0])]);
|
|
173
|
-
case 10:
|
|
174
|
-
return new ProfileEvent(12, [Gender_ofDomain(_arg.fields[0])]);
|
|
175
|
-
case 11:
|
|
176
|
-
return new ProfileEvent(13, [Email_ofDomain(_arg.fields[0])]);
|
|
177
|
-
case 12:
|
|
178
|
-
return new ProfileEvent(14, [MobilePhone_ofDomain(_arg.fields[0])]);
|
|
179
|
-
case 13:
|
|
180
|
-
return new ProfileEvent(15, [DateOfBirth_ofDomain(_arg.fields[0])]);
|
|
181
|
-
case 14:
|
|
182
|
-
return new ProfileEvent(16, [AddressModule_ofDomain(_arg.fields[0])]);
|
|
183
|
-
case 16:
|
|
184
|
-
return new ProfileEvent(18, []);
|
|
185
|
-
case 15:
|
|
186
|
-
return new ProfileEvent(17, [map(EmergencyContactDtoModule_ofDomain, _arg.fields[0])]);
|
|
187
|
-
default:
|
|
188
|
-
return new ProfileEvent(0, [FullProfileCreationDetailsDtoModule_ofDomain(_arg.fields[0])]);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export class Event$1 extends Record {
|
|
193
|
-
constructor(Id, CommandId, Metadata, Data) {
|
|
194
|
-
super();
|
|
195
|
-
this.Id = Id;
|
|
196
|
-
this.CommandId = CommandId;
|
|
197
|
-
this.Metadata = Metadata;
|
|
198
|
-
this.Data = Data;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export function Event$1_$reflection(gen0) {
|
|
203
|
-
return record_type("Dto.Events.Event`1", [gen0], Event$1, () => [["Id", class_type("System.Guid")], ["CommandId", string_type], ["Metadata", ProfileEventMetadataDto_$reflection()], ["Data", gen0]]);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export function Event_toDomain(converter, event) {
|
|
207
|
-
const input_1 = converter(event.Data);
|
|
208
|
-
if (input_1.tag === 1) {
|
|
209
|
-
return new FSharpResult$2(1, [input_1.fields[0]]);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
return new FSharpResult$2(0, [new Event$1_1(new EventId(event.Id), new CommandId(event.CommandId), input_1.fields[0], ProfileEventMetadataDtoModule_toDomain(event.Metadata))]);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export function Event_ofDomain(converter, event) {
|
|
217
|
-
const Data = converter(event.Data);
|
|
218
|
-
return new Event$1(event.Id.fields[0], event.CommandId.fields[0], ProfileEventMetadataDtoModule_ofDomain(event.Metadata), Data);
|
|
219
|
-
}
|
|
220
|
-
|