@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,405 +0,0 @@
1
- import { Record, Union } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
2
- import { list_type, option_type, record_type, anonRecord_type, string_type, union_type, int32_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
3
- import { max } from "../../fable_modules/fable-library-js.4.20.0/Double.js";
4
- import { tryFind, cons, map, empty, fold } from "../../fable_modules/fable-library-js.4.20.0/List.js";
5
- import { tryLast } from "../../fable_modules/fable-library-js.4.20.0/Seq.js";
6
- import { split } from "../../fable_modules/fable-library-js.4.20.0/String.js";
7
- import { FSharpChoice$3 } from "../../fable_modules/fable-library-js.4.20.0/Choice.js";
8
- import { UtcDateTime_$reflection, AccountId_$reflection, PartnerId_$reflection } from "../DomainPrimitives.jsx";
9
- import { equals } from "../../fable_modules/fable-library-js.4.20.0/Util.js";
10
- import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.20.0/Result.js";
11
-
12
- export class ImportId extends Union {
13
- constructor(Item) {
14
- super();
15
- this.tag = 0;
16
- this.fields = [Item];
17
- }
18
- cases() {
19
- return ["ImportId"];
20
- }
21
- }
22
-
23
- export function ImportId_$reflection() {
24
- return union_type("Basic.Profile.Domain.Import.Types.ImportId", [], ImportId, () => [[["Item", int32_type]]]);
25
- }
26
-
27
- export function ImportIdModule_init() {
28
- return new ImportId(1);
29
- }
30
-
31
- export function ImportIdModule_create(id) {
32
- return new ImportId(id);
33
- }
34
-
35
- export function ImportIdModule_value(_arg) {
36
- return _arg.fields[0];
37
- }
38
-
39
- export function ImportIdModule_increment(_arg) {
40
- return new ImportId(_arg.fields[0] + 1);
41
- }
42
-
43
- export function ImportIdModule_max(_arg, _arg_1) {
44
- return new ImportId(max(_arg.fields[0], _arg_1.fields[0]));
45
- }
46
-
47
- export const ImportIdModule_nextOrDefault = (arg) => ImportIdModule_increment(((list) => fold(ImportIdModule_max, new ImportId(0), list))(arg));
48
-
49
- export const $007CImportId$007C = ImportIdModule_value;
50
-
51
- export class Actor extends Union {
52
- constructor(tag, fields) {
53
- super();
54
- this.tag = tag;
55
- this.fields = fields;
56
- }
57
- cases() {
58
- return ["FlareUser", "ApolloImport"];
59
- }
60
- }
61
-
62
- export function Actor_$reflection() {
63
- return union_type("Basic.Profile.Domain.Import.Types.Actor", [], Actor, () => [[["Item", anonRecord_type(["Email", string_type], ["Id", string_type], ["Name", string_type])]], []]);
64
- }
65
-
66
- export class Origin extends Union {
67
- constructor(tag, fields) {
68
- super();
69
- this.tag = tag;
70
- this.fields = fields;
71
- }
72
- cases() {
73
- return ["SuperHero", "InternalApi"];
74
- }
75
- }
76
-
77
- export function Origin_$reflection() {
78
- return union_type("Basic.Profile.Domain.Import.Types.Origin", [], Origin, () => [[], []]);
79
- }
80
-
81
- export class FileInfo extends Record {
82
- constructor(Id, Filename) {
83
- super();
84
- this.Id = Id;
85
- this.Filename = Filename;
86
- }
87
- }
88
-
89
- export function FileInfo_$reflection() {
90
- return record_type("Basic.Profile.Domain.Import.Types.FileInfo", [], FileInfo, () => [["Id", string_type], ["Filename", string_type]]);
91
- }
92
-
93
- export function FileInfoModule_$007CCSV$007CJSON$007CUnknown$007C(fileInfo) {
94
- const extensionOption = tryLast(split(fileInfo.Filename, ["."], undefined, 0));
95
- if (extensionOption != null) {
96
- const extension = extensionOption;
97
- const matchValue = extension.toUpperCase();
98
- switch (matchValue) {
99
- case "CSV":
100
- return new FSharpChoice$3(0, [undefined]);
101
- case "JSON":
102
- return new FSharpChoice$3(1, [undefined]);
103
- default:
104
- return new FSharpChoice$3(2, [undefined]);
105
- }
106
- }
107
- else {
108
- return new FSharpChoice$3(2, [undefined]);
109
- }
110
- }
111
-
112
- export class ImportStartedEventPayload extends Record {
113
- constructor(Origin, Actor, FileInfo, TotalRowCount) {
114
- super();
115
- this.Origin = Origin;
116
- this.Actor = Actor;
117
- this.FileInfo = FileInfo;
118
- this.TotalRowCount = (TotalRowCount | 0);
119
- }
120
- }
121
-
122
- export function ImportStartedEventPayload_$reflection() {
123
- return record_type("Basic.Profile.Domain.Import.Types.ImportStartedEventPayload", [], ImportStartedEventPayload, () => [["Origin", Origin_$reflection()], ["Actor", Actor_$reflection()], ["FileInfo", FileInfo_$reflection()], ["TotalRowCount", int32_type]]);
124
- }
125
-
126
- export class RowImportSucceededEventPayload extends Record {
127
- constructor(RowId, ProfileId) {
128
- super();
129
- this.RowId = (RowId | 0);
130
- this.ProfileId = ProfileId;
131
- }
132
- }
133
-
134
- export function RowImportSucceededEventPayload_$reflection() {
135
- return record_type("Basic.Profile.Domain.Import.Types.RowImportSucceededEventPayload", [], RowImportSucceededEventPayload, () => [["RowId", int32_type], ["ProfileId", string_type]]);
136
- }
137
-
138
- export class RowImportFailedEventPayload extends Record {
139
- constructor(RowId, Reason) {
140
- super();
141
- this.RowId = (RowId | 0);
142
- this.Reason = Reason;
143
- }
144
- }
145
-
146
- export function RowImportFailedEventPayload_$reflection() {
147
- return record_type("Basic.Profile.Domain.Import.Types.RowImportFailedEventPayload", [], RowImportFailedEventPayload, () => [["RowId", int32_type], ["Reason", string_type]]);
148
- }
149
-
150
- export class ImportFailedEventPayload extends Record {
151
- constructor(Reason) {
152
- super();
153
- this.Reason = Reason;
154
- }
155
- }
156
-
157
- export function ImportFailedEventPayload_$reflection() {
158
- return record_type("Basic.Profile.Domain.Import.Types.ImportFailedEventPayload", [], ImportFailedEventPayload, () => [["Reason", string_type]]);
159
- }
160
-
161
- export class ImportEventPayload extends Union {
162
- constructor(tag, fields) {
163
- super();
164
- this.tag = tag;
165
- this.fields = fields;
166
- }
167
- cases() {
168
- return ["ImportStarted", "RowImportSucceeded", "RowImportFailed", "ImportComplete"];
169
- }
170
- }
171
-
172
- export function ImportEventPayload_$reflection() {
173
- return union_type("Basic.Profile.Domain.Import.Types.ImportEventPayload", [], ImportEventPayload, () => [[["Item", ImportStartedEventPayload_$reflection()]], [["Item", RowImportSucceededEventPayload_$reflection()]], [["Item", RowImportFailedEventPayload_$reflection()]], []]);
174
- }
175
-
176
- export class ImportEventDomainMetadata extends Record {
177
- constructor(PartnerId, AccountId, ImportId) {
178
- super();
179
- this.PartnerId = PartnerId;
180
- this.AccountId = AccountId;
181
- this.ImportId = ImportId;
182
- }
183
- }
184
-
185
- export function ImportEventDomainMetadata_$reflection() {
186
- return record_type("Basic.Profile.Domain.Import.Types.ImportEventDomainMetadata", [], ImportEventDomainMetadata, () => [["PartnerId", PartnerId_$reflection()], ["AccountId", AccountId_$reflection()], ["ImportId", ImportId_$reflection()]]);
187
- }
188
-
189
- export class ActiveImport extends Record {
190
- constructor(ImportId, Origin, Actor, FileInfo, NumberOfRecords, CompletedSuccessfully, CompletedFailed, NextRow, StartTime) {
191
- super();
192
- this.ImportId = ImportId;
193
- this.Origin = Origin;
194
- this.Actor = Actor;
195
- this.FileInfo = FileInfo;
196
- this.NumberOfRecords = (NumberOfRecords | 0);
197
- this.CompletedSuccessfully = (CompletedSuccessfully | 0);
198
- this.CompletedFailed = (CompletedFailed | 0);
199
- this.NextRow = NextRow;
200
- this.StartTime = StartTime;
201
- }
202
- }
203
-
204
- export function ActiveImport_$reflection() {
205
- return record_type("Basic.Profile.Domain.Import.Types.ActiveImport", [], ActiveImport, () => [["ImportId", ImportId_$reflection()], ["Origin", Origin_$reflection()], ["Actor", Actor_$reflection()], ["FileInfo", FileInfo_$reflection()], ["NumberOfRecords", int32_type], ["CompletedSuccessfully", int32_type], ["CompletedFailed", int32_type], ["NextRow", option_type(int32_type)], ["StartTime", UtcDateTime_$reflection()]]);
206
- }
207
-
208
- export function ActiveImportModule_create(cmd, importId, timestamp) {
209
- let activePatternResult;
210
- return new ActiveImport(importId, cmd.Origin, cmd.Actor, cmd.FileInfo, cmd.TotalRowCount, 0, 0, (activePatternResult = FileInfoModule_$007CCSV$007CJSON$007CUnknown$007C(cmd.FileInfo), (activePatternResult.tag === 1) ? 0 : ((activePatternResult.tag === 2) ? 0 : 2)), timestamp);
211
- }
212
-
213
- export function ActiveImportModule_importsRemaining(i) {
214
- return i.NumberOfRecords - (i.CompletedSuccessfully + i.CompletedFailed);
215
- }
216
-
217
- export class ImportHistory extends Record {
218
- constructor(ImportId, Origin, Actor, FileInfo, NumberOfRecords, Succeeded, Failed, StartTime, StopTime) {
219
- super();
220
- this.ImportId = ImportId;
221
- this.Origin = Origin;
222
- this.Actor = Actor;
223
- this.FileInfo = FileInfo;
224
- this.NumberOfRecords = (NumberOfRecords | 0);
225
- this.Succeeded = (Succeeded | 0);
226
- this.Failed = (Failed | 0);
227
- this.StartTime = StartTime;
228
- this.StopTime = StopTime;
229
- }
230
- }
231
-
232
- export function ImportHistory_$reflection() {
233
- return record_type("Basic.Profile.Domain.Import.Types.ImportHistory", [], ImportHistory, () => [["ImportId", ImportId_$reflection()], ["Origin", Origin_$reflection()], ["Actor", Actor_$reflection()], ["FileInfo", FileInfo_$reflection()], ["NumberOfRecords", int32_type], ["Succeeded", int32_type], ["Failed", int32_type], ["StartTime", UtcDateTime_$reflection()], ["StopTime", UtcDateTime_$reflection()]]);
234
- }
235
-
236
- export class ImportStatus extends Union {
237
- constructor(tag, fields) {
238
- super();
239
- this.tag = tag;
240
- this.fields = fields;
241
- }
242
- cases() {
243
- return ["Active", "Complete"];
244
- }
245
- }
246
-
247
- export function ImportStatus_$reflection() {
248
- return union_type("Basic.Profile.Domain.Import.Types.ImportStatus", [], ImportStatus, () => [[["Item", ActiveImport_$reflection()]], [["Item", ImportHistory_$reflection()]]]);
249
- }
250
-
251
- export class AccountImportsData extends Record {
252
- constructor(ActiveImport, ImportHistory) {
253
- super();
254
- this.ActiveImport = ActiveImport;
255
- this.ImportHistory = ImportHistory;
256
- }
257
- }
258
-
259
- export function AccountImportsData_$reflection() {
260
- return record_type("Basic.Profile.Domain.Import.Types.AccountImportsData", [], AccountImportsData, () => [["ActiveImport", option_type(ActiveImport_$reflection())], ["ImportHistory", list_type(ImportHistory_$reflection())]]);
261
- }
262
-
263
- export function AccountImportData_init() {
264
- return new AccountImportsData(undefined, empty());
265
- }
266
-
267
- export function AccountImportData_hasActiveImport(account) {
268
- return account.ActiveImport != null;
269
- }
270
-
271
- export function AccountImportData_getNextImportId(account) {
272
- const matchValue = account.ActiveImport;
273
- if (matchValue == null) {
274
- return ImportIdModule_nextOrDefault(map((i_1) => i_1.ImportId, account.ImportHistory));
275
- }
276
- else {
277
- return ImportIdModule_increment(matchValue.ImportId);
278
- }
279
- }
280
-
281
- export function AccountImportData_getActiveImportId(account) {
282
- const input_1 = account.ActiveImport;
283
- if (input_1 == null) {
284
- return undefined;
285
- }
286
- else {
287
- return input_1.ImportId;
288
- }
289
- }
290
-
291
- export function AccountImportData_getActiveImportById(account, importId) {
292
- const matchValue = account.ActiveImport;
293
- let matchResult, i_1;
294
- if (matchValue == null) {
295
- matchResult = 1;
296
- }
297
- else if (equals(matchValue.ImportId, importId)) {
298
- matchResult = 0;
299
- i_1 = matchValue;
300
- }
301
- else {
302
- matchResult = 1;
303
- }
304
- switch (matchResult) {
305
- case 0:
306
- return i_1;
307
- default:
308
- return undefined;
309
- }
310
- }
311
-
312
- export function AccountImportData_completeActiveImport(timestamp, account, invalidActiveImportIdError, importId) {
313
- const matchValue = account.ActiveImport;
314
- let matchResult, i_1;
315
- if (matchValue == null) {
316
- matchResult = 1;
317
- }
318
- else if (equals(matchValue.ImportId, importId)) {
319
- matchResult = 0;
320
- i_1 = matchValue;
321
- }
322
- else {
323
- matchResult = 1;
324
- }
325
- switch (matchResult) {
326
- case 0:
327
- return new FSharpResult$2(0, [new AccountImportsData(undefined, cons(new ImportHistory(i_1.ImportId, i_1.Origin, i_1.Actor, i_1.FileInfo, i_1.NumberOfRecords, i_1.CompletedSuccessfully, i_1.CompletedFailed, i_1.StartTime, timestamp), account.ImportHistory))]);
328
- default:
329
- return new FSharpResult$2(1, [invalidActiveImportIdError]);
330
- }
331
- }
332
-
333
- export function AccountImportData_tryAddActiveImport(account, activeImportExistsError, import$) {
334
- if (account.ActiveImport == null) {
335
- return new FSharpResult$2(0, [new AccountImportsData(import$, account.ImportHistory)]);
336
- }
337
- else {
338
- return new FSharpResult$2(1, [activeImportExistsError]);
339
- }
340
- }
341
-
342
- export function AccountImportData_tryUpdateActiveImport(account, invalidActiveImportIdError, updatedImport) {
343
- const matchValue = account.ActiveImport;
344
- let matchResult, current_1, updated_1;
345
- if (matchValue == null) {
346
- matchResult = 1;
347
- }
348
- else if (equals(matchValue.ImportId, updatedImport.ImportId)) {
349
- matchResult = 0;
350
- current_1 = matchValue;
351
- updated_1 = updatedImport;
352
- }
353
- else {
354
- matchResult = 1;
355
- }
356
- switch (matchResult) {
357
- case 0:
358
- return new FSharpResult$2(0, [new AccountImportsData(updatedImport, account.ImportHistory)]);
359
- default:
360
- return new FSharpResult$2(1, [invalidActiveImportIdError]);
361
- }
362
- }
363
-
364
- export function AccountImportData_tryGetImport(accountImportsData, importId) {
365
- const matchValue = accountImportsData.ActiveImport;
366
- let matchResult, activeImport_1;
367
- if (matchValue != null) {
368
- if (equals(matchValue.ImportId, importId)) {
369
- matchResult = 0;
370
- activeImport_1 = matchValue;
371
- }
372
- else {
373
- matchResult = 1;
374
- }
375
- }
376
- else {
377
- matchResult = 1;
378
- }
379
- switch (matchResult) {
380
- case 0:
381
- return new ImportStatus(0, [activeImport_1]);
382
- default: {
383
- const matchValue_1 = tryFind((i) => equals(i.ImportId, importId), accountImportsData.ImportHistory);
384
- if (matchValue_1 == null) {
385
- return undefined;
386
- }
387
- else {
388
- return new ImportStatus(1, [matchValue_1]);
389
- }
390
- }
391
- }
392
- }
393
-
394
- export class AccountImportsDomainMetadata extends Record {
395
- constructor(AccountId, PartnerId) {
396
- super();
397
- this.AccountId = AccountId;
398
- this.PartnerId = PartnerId;
399
- }
400
- }
401
-
402
- export function AccountImportsDomainMetadata_$reflection() {
403
- return record_type("Basic.Profile.Domain.Import.Types.AccountImportsDomainMetadata", [], AccountImportsDomainMetadata, () => [["AccountId", AccountId_$reflection()], ["PartnerId", PartnerId_$reflection()]]);
404
- }
405
-
@@ -1,44 +0,0 @@
1
- import { Union } from "../fable_modules/fable-library-js.4.20.0/Types.js";
2
- import { union_type, class_type, obj_type, string_type } from "../fable_modules/fable-library-js.4.20.0/Reflection.js";
3
- import { FSharpResult$2 } from "../fable_modules/fable-library-js.4.20.0/Result.js";
4
- import { item } from "../fable_modules/fable-library-js.4.20.0/Array.js";
5
- import { split } from "../fable_modules/fable-library-js.4.20.0/String.js";
6
- import { get_UTF8 } from "../fable_modules/fable-library-js.4.20.0/Encoding.js";
7
-
8
- export class JwtPayload extends Union {
9
- constructor(Item) {
10
- super();
11
- this.tag = 0;
12
- this.fields = [Item];
13
- }
14
- cases() {
15
- return ["JwtPayload"];
16
- }
17
- }
18
-
19
- export function JwtPayload_$reflection() {
20
- return union_type("Basic.Profile.Domain.JwtPayload", [], JwtPayload, () => [[["Item", class_type("Microsoft.FSharp.Collections.FSharpMap`2", [string_type, obj_type])]]]);
21
- }
22
-
23
- function JwtPayloadModule_fromJson(str) {
24
- return FSharp_Json_Json_deserializeEx(FSharp_Json_JsonConfig_create_Z5CD7C433(undefined, undefined, undefined, FSharp_Json_Json_lowerCamelCase, true), str);
25
- }
26
-
27
- export function JwtPayloadModule_fromToken(token) {
28
- let bytes, objectArg;
29
- try {
30
- return new FSharpResult$2(0, [new JwtPayload(JwtPayloadModule_fromJson((bytes = Microsoft_AspNetCore_WebUtilities_WebEncoders_Base64UrlDecode_Z721C83C5(item(1, split(token, ["."], undefined, 0))), (objectArg = get_UTF8(), objectArg.getString(bytes)))))]);
31
- }
32
- catch (matchValue) {
33
- return new FSharpResult$2(1, ["Invalid token"]);
34
- }
35
- }
36
-
37
- export function JwtPayloadModule_value(_arg) {
38
- return _arg.fields[0];
39
- }
40
-
41
- export function JwtPayloadModule_create(claims) {
42
- return new JwtPayload(claims);
43
- }
44
-
@@ -1,257 +0,0 @@
1
- import { Record, Union } from "../fable_modules/fable-library-js.4.20.0/Types.js";
2
- import { option_type, anonRecord_type, record_type, class_type, int32_type, union_type, string_type } from "../fable_modules/fable-library-js.4.20.0/Reflection.js";
3
- import { newGuid } from "../fable_modules/fable-library-js.4.20.0/Guid.js";
4
- import { printf, toText } from "../fable_modules/fable-library-js.4.20.0/String.js";
5
- import { PartnerId_$reflection, AccountId_$reflection, Email_$reflection, ProfileId_$reflection } from "./DomainPrimitives.jsx";
6
-
7
- export function incrementVersion(delta, version) {
8
- return (version + delta) + 1;
9
- }
10
-
11
- export class AppVersion extends Union {
12
- constructor(Item) {
13
- super();
14
- this.tag = 0;
15
- this.fields = [Item];
16
- }
17
- cases() {
18
- return ["AppVersion"];
19
- }
20
- }
21
-
22
- export function AppVersion_$reflection() {
23
- return union_type("MetadataTypes.AppVersion", [], AppVersion, () => [[["Item", string_type]]]);
24
- }
25
-
26
- export function AppVersionModule_value(_arg) {
27
- return _arg.fields[0];
28
- }
29
-
30
- export class StreamId extends Union {
31
- constructor(Item) {
32
- super();
33
- this.tag = 0;
34
- this.fields = [Item];
35
- }
36
- cases() {
37
- return ["StreamId"];
38
- }
39
- }
40
-
41
- export function StreamId_$reflection() {
42
- return union_type("MetadataTypes.StreamId", [], StreamId, () => [[["Item", string_type]]]);
43
- }
44
-
45
- export function StreamIdModule_create() {
46
- let arg, copyOfStruct;
47
- return new StreamId((arg = ((copyOfStruct = newGuid(), copyOfStruct)).toLocaleUpperCase(), toText(printf("AP-%s"))(arg)));
48
- }
49
-
50
- export function StreamIdModule_value(_arg) {
51
- return _arg.fields[0];
52
- }
53
-
54
- export class Metadata extends Record {
55
- constructor(StreamId, Version, Timestamp) {
56
- super();
57
- this.StreamId = StreamId;
58
- this.Version = (Version | 0);
59
- this.Timestamp = Timestamp;
60
- }
61
- }
62
-
63
- export function Metadata_$reflection() {
64
- return record_type("MetadataTypes.Metadata", [], Metadata, () => [["StreamId", StreamId_$reflection()], ["Version", int32_type], ["Timestamp", class_type("System.DateTime")]]);
65
- }
66
-
67
- export class AdminName extends Union {
68
- constructor(Item) {
69
- super();
70
- this.tag = 0;
71
- this.fields = [Item];
72
- }
73
- cases() {
74
- return ["AdminName"];
75
- }
76
- }
77
-
78
- export function AdminName_$reflection() {
79
- return union_type("MetadataTypes.AdminName", [], AdminName, () => [[["Item", string_type]]]);
80
- }
81
-
82
- export function AdminNameModule_value(_arg) {
83
- return _arg.fields[0];
84
- }
85
-
86
- export class InternalOperationType extends Union {
87
- constructor() {
88
- super();
89
- this.tag = 0;
90
- this.fields = [];
91
- }
92
- cases() {
93
- return ["MessageQueue"];
94
- }
95
- }
96
-
97
- export function InternalOperationType_$reflection() {
98
- return union_type("MetadataTypes.InternalOperationType", [], InternalOperationType, () => [[]]);
99
- }
100
-
101
- export class AdminOperationType extends Union {
102
- constructor(tag, fields) {
103
- super();
104
- this.tag = tag;
105
- this.fields = fields;
106
- }
107
- cases() {
108
- return ["Direct", "Bulk"];
109
- }
110
- }
111
-
112
- export function AdminOperationType_$reflection() {
113
- return union_type("MetadataTypes.AdminOperationType", [], AdminOperationType, () => [[], []]);
114
- }
115
-
116
- export class SelfOperationType extends Union {
117
- constructor() {
118
- super();
119
- this.tag = 0;
120
- this.fields = [];
121
- }
122
- cases() {
123
- return ["Workflow"];
124
- }
125
- }
126
-
127
- export function SelfOperationType_$reflection() {
128
- return union_type("MetadataTypes.SelfOperationType", [], SelfOperationType, () => [[]]);
129
- }
130
-
131
- export class Source extends Union {
132
- constructor(tag, fields) {
133
- super();
134
- this.tag = tag;
135
- this.fields = fields;
136
- }
137
- cases() {
138
- return ["ExternalApi", "InternalApi", "Self", "FlareAdmin", "SuperheroAdmin", "InternalOperation"];
139
- }
140
- }
141
-
142
- export function Source_$reflection() {
143
- return union_type("MetadataTypes.Source", [], Source, () => [[], [], [["Item", SelfOperationType_$reflection()]], [["Item", anonRecord_type(["Operation", AdminOperationType_$reflection()], ["ProfileId", ProfileId_$reflection()])]], [["Item", anonRecord_type(["AdminName", AdminName_$reflection()], ["Email", Email_$reflection()])]], [["Item", InternalOperationType_$reflection()]]]);
144
- }
145
-
146
- export class DomainMetadata extends Record {
147
- constructor(AccountId, PartnerId, Source) {
148
- super();
149
- this.AccountId = AccountId;
150
- this.PartnerId = PartnerId;
151
- this.Source = Source;
152
- }
153
- }
154
-
155
- export function DomainMetadata_$reflection() {
156
- return record_type("MetadataTypes.DomainMetadata", [], DomainMetadata, () => [["AccountId", AccountId_$reflection()], ["PartnerId", PartnerId_$reflection()], ["Source", Source_$reflection()]]);
157
- }
158
-
159
- export function DomainMetadataModule_forFlareAdmin(actorProfileId, accountId, partnerId, operationType) {
160
- return new DomainMetadata(accountId, partnerId, new Source(3, [{
161
- Operation: operationType,
162
- ProfileId: actorProfileId,
163
- }]));
164
- }
165
-
166
- export function DomainMetadataModule_forExternalApi(accountId, partnerId) {
167
- return new DomainMetadata(accountId, partnerId, new Source(0, []));
168
- }
169
-
170
- export function DomainMetadataModule_forSelf(accountId, partnerId) {
171
- return new DomainMetadata(accountId, partnerId, new Source(2, [new SelfOperationType()]));
172
- }
173
-
174
- export function DomainMetadataModule_forInternalMessageQueue(accountId, partnerId) {
175
- return new DomainMetadata(accountId, partnerId, new Source(5, [new InternalOperationType()]));
176
- }
177
-
178
- export class ProfileEventMetadata extends Record {
179
- constructor(StreamId, Version, Timestamp, Domain) {
180
- super();
181
- this.StreamId = StreamId;
182
- this.Version = (Version | 0);
183
- this.Timestamp = Timestamp;
184
- this.Domain = Domain;
185
- }
186
- }
187
-
188
- export function ProfileEventMetadata_$reflection() {
189
- return record_type("MetadataTypes.ProfileEventMetadata", [], ProfileEventMetadata, () => [["StreamId", StreamId_$reflection()], ["Version", int32_type], ["Timestamp", class_type("System.DateTime")], ["Domain", option_type(DomainMetadata_$reflection())]]);
190
- }
191
-
192
- export function ProfileEventMetadataModule_create(streamId, version, timestamp) {
193
- return new ProfileEventMetadata(streamId, version, timestamp, undefined);
194
- }
195
-
196
- export function ProfileEventMetadataModule_incrementVersion(delta, m) {
197
- return new ProfileEventMetadata(m.StreamId, incrementVersion(delta, m.Version), m.Timestamp, m.Domain);
198
- }
199
-
200
- export function ProfileEventMetadataModule_toAggregateMetaData(eventMetadata) {
201
- return new Metadata(eventMetadata.StreamId, eventMetadata.Version, eventMetadata.Timestamp);
202
- }
203
-
204
- export class ProfileCommandMetadata extends Record {
205
- constructor(StreamId, Version, Timestamp, Domain) {
206
- super();
207
- this.StreamId = StreamId;
208
- this.Version = (Version | 0);
209
- this.Timestamp = Timestamp;
210
- this.Domain = Domain;
211
- }
212
- }
213
-
214
- export function ProfileCommandMetadata_$reflection() {
215
- return record_type("MetadataTypes.ProfileCommandMetadata", [], ProfileCommandMetadata, () => [["StreamId", StreamId_$reflection()], ["Version", int32_type], ["Timestamp", class_type("System.DateTime")], ["Domain", option_type(DomainMetadata_$reflection())]]);
216
- }
217
-
218
- export function CommandMetadata_create(streamId, version, timestamp, domainData) {
219
- return new ProfileCommandMetadata(streamId, version, timestamp, domainData);
220
- }
221
-
222
- export function CommandMetadata_createNew(timestamp, domainData) {
223
- return CommandMetadata_create(StreamIdModule_create(), 0, timestamp, domainData);
224
- }
225
-
226
- export function CommandMetadata_incrementVersion(delta, m) {
227
- return new ProfileCommandMetadata(m.StreamId, incrementVersion(delta, m.Version), m.Timestamp, m.Domain);
228
- }
229
-
230
- export function CommandMetadata_withTimestamp(timestamp, metadata) {
231
- return new ProfileCommandMetadata(metadata.StreamId, metadata.Version, timestamp, metadata.Domain);
232
- }
233
-
234
- export function CommandMetadata_toEventMetadata(metadata) {
235
- return new ProfileEventMetadata(metadata.StreamId, metadata.Version, metadata.Timestamp, metadata.Domain);
236
- }
237
-
238
- export function MetadataModule_create(streamId, version, timestamp) {
239
- return new Metadata(streamId, version, timestamp);
240
- }
241
-
242
- export function MetadataModule_createNew(timestamp) {
243
- return MetadataModule_create(StreamIdModule_create(), 0, timestamp);
244
- }
245
-
246
- export function MetadataModule_incrementVersion(delta, m) {
247
- return new Metadata(m.StreamId, incrementVersion(delta, m.Version), m.Timestamp);
248
- }
249
-
250
- export function MetadataModule_withTimestamp(timestamp, metadata) {
251
- return new Metadata(metadata.StreamId, metadata.Version, timestamp);
252
- }
253
-
254
- export function MetadataModule_toCommandMetadata(metadata, domainMetadata) {
255
- return new ProfileCommandMetadata(metadata.StreamId, metadata.Version, metadata.Timestamp, domainMetadata);
256
- }
257
-