@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,72 +0,0 @@
|
|
|
1
|
-
import { Union, Record } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { option_type, union_type, record_type, bool_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { AccountId_$reflection, PartnerId_$reflection } from "../DomainPrimitives.jsx";
|
|
4
|
-
import { Source_$reflection } from "../Metadata.jsx";
|
|
5
|
-
import { ConfigModule_createStreamId, ConfigEventMetadata } from "./Types.jsx";
|
|
6
|
-
import { Event$2, EventMetadata$1, EventIdModule_generate, Command$2, CorrelationIdModule_create, CausationIdModule_create, CommandMetadata_create, CommandMetadata_createNew } from "../CommonTypes.jsx";
|
|
7
|
-
import { CommandIdModule_createNew } from "../Commands.jsx";
|
|
8
|
-
|
|
9
|
-
export class UpdateOrCreateCommandDetails extends Record {
|
|
10
|
-
constructor(AdminUserManagementEnabled) {
|
|
11
|
-
super();
|
|
12
|
-
this.AdminUserManagementEnabled = AdminUserManagementEnabled;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function UpdateOrCreateCommandDetails_$reflection() {
|
|
17
|
-
return record_type("Basic.Profile.Domain.Config.Commands.UpdateOrCreateCommandDetails", [], UpdateOrCreateCommandDetails, () => [["AdminUserManagementEnabled", bool_type]]);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class ConfigCommandPayload extends Union {
|
|
21
|
-
constructor(tag, fields) {
|
|
22
|
-
super();
|
|
23
|
-
this.tag = tag;
|
|
24
|
-
this.fields = fields;
|
|
25
|
-
}
|
|
26
|
-
cases() {
|
|
27
|
-
return ["Create", "Update", "Delete"];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function ConfigCommandPayload_$reflection() {
|
|
32
|
-
return union_type("Basic.Profile.Domain.Config.Commands.ConfigCommandPayload", [], ConfigCommandPayload, () => [[["Item", UpdateOrCreateCommandDetails_$reflection()]], [["Item", UpdateOrCreateCommandDetails_$reflection()]], []]);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class ConfigCommandMetadata extends Record {
|
|
36
|
-
constructor(PartnerId, AccountId, Source) {
|
|
37
|
-
super();
|
|
38
|
-
this.PartnerId = PartnerId;
|
|
39
|
-
this.AccountId = AccountId;
|
|
40
|
-
this.Source = Source;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function ConfigCommandMetadata_$reflection() {
|
|
45
|
-
return record_type("Basic.Profile.Domain.Config.Commands.ConfigCommandMetadata", [], ConfigCommandMetadata, () => [["PartnerId", PartnerId_$reflection()], ["AccountId", option_type(AccountId_$reflection())], ["Source", Source_$reflection()]]);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function ConfigCommandMetadataModule_toEventMetadata(commandMetadata) {
|
|
49
|
-
return new ConfigEventMetadata(commandMetadata.PartnerId, commandMetadata.AccountId, commandMetadata.Source);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function ConfigCommandModule_createMetadata(currentConfig, commandDomainMetadata, currentTime, appVersion) {
|
|
53
|
-
if (currentConfig == null) {
|
|
54
|
-
return CommandMetadata_createNew(ConfigModule_createStreamId(commandDomainMetadata.PartnerId, commandDomainMetadata.AccountId), currentTime, commandDomainMetadata, appVersion);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
const agg = currentConfig;
|
|
58
|
-
return CommandMetadata_create(agg.Metadata.StreamId, agg.Metadata.Version, currentTime, commandDomainMetadata, appVersion);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function ConfigCommandModule_create(currentConfig, commandDomainMetadata, currentTime, invocationId, payload, appVersion) {
|
|
63
|
-
const metadata = ConfigCommandModule_createMetadata(currentConfig, commandDomainMetadata, currentTime, appVersion);
|
|
64
|
-
const causationId = CausationIdModule_create(invocationId);
|
|
65
|
-
const correlationId = CorrelationIdModule_create(invocationId);
|
|
66
|
-
return new Command$2(CommandIdModule_createNew(), causationId, correlationId, payload, metadata);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function ConfigCommandModule_toEvent(command, eventPayload, version) {
|
|
70
|
-
return new Event$2(EventIdModule_generate(), command.CausationId, command.CorrelationId, eventPayload, new EventMetadata$1(command.Metadata.StreamId, version, command.Metadata.AppVersion, command.Metadata.Timestamp, ConfigCommandMetadataModule_toEventMetadata(command.Metadata.Domain)));
|
|
71
|
-
}
|
|
72
|
-
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { Union } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { list_type, union_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { ConfigEventPayload, CreateOrUpdateEventDetails, Config, ConfigContent, ConfigEventModule_createAggregateMetadata, ConfigEventMetadata_$reflection, ConfigEventPayload_$reflection, ConfigMetadata_$reflection, Config_$reflection } from "./Types.jsx";
|
|
4
|
-
import { Aggregate$2, Event$2_$reflection, Aggregate$2_$reflection } from "../CommonTypes.jsx";
|
|
5
|
-
import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
6
|
-
import { isEmpty, fold, mapIndexed, empty, singleton } from "../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
7
|
-
import { equals } from "../../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
8
|
-
import { ConfigCommandModule_toEvent } from "./Commands.jsx";
|
|
9
|
-
|
|
10
|
-
export class ConfigError extends Union {
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
this.tag = 0;
|
|
14
|
-
this.fields = [];
|
|
15
|
-
}
|
|
16
|
-
cases() {
|
|
17
|
-
return ["Inconsistent"];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function ConfigError_$reflection() {
|
|
22
|
-
return union_type("Basic.Profile.Domain.Config.ConfigCommandHandler.ConfigError", [], ConfigError, () => [[]]);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export class HandlerResult extends Union {
|
|
26
|
-
constructor(tag, fields) {
|
|
27
|
-
super();
|
|
28
|
-
this.tag = tag;
|
|
29
|
-
this.fields = fields;
|
|
30
|
-
}
|
|
31
|
-
cases() {
|
|
32
|
-
return ["Failed", "NoChange", "Create", "Update"];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function HandlerResult_$reflection() {
|
|
37
|
-
return union_type("Basic.Profile.Domain.Config.ConfigCommandHandler.HandlerResult", [], HandlerResult, () => [[["Item", ConfigError_$reflection()]], [], [["Item1", Aggregate$2_$reflection(Config_$reflection(), ConfigMetadata_$reflection())], ["Item2", list_type(Event$2_$reflection(ConfigEventPayload_$reflection(), ConfigEventMetadata_$reflection()))]], [["Item1", Aggregate$2_$reflection(Config_$reflection(), ConfigMetadata_$reflection())], ["Item2", list_type(Event$2_$reflection(ConfigEventPayload_$reflection(), ConfigEventMetadata_$reflection()))]]]);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function apply(config, event) {
|
|
41
|
-
if (config.tag === 1) {
|
|
42
|
-
return new FSharpResult$2(1, [config.fields[0]]);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
const details = config.fields[0];
|
|
46
|
-
const metadata = ConfigEventModule_createAggregateMetadata(details, event);
|
|
47
|
-
let input_1;
|
|
48
|
-
const matchValue = event.Payload;
|
|
49
|
-
let matchResult, payload, agg, payload_1, agg_1;
|
|
50
|
-
if (details != null) {
|
|
51
|
-
switch (matchValue.tag) {
|
|
52
|
-
case 1: {
|
|
53
|
-
matchResult = 1;
|
|
54
|
-
agg = details;
|
|
55
|
-
payload_1 = matchValue.fields[0];
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
case 2: {
|
|
59
|
-
matchResult = 2;
|
|
60
|
-
agg_1 = details;
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
default:
|
|
64
|
-
matchResult = 3;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else if (matchValue.tag === 0) {
|
|
68
|
-
matchResult = 0;
|
|
69
|
-
payload = matchValue.fields[0];
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
matchResult = 3;
|
|
73
|
-
}
|
|
74
|
-
switch (matchResult) {
|
|
75
|
-
case 0: {
|
|
76
|
-
input_1 = (new FSharpResult$2(0, [new Config(0, [new ConfigContent(payload.AdminUserManagementEnabled)])]));
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
case 1: {
|
|
80
|
-
input_1 = (new FSharpResult$2(0, [new Config(0, [new ConfigContent(payload_1.AdminUserManagementEnabled)])]));
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
case 2: {
|
|
84
|
-
input_1 = (new FSharpResult$2(0, [new Config(1, [])]));
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
default:
|
|
88
|
-
input_1 = (new FSharpResult$2(1, [new ConfigError()]));
|
|
89
|
-
}
|
|
90
|
-
if (input_1.tag === 1) {
|
|
91
|
-
return new FSharpResult$2(1, [input_1.fields[0]]);
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
return new FSharpResult$2(0, [new Aggregate$2(input_1.fields[0], metadata)]);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export function execute(aggregate, command) {
|
|
100
|
-
let input_1;
|
|
101
|
-
const matchValue = command.Payload;
|
|
102
|
-
let matchResult, details, currentAgg, details_1, currentAgg_1;
|
|
103
|
-
switch (matchValue.tag) {
|
|
104
|
-
case 1: {
|
|
105
|
-
if (aggregate != null) {
|
|
106
|
-
matchResult = 1;
|
|
107
|
-
currentAgg = aggregate;
|
|
108
|
-
details_1 = matchValue.fields[0];
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
matchResult = 3;
|
|
112
|
-
}
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case 2: {
|
|
116
|
-
if (aggregate != null) {
|
|
117
|
-
matchResult = 2;
|
|
118
|
-
currentAgg_1 = aggregate;
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
matchResult = 3;
|
|
122
|
-
}
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
default:
|
|
126
|
-
if (aggregate == null) {
|
|
127
|
-
matchResult = 0;
|
|
128
|
-
details = matchValue.fields[0];
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
matchResult = 3;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
switch (matchResult) {
|
|
135
|
-
case 0: {
|
|
136
|
-
input_1 = (new FSharpResult$2(0, [singleton(new ConfigEventPayload(0, [new CreateOrUpdateEventDetails(details.AdminUserManagementEnabled)]))]));
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
case 1: {
|
|
140
|
-
input_1 = (equals(new Config(0, [new ConfigContent(details_1.AdminUserManagementEnabled)]), currentAgg.Data) ? (new FSharpResult$2(0, [empty()])) : (new FSharpResult$2(0, [singleton(new ConfigEventPayload(1, [new CreateOrUpdateEventDetails(details_1.AdminUserManagementEnabled)]))])));
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
case 2: {
|
|
144
|
-
input_1 = (equals(new Config(1, []), currentAgg_1.Data) ? (new FSharpResult$2(0, [empty()])) : (new FSharpResult$2(0, [singleton(new ConfigEventPayload(2, []))])));
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
default:
|
|
148
|
-
input_1 = (new FSharpResult$2(1, [new ConfigError()]));
|
|
149
|
-
}
|
|
150
|
-
if (input_1.tag === 1) {
|
|
151
|
-
return new FSharpResult$2(1, [input_1.fields[0]]);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
return new FSharpResult$2(0, [mapIndexed((index, eventPayload) => ConfigCommandModule_toEvent(command, eventPayload, (command.Metadata.Version + index) + 1), input_1.fields[0])]);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function handleConsistentCommand(aggregate, command) {
|
|
159
|
-
let updatedAggregate, matchValue, agg_1, agg;
|
|
160
|
-
let r;
|
|
161
|
-
const input_2 = execute(aggregate, command);
|
|
162
|
-
if (input_2.tag === 1) {
|
|
163
|
-
r = (new FSharpResult$2(1, [input_2.fields[0]]));
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
const events = input_2.fields[0];
|
|
167
|
-
const input = fold(apply, new FSharpResult$2(0, [aggregate]), events);
|
|
168
|
-
r = ((input.tag === 1) ? (new FSharpResult$2(1, [input.fields[0]])) : (new FSharpResult$2(0, [(updatedAggregate = input.fields[0], (matchValue = command.Payload, (matchValue.tag === 1) ? (isEmpty(events) ? (new HandlerResult(1, [])) : ((updatedAggregate != null) ? ((agg_1 = updatedAggregate, new HandlerResult(3, [agg_1, events]))) : (new HandlerResult(0, [new ConfigError()])))) : ((matchValue.tag === 2) ? (isEmpty(events) ? (new HandlerResult(1, [])) : ((updatedAggregate != null) ? ((agg_1 = updatedAggregate, new HandlerResult(3, [agg_1, events]))) : (new HandlerResult(0, [new ConfigError()])))) : ((updatedAggregate != null) ? ((agg = updatedAggregate, new HandlerResult(2, [agg, events]))) : (new HandlerResult(0, [new ConfigError()]))))))])));
|
|
169
|
-
}
|
|
170
|
-
if (r.tag === 1) {
|
|
171
|
-
return new HandlerResult(0, [r.fields[0]]);
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
return r.fields[0];
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export function handle(aggregate, command) {
|
|
179
|
-
let m, a;
|
|
180
|
-
const matchValue = command.Metadata;
|
|
181
|
-
if (aggregate != null) {
|
|
182
|
-
if ((m = matchValue, (a = aggregate, (a.Metadata.Version === m.Version) && equals(m.StreamId, a.Metadata.StreamId)))) {
|
|
183
|
-
const a_1 = aggregate;
|
|
184
|
-
return handleConsistentCommand(aggregate, command);
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
return new HandlerResult(0, [new ConfigError()]);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
else if (matchValue.Version === 0) {
|
|
191
|
-
return handleConsistentCommand(aggregate, command);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
return new HandlerResult(0, [new ConfigError()]);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { Union, Record } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { option_type, string_type, union_type, record_type, bool_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { ConfigMetadata, Config, ConfigContent } from "./Types.jsx";
|
|
4
|
-
import { EventDto_ofDomain, UnusedDto, AggregateDto$2, AggregateMetadataDto$1, UnusedDtoModule_Default, UnusedDto_$reflection } from "../Dto/Common.jsx";
|
|
5
|
-
import { SourceDtoModule_ofDomain, SourceDto_$reflection, AccountId_ofDomain, PartnerId_ofDomain } from "../Dto/Primitives.jsx";
|
|
6
|
-
import { map } from "../../fable_modules/fable-library-js.4.20.0/Option.js";
|
|
7
|
-
import { AccountIdModule_value, PartnerIdModule_value, UtcDateTimeModule_create, UtcDateTimeModule_value, AccountId, PartnerId } from "../DomainPrimitives.jsx";
|
|
8
|
-
import { StreamId, StreamIdModule_value } from "../Metadata.jsx";
|
|
9
|
-
import { Aggregate$2, AggregateMetadata$1 } from "../CommonTypes.jsx";
|
|
10
|
-
|
|
11
|
-
export class ConfigContentDto extends Record {
|
|
12
|
-
constructor(AdminUserManagementEnabled) {
|
|
13
|
-
super();
|
|
14
|
-
this.AdminUserManagementEnabled = AdminUserManagementEnabled;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function ConfigContentDto_$reflection() {
|
|
19
|
-
return record_type("Basic.Profile.Domain.Config.PersistenceDto.ConfigContentDto", [], ConfigContentDto, () => [["AdminUserManagementEnabled", bool_type]]);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function ConfigContentDtoModule_ofDomain(config) {
|
|
23
|
-
return new ConfigContentDto(config.AdminUserManagementEnabled);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function ConfigContentDtoModule_toDomain(dto) {
|
|
27
|
-
return new ConfigContent(dto.AdminUserManagementEnabled);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export class ConfigDto extends Union {
|
|
31
|
-
constructor(tag, fields) {
|
|
32
|
-
super();
|
|
33
|
-
this.tag = tag;
|
|
34
|
-
this.fields = fields;
|
|
35
|
-
}
|
|
36
|
-
cases() {
|
|
37
|
-
return ["Specific", "Inherited"];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function ConfigDto_$reflection() {
|
|
42
|
-
return union_type("Basic.Profile.Domain.Config.PersistenceDto.ConfigDto", [], ConfigDto, () => [[["Item", ConfigContentDto_$reflection()]], [["Item", UnusedDto_$reflection()]]]);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function ConfigDtoModule_ofDomain(config) {
|
|
46
|
-
if (config.tag === 1) {
|
|
47
|
-
return new ConfigDto(1, [UnusedDtoModule_Default]);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
return new ConfigDto(0, [ConfigContentDtoModule_ofDomain(config.fields[0])]);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function ConfigDtoModule_toDomain(dto) {
|
|
55
|
-
if (dto.tag === 1) {
|
|
56
|
-
return new Config(1, []);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
return new Config(0, [ConfigContentDtoModule_toDomain(dto.fields[0])]);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export class ConfigDataVersionedDto extends Union {
|
|
64
|
-
constructor(tag, fields) {
|
|
65
|
-
super();
|
|
66
|
-
this.tag = tag;
|
|
67
|
-
this.fields = fields;
|
|
68
|
-
}
|
|
69
|
-
cases() {
|
|
70
|
-
return ["V1", "Unused"];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function ConfigDataVersionedDto_$reflection() {
|
|
75
|
-
return union_type("Basic.Profile.Domain.Config.PersistenceDto.ConfigDataVersionedDto", [], ConfigDataVersionedDto, () => [[["Item", ConfigDto_$reflection()]], []]);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function ConfigDataVersionedDtoModule_ofDomain(config) {
|
|
79
|
-
return new ConfigDataVersionedDto(0, [ConfigDtoModule_ofDomain(config)]);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function ConfigDataVersionedDtoModule_toDomain(configV1) {
|
|
83
|
-
if (configV1.tag === 1) {
|
|
84
|
-
throw new Error("Config cannot be Unused value");
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return ConfigDtoModule_toDomain(configV1.fields[0]);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export class ConfigMetadataDto extends Record {
|
|
92
|
-
constructor(PartnerId, AccountId) {
|
|
93
|
-
super();
|
|
94
|
-
this.PartnerId = PartnerId;
|
|
95
|
-
this.AccountId = AccountId;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export function ConfigMetadataDto_$reflection() {
|
|
100
|
-
return record_type("Basic.Profile.Domain.Config.PersistenceDto.ConfigMetadataDto", [], ConfigMetadataDto, () => [["PartnerId", string_type], ["AccountId", option_type(string_type)]]);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function ConfigMetadataDtoModule_ofDomain(domainMetadata) {
|
|
104
|
-
return new ConfigMetadataDto(PartnerId_ofDomain(domainMetadata.PartnerId), map(AccountId_ofDomain, domainMetadata.AccountId));
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export function ConfigMetadataDtoModule_toDomain(metadataDto) {
|
|
108
|
-
return new ConfigMetadata(new PartnerId(metadataDto.PartnerId), map((Item_1) => (new AccountId(Item_1)), metadataDto.AccountId));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export function ConfigAggregateDtoModule_ofDomain(configAgg) {
|
|
112
|
-
return new AggregateDto$2(ConfigDataVersionedDtoModule_ofDomain(configAgg.Data), new AggregateMetadataDto$1(StreamIdModule_value(configAgg.Metadata.StreamId), configAgg.Metadata.Version, UtcDateTimeModule_value(configAgg.Metadata.CreatedAt), UtcDateTimeModule_value(configAgg.Metadata.UpdatedAt), ConfigMetadataDtoModule_ofDomain(configAgg.Metadata.Domain)));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export function ConfigAggregateDtoModule_toDomain(configAggDto) {
|
|
116
|
-
return new Aggregate$2(ConfigDataVersionedDtoModule_toDomain(configAggDto.Data), new AggregateMetadata$1(new StreamId(configAggDto.Metadata.StreamId), configAggDto.Metadata.Version, UtcDateTimeModule_create(configAggDto.Metadata.CreatedAt), UtcDateTimeModule_create(configAggDto.Metadata.UpdatedAt), ConfigMetadataDtoModule_toDomain(configAggDto.Metadata.Domain)));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export class CreatedOrUpdatedEventDetailsDto extends Record {
|
|
120
|
-
constructor(AdminUserManagementEnabled) {
|
|
121
|
-
super();
|
|
122
|
-
this.AdminUserManagementEnabled = AdminUserManagementEnabled;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export function CreatedOrUpdatedEventDetailsDto_$reflection() {
|
|
127
|
-
return record_type("Basic.Profile.Domain.Config.PersistenceDto.CreatedOrUpdatedEventDetailsDto", [], CreatedOrUpdatedEventDetailsDto, () => [["AdminUserManagementEnabled", bool_type]]);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function CreatedOrUpdatedEventDetailsDtoModule_ofDomain(details) {
|
|
131
|
-
return new CreatedOrUpdatedEventDetailsDto(details.AdminUserManagementEnabled);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export class ConfigEventPayloadDto extends Union {
|
|
135
|
-
constructor(tag, fields) {
|
|
136
|
-
super();
|
|
137
|
-
this.tag = tag;
|
|
138
|
-
this.fields = fields;
|
|
139
|
-
}
|
|
140
|
-
cases() {
|
|
141
|
-
return ["Created", "Updated", "Deleted"];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export function ConfigEventPayloadDto_$reflection() {
|
|
146
|
-
return union_type("Basic.Profile.Domain.Config.PersistenceDto.ConfigEventPayloadDto", [], ConfigEventPayloadDto, () => [[["Item", CreatedOrUpdatedEventDetailsDto_$reflection()]], [["Item", CreatedOrUpdatedEventDetailsDto_$reflection()]], [["Item", UnusedDto_$reflection()]]]);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export function ConfigEventPayloadDtoModule_ofDomain(eventPayload) {
|
|
150
|
-
switch (eventPayload.tag) {
|
|
151
|
-
case 1:
|
|
152
|
-
return new ConfigEventPayloadDto(1, [CreatedOrUpdatedEventDetailsDtoModule_ofDomain(eventPayload.fields[0])]);
|
|
153
|
-
case 2:
|
|
154
|
-
return new ConfigEventPayloadDto(2, [new UnusedDto(undefined)]);
|
|
155
|
-
default:
|
|
156
|
-
return new ConfigEventPayloadDto(0, [CreatedOrUpdatedEventDetailsDtoModule_ofDomain(eventPayload.fields[0])]);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export class ConfigEventMetadataDto extends Record {
|
|
161
|
-
constructor(PartnerId, AccountId, Source) {
|
|
162
|
-
super();
|
|
163
|
-
this.PartnerId = PartnerId;
|
|
164
|
-
this.AccountId = AccountId;
|
|
165
|
-
this.Source = Source;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export function ConfigEventMetadataDto_$reflection() {
|
|
170
|
-
return record_type("Basic.Profile.Domain.Config.PersistenceDto.ConfigEventMetadataDto", [], ConfigEventMetadataDto, () => [["PartnerId", string_type], ["AccountId", option_type(string_type)], ["Source", SourceDto_$reflection()]]);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export function ConfigEventMetadataDtoModule_ofDomain(configDomainMetadata) {
|
|
174
|
-
return new ConfigEventMetadataDto(PartnerIdModule_value(configDomainMetadata.PartnerId), map(AccountIdModule_value, configDomainMetadata.AccountId), SourceDtoModule_ofDomain(configDomainMetadata.Source));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function ConfigEventDtoModule_ofDomain(configEvent) {
|
|
178
|
-
const domainMetadataDto = ConfigEventMetadataDtoModule_ofDomain(configEvent.Metadata.Domain);
|
|
179
|
-
return EventDto_ofDomain(configEvent, ConfigEventPayloadDtoModule_ofDomain(configEvent.Payload), domainMetadataDto);
|
|
180
|
-
}
|
|
181
|
-
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { Union, Record } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { option_type, union_type, record_type, bool_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { AccountId_$reflection, PartnerId_$reflection, AccountIdModule_value, PartnerIdModule_value } from "../DomainPrimitives.jsx";
|
|
4
|
-
import { Source_$reflection, StreamId } from "../Metadata.jsx";
|
|
5
|
-
import { map, defaultArg } from "../../fable_modules/fable-library-js.4.20.0/Option.js";
|
|
6
|
-
import { AggregateMetadata$1 } from "../CommonTypes.jsx";
|
|
7
|
-
|
|
8
|
-
export class ConfigContent extends Record {
|
|
9
|
-
constructor(AdminUserManagementEnabled) {
|
|
10
|
-
super();
|
|
11
|
-
this.AdminUserManagementEnabled = AdminUserManagementEnabled;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function ConfigContent_$reflection() {
|
|
16
|
-
return record_type("Basic.Profile.Domain.Config.Types.ConfigContent", [], ConfigContent, () => [["AdminUserManagementEnabled", bool_type]]);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const ConfigContentModule_Default = new ConfigContent(false);
|
|
20
|
-
|
|
21
|
-
export class Config extends Union {
|
|
22
|
-
constructor(tag, fields) {
|
|
23
|
-
super();
|
|
24
|
-
this.tag = tag;
|
|
25
|
-
this.fields = fields;
|
|
26
|
-
}
|
|
27
|
-
cases() {
|
|
28
|
-
return ["Specific", "Inherited"];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function Config_$reflection() {
|
|
33
|
-
return union_type("Basic.Profile.Domain.Config.Types.Config", [], Config, () => [[["Item", ConfigContent_$reflection()]], []]);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function ConfigModule_createStreamId(partnerId, accountId) {
|
|
37
|
-
if (accountId == null) {
|
|
38
|
-
return new StreamId(`${PartnerIdModule_value(partnerId)}`);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
const a = accountId;
|
|
42
|
-
return new StreamId(`${PartnerIdModule_value(partnerId)}-${AccountIdModule_value(a)}`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export class ConfigMetadata extends Record {
|
|
47
|
-
constructor(PartnerId, AccountId) {
|
|
48
|
-
super();
|
|
49
|
-
this.PartnerId = PartnerId;
|
|
50
|
-
this.AccountId = AccountId;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function ConfigMetadata_$reflection() {
|
|
55
|
-
return record_type("Basic.Profile.Domain.Config.Types.ConfigMetadata", [], ConfigMetadata, () => [["PartnerId", PartnerId_$reflection()], ["AccountId", option_type(AccountId_$reflection())]]);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export class AccountConfigWithOwnership extends Union {
|
|
59
|
-
constructor(tag, fields) {
|
|
60
|
-
super();
|
|
61
|
-
this.tag = tag;
|
|
62
|
-
this.fields = fields;
|
|
63
|
-
}
|
|
64
|
-
cases() {
|
|
65
|
-
return ["Default", "Inherited", "Specific"];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function AccountConfigWithOwnership_$reflection() {
|
|
70
|
-
return union_type("Basic.Profile.Domain.Config.Types.AccountConfigWithOwnership", [], AccountConfigWithOwnership, () => [[["Item", ConfigContent_$reflection()]], [["Item", ConfigContent_$reflection()]], [["Item", ConfigContent_$reflection()]]]);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function AccountConfigWithOwnership__GetConfigContent(this$) {
|
|
74
|
-
let content;
|
|
75
|
-
switch (this$.tag) {
|
|
76
|
-
case 1: {
|
|
77
|
-
content = this$.fields[0];
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
case 2: {
|
|
81
|
-
content = this$.fields[0];
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
default:
|
|
85
|
-
content = this$.fields[0];
|
|
86
|
-
}
|
|
87
|
-
return content;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export class PartnerConfigWithOwnership extends Union {
|
|
91
|
-
constructor(tag, fields) {
|
|
92
|
-
super();
|
|
93
|
-
this.tag = tag;
|
|
94
|
-
this.fields = fields;
|
|
95
|
-
}
|
|
96
|
-
cases() {
|
|
97
|
-
return ["Default", "Specific"];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export function PartnerConfigWithOwnership_$reflection() {
|
|
102
|
-
return union_type("Basic.Profile.Domain.Config.Types.PartnerConfigWithOwnership", [], PartnerConfigWithOwnership, () => [[["Item", ConfigContent_$reflection()]], [["Item", ConfigContent_$reflection()]]]);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export class CreateOrUpdateEventDetails extends Record {
|
|
106
|
-
constructor(AdminUserManagementEnabled) {
|
|
107
|
-
super();
|
|
108
|
-
this.AdminUserManagementEnabled = AdminUserManagementEnabled;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function CreateOrUpdateEventDetails_$reflection() {
|
|
113
|
-
return record_type("Basic.Profile.Domain.Config.Types.CreateOrUpdateEventDetails", [], CreateOrUpdateEventDetails, () => [["AdminUserManagementEnabled", bool_type]]);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export class ConfigEventPayload extends Union {
|
|
117
|
-
constructor(tag, fields) {
|
|
118
|
-
super();
|
|
119
|
-
this.tag = tag;
|
|
120
|
-
this.fields = fields;
|
|
121
|
-
}
|
|
122
|
-
cases() {
|
|
123
|
-
return ["Created", "Updated", "Deleted"];
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function ConfigEventPayload_$reflection() {
|
|
128
|
-
return union_type("Basic.Profile.Domain.Config.Types.ConfigEventPayload", [], ConfigEventPayload, () => [[["Item", CreateOrUpdateEventDetails_$reflection()]], [["Item", CreateOrUpdateEventDetails_$reflection()]], []]);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export class ConfigEventMetadata extends Record {
|
|
132
|
-
constructor(PartnerId, AccountId, Source) {
|
|
133
|
-
super();
|
|
134
|
-
this.PartnerId = PartnerId;
|
|
135
|
-
this.AccountId = AccountId;
|
|
136
|
-
this.Source = Source;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export function ConfigEventMetadata_$reflection() {
|
|
141
|
-
return record_type("Basic.Profile.Domain.Config.Types.ConfigEventMetadata", [], ConfigEventMetadata, () => [["PartnerId", PartnerId_$reflection()], ["AccountId", option_type(AccountId_$reflection())], ["Source", Source_$reflection()]]);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export function ConfigEventMetadataModule_toAggregateMetadata(eventMetadata) {
|
|
145
|
-
return new ConfigMetadata(eventMetadata.PartnerId, eventMetadata.AccountId);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export function ConfigEventModule_createAggregateMetadata(config, event) {
|
|
149
|
-
const domainMetadata = defaultArg(map((c) => c.Metadata.Domain, config), ConfigEventMetadataModule_toAggregateMetadata(event.Metadata.Domain));
|
|
150
|
-
return new AggregateMetadata$1(event.Metadata.StreamId, event.Metadata.Version, defaultArg(map((c_1) => c_1.Metadata.CreatedAt, config), event.Metadata.Timestamp), event.Metadata.Timestamp, domainMetadata);
|
|
151
|
-
}
|
|
152
|
-
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { utcNow } from "../fable_modules/fable-library-js.4.20.0/Date.js";
|
|
2
|
-
import { UtcDateTimeModule_now } from "./DomainPrimitives.jsx";
|
|
3
|
-
import { class_type } from "../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
4
|
-
|
|
5
|
-
export class DateTimeProvider {
|
|
6
|
-
constructor() {
|
|
7
|
-
}
|
|
8
|
-
get UtcNow() {
|
|
9
|
-
return utcNow();
|
|
10
|
-
}
|
|
11
|
-
get UtcDateTimeTypeNow() {
|
|
12
|
-
return UtcDateTimeModule_now();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function DateTimeProvider_$reflection() {
|
|
17
|
-
return class_type("Basic.Profile.Domain.DateTimeProvider", undefined, DateTimeProvider);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function DateTimeProvider_$ctor() {
|
|
21
|
-
return new DateTimeProvider();
|
|
22
|
-
}
|
|
23
|
-
|