ballerina-core 1.0.228 → 1.0.230
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/package.json +1 -1
- package/src/forms/domains/dispatched-forms/deserializer/state.ts +292 -94
- package/src/forms/domains/dispatched-forms/runner/domains/abstract-renderers/table/state.ts +37 -32
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/list/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/lookup/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/map/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/multiSelection/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/nestedDispatcher/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/one/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/primitive/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/readOnly/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/record/recordField/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/record/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/singleSelectionDispatcher/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/sum/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/table/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/tupleDispatcher/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/unionDispatcher/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/state.ts +1 -1
- package/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/_init.ts +279 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/_sync.ts +103 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/builder.ts +24 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/create/coroutines/runner.ts +44 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/create/state.ts +100 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/create/template.tsx +116 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/_init.ts +272 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/_sync.ts +101 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/builder.ts +24 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/edit/coroutines/runner.ts +43 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/edit/state.ts +96 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/edit/template.tsx +115 -0
- package/src/forms/domains/dispatched-forms/runner/{coroutines → domains/kind/passthrough/coroutines}/runner.ts +49 -45
- package/src/forms/domains/dispatched-forms/runner/domains/kind/passthrough/state.ts +45 -0
- package/src/forms/domains/dispatched-forms/runner/domains/kind/passthrough/template.tsx +118 -0
- package/src/forms/domains/dispatched-forms/runner/state.ts +141 -11
- package/src/forms/domains/dispatched-forms/runner/template.tsx +102 -59
- package/src/value-infinite-data-stream/coroutines/infiniteLoader.ts +1 -1
package/package.json
CHANGED
|
@@ -60,10 +60,51 @@ export type DispatchParsedPassthroughLauncher<T> = {
|
|
|
60
60
|
type: DispatchParsedType<T>;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
export type
|
|
63
|
+
export type DispatchParsedEditLauncher<T> = {
|
|
64
|
+
kind: "edit";
|
|
65
|
+
formName: string;
|
|
66
|
+
renderer: Renderer<T>;
|
|
67
|
+
fromApiParser: (_: any) => ValueOrErrors<PredicateValue, string>;
|
|
68
|
+
toApiParser: (
|
|
69
|
+
value: PredicateValue,
|
|
70
|
+
type: DispatchParsedType<T>,
|
|
71
|
+
formState: any,
|
|
72
|
+
) => ValueOrErrors<any, string>;
|
|
73
|
+
parseGlobalConfigurationFromApi: (
|
|
74
|
+
_: any,
|
|
75
|
+
) => ValueOrErrors<PredicateValue, string>;
|
|
76
|
+
api: string;
|
|
77
|
+
configApi: string;
|
|
78
|
+
type: DispatchParsedType<T>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type DispatchParsedCreateLauncher<T> = {
|
|
82
|
+
kind: "create";
|
|
83
|
+
formName: string;
|
|
84
|
+
renderer: Renderer<T>;
|
|
85
|
+
fromApiParser: (_: any) => ValueOrErrors<PredicateValue, string>;
|
|
86
|
+
toApiParser: (
|
|
87
|
+
value: PredicateValue,
|
|
88
|
+
type: DispatchParsedType<T>,
|
|
89
|
+
formState: any,
|
|
90
|
+
) => ValueOrErrors<any, string>;
|
|
91
|
+
parseGlobalConfigurationFromApi: (
|
|
92
|
+
_: any,
|
|
93
|
+
) => ValueOrErrors<PredicateValue, string>;
|
|
94
|
+
api: string;
|
|
95
|
+
configApi: string;
|
|
96
|
+
type: DispatchParsedType<T>;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export type DispatchParsedLauncher<T> =
|
|
100
|
+
| DispatchParsedPassthroughLauncher<T>
|
|
101
|
+
| DispatchParsedEditLauncher<T>
|
|
102
|
+
| DispatchParsedCreateLauncher<T>;
|
|
64
103
|
|
|
65
104
|
export type DispatchParsedLaunchers<T> = {
|
|
66
105
|
passthrough: Map<string, DispatchParsedPassthroughLauncher<T>>;
|
|
106
|
+
edit: Map<string, DispatchParsedEditLauncher<T>>;
|
|
107
|
+
create: Map<string, DispatchParsedCreateLauncher<T>>;
|
|
67
108
|
};
|
|
68
109
|
|
|
69
110
|
export type IdWrapperProps = {
|
|
@@ -362,103 +403,260 @@ export const parseDispatchFormsToLaunchers =
|
|
|
362
403
|
),
|
|
363
404
|
),
|
|
364
405
|
)
|
|
406
|
+
.MapErrors((errors) =>
|
|
407
|
+
errors.map(
|
|
408
|
+
(error) => `${error}\n...When parsing passthrough launchers`,
|
|
409
|
+
),
|
|
410
|
+
)
|
|
365
411
|
.Then((passthroughLaunchers) =>
|
|
366
|
-
ValueOrErrors.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
412
|
+
ValueOrErrors.Operations.All(
|
|
413
|
+
List<
|
|
414
|
+
ValueOrErrors<[string, DispatchParsedCreateLauncher<T>], string>
|
|
415
|
+
>(
|
|
416
|
+
specification.launchers.create
|
|
417
|
+
.entrySeq()
|
|
418
|
+
.toArray()
|
|
419
|
+
.map(([launcherName, launcher]) =>
|
|
420
|
+
MapRepo.Operations.tryFindWithError(
|
|
421
|
+
launcher.form,
|
|
422
|
+
specification.forms,
|
|
423
|
+
() =>
|
|
424
|
+
`cannot find form "${launcher.form}" when parsing launchers`,
|
|
425
|
+
).Then((parsedForm) =>
|
|
426
|
+
MapRepo.Operations.tryFindWithError(
|
|
427
|
+
launcher.configApi,
|
|
428
|
+
specification.apis.entities,
|
|
429
|
+
() =>
|
|
430
|
+
`cannot find global config api "${launcher.configApi}" when parsing launchers`,
|
|
431
|
+
).Then((globalConfigApi) =>
|
|
432
|
+
MapRepo.Operations.tryFindWithError(
|
|
433
|
+
globalConfigApi.type,
|
|
434
|
+
specification.types,
|
|
435
|
+
() =>
|
|
436
|
+
`cannot find global config type "${globalConfigApi.type}" when parsing launchers`,
|
|
437
|
+
).Then((globalConfigType) =>
|
|
438
|
+
ValueOrErrors.Default.return([
|
|
439
|
+
launcherName,
|
|
440
|
+
{
|
|
441
|
+
kind: "create",
|
|
442
|
+
renderer: parsedForm,
|
|
443
|
+
type: parsedForm.type,
|
|
444
|
+
fromApiParser: (raw: any) =>
|
|
445
|
+
dispatchFromAPIRawValue(
|
|
446
|
+
parsedForm.type,
|
|
447
|
+
specification.types,
|
|
448
|
+
apiConverters,
|
|
449
|
+
injectedPrimitives,
|
|
450
|
+
)(raw),
|
|
451
|
+
parseGlobalConfigurationFromApi: (raw: any) =>
|
|
452
|
+
dispatchFromAPIRawValue(
|
|
453
|
+
globalConfigType,
|
|
454
|
+
specification.types,
|
|
455
|
+
apiConverters,
|
|
456
|
+
injectedPrimitives,
|
|
457
|
+
)(raw),
|
|
458
|
+
toApiParser: (
|
|
459
|
+
value: PredicateValue,
|
|
460
|
+
type: DispatchParsedType<T>,
|
|
461
|
+
formState: any,
|
|
462
|
+
) =>
|
|
463
|
+
dispatchToAPIRawValue(
|
|
464
|
+
type,
|
|
465
|
+
specification.types,
|
|
466
|
+
apiConverters,
|
|
467
|
+
injectedPrimitives,
|
|
468
|
+
)(value, formState),
|
|
469
|
+
formName: launcher.form,
|
|
470
|
+
api: launcher.api,
|
|
471
|
+
configApi: launcher.configApi,
|
|
472
|
+
},
|
|
473
|
+
]),
|
|
474
|
+
),
|
|
475
|
+
),
|
|
476
|
+
),
|
|
384
477
|
),
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
478
|
+
),
|
|
479
|
+
)
|
|
480
|
+
.MapErrors((errors) =>
|
|
481
|
+
errors.map((error) => `${error}\n...When parsing create launchers`),
|
|
482
|
+
)
|
|
483
|
+
.Then((createLaunchers) =>
|
|
484
|
+
ValueOrErrors.Operations.All(
|
|
485
|
+
List<
|
|
486
|
+
ValueOrErrors<[string, DispatchParsedEditLauncher<T>], string>
|
|
487
|
+
>(
|
|
488
|
+
specification.launchers.edit
|
|
489
|
+
.entrySeq()
|
|
490
|
+
.toArray()
|
|
491
|
+
.map(([launcherName, launcher]) =>
|
|
492
|
+
MapRepo.Operations.tryFindWithError(
|
|
493
|
+
launcher.form,
|
|
494
|
+
specification.forms,
|
|
495
|
+
() =>
|
|
496
|
+
`cannot find form "${launcher.form}" when parsing launchers`,
|
|
497
|
+
).Then((parsedForm) =>
|
|
498
|
+
MapRepo.Operations.tryFindWithError(
|
|
499
|
+
launcher.configApi,
|
|
500
|
+
specification.apis.entities,
|
|
501
|
+
() =>
|
|
502
|
+
`cannot find global config api "${launcher.configApi}" when parsing launchers`,
|
|
503
|
+
).Then((globalConfigApi) =>
|
|
504
|
+
MapRepo.Operations.tryFindWithError(
|
|
505
|
+
globalConfigApi.type,
|
|
506
|
+
specification.types,
|
|
507
|
+
() =>
|
|
508
|
+
`cannot find global config type "${globalConfigApi.type}" when parsing launchers`,
|
|
509
|
+
).Then((globalConfigType) =>
|
|
510
|
+
ValueOrErrors.Default.return([
|
|
511
|
+
launcherName,
|
|
512
|
+
{
|
|
513
|
+
kind: "edit",
|
|
514
|
+
renderer: parsedForm,
|
|
515
|
+
type: parsedForm.type,
|
|
516
|
+
fromApiParser: (raw: any) =>
|
|
517
|
+
dispatchFromAPIRawValue(
|
|
518
|
+
parsedForm.type,
|
|
519
|
+
specification.types,
|
|
520
|
+
apiConverters,
|
|
521
|
+
injectedPrimitives,
|
|
522
|
+
)(raw),
|
|
523
|
+
parseGlobalConfigurationFromApi: (raw: any) =>
|
|
524
|
+
dispatchFromAPIRawValue(
|
|
525
|
+
globalConfigType,
|
|
526
|
+
specification.types,
|
|
527
|
+
apiConverters,
|
|
528
|
+
injectedPrimitives,
|
|
529
|
+
)(raw),
|
|
530
|
+
toApiParser: (
|
|
531
|
+
value: PredicateValue,
|
|
532
|
+
type: DispatchParsedType<T>,
|
|
533
|
+
formState: any,
|
|
534
|
+
) =>
|
|
535
|
+
dispatchToAPIRawValue(
|
|
536
|
+
type,
|
|
537
|
+
specification.types,
|
|
538
|
+
apiConverters,
|
|
539
|
+
injectedPrimitives,
|
|
540
|
+
)(value, formState),
|
|
541
|
+
formName: launcher.form,
|
|
542
|
+
api: launcher.api,
|
|
543
|
+
configApi: launcher.configApi,
|
|
544
|
+
},
|
|
545
|
+
]),
|
|
546
|
+
),
|
|
547
|
+
),
|
|
548
|
+
),
|
|
549
|
+
),
|
|
404
550
|
),
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
551
|
+
)
|
|
552
|
+
.MapErrors((errors) =>
|
|
553
|
+
errors.map(
|
|
554
|
+
(error) => `${error}\n...When parsing edit launchers`,
|
|
555
|
+
),
|
|
556
|
+
)
|
|
557
|
+
.Then((editLaunchers) =>
|
|
558
|
+
ValueOrErrors.Default.return({
|
|
559
|
+
launchers: {
|
|
560
|
+
passthrough: Map(passthroughLaunchers),
|
|
561
|
+
edit: Map(editLaunchers),
|
|
562
|
+
create: Map(createLaunchers),
|
|
563
|
+
},
|
|
564
|
+
dispatcherContext: {
|
|
565
|
+
specApis: specification.apis,
|
|
566
|
+
forms: specification.forms,
|
|
567
|
+
injectedPrimitives,
|
|
568
|
+
apiConverters,
|
|
569
|
+
concreteRenderers,
|
|
570
|
+
lookupTypeRenderer,
|
|
571
|
+
getConcreteRendererKind:
|
|
572
|
+
concreteRendererToKind(concreteRenderers),
|
|
573
|
+
getConcreteRenderer:
|
|
574
|
+
tryGetConcreteRenderer(concreteRenderers),
|
|
575
|
+
getDefaultRecordRenderer: (isNested: boolean) =>
|
|
576
|
+
getDefaultRecordRenderer(
|
|
577
|
+
isNested,
|
|
578
|
+
defaultRecordRenderer,
|
|
579
|
+
defaultNestedRecordRenderer,
|
|
580
|
+
),
|
|
581
|
+
defaultValue: dispatchDefaultValue(
|
|
582
|
+
injectedPrimitives,
|
|
583
|
+
specification.types,
|
|
584
|
+
specification.forms,
|
|
585
|
+
),
|
|
586
|
+
defaultState: (
|
|
587
|
+
infiniteStreamSources: DispatchInfiniteStreamSources,
|
|
588
|
+
lookupSources: DispatchLookupSources | undefined,
|
|
589
|
+
tableApiSources: DispatchTableApiSources | undefined,
|
|
590
|
+
) =>
|
|
591
|
+
dispatchDefaultState(
|
|
592
|
+
infiniteStreamSources,
|
|
593
|
+
injectedPrimitives,
|
|
594
|
+
specification.types,
|
|
595
|
+
specification.forms,
|
|
596
|
+
apiConverters,
|
|
597
|
+
lookupSources,
|
|
598
|
+
tableApiSources,
|
|
599
|
+
specification.apis,
|
|
600
|
+
),
|
|
601
|
+
types: specification.types,
|
|
602
|
+
parseFromApiByType: (type: DispatchParsedType<T>) =>
|
|
603
|
+
dispatchFromAPIRawValue(
|
|
604
|
+
type,
|
|
605
|
+
specification.types,
|
|
606
|
+
apiConverters,
|
|
607
|
+
injectedPrimitives,
|
|
608
|
+
),
|
|
609
|
+
IdProvider,
|
|
610
|
+
ErrorRenderer,
|
|
611
|
+
parseToApiByType: (
|
|
612
|
+
type: DispatchParsedType<T>,
|
|
613
|
+
value: PredicateValue,
|
|
614
|
+
state: any,
|
|
615
|
+
) =>
|
|
616
|
+
dispatchToAPIRawValue(
|
|
617
|
+
type,
|
|
618
|
+
specification.types,
|
|
619
|
+
apiConverters,
|
|
620
|
+
injectedPrimitives,
|
|
621
|
+
)(value, state),
|
|
622
|
+
},
|
|
623
|
+
parseEntityFromApiByTypeLookupName: (
|
|
624
|
+
typeLookupName: string,
|
|
625
|
+
raw: any,
|
|
626
|
+
) =>
|
|
627
|
+
MapRepo.Operations.tryFindWithError(
|
|
628
|
+
typeLookupName,
|
|
629
|
+
specification.types,
|
|
630
|
+
() =>
|
|
631
|
+
`cannot find type "${typeLookupName}" when parsing launchers`,
|
|
632
|
+
).Then((type) =>
|
|
633
|
+
dispatchFromAPIRawValue(
|
|
634
|
+
type,
|
|
635
|
+
specification.types,
|
|
636
|
+
apiConverters,
|
|
637
|
+
injectedPrimitives,
|
|
638
|
+
)(raw),
|
|
639
|
+
),
|
|
640
|
+
parseValueToApi: (
|
|
641
|
+
value: PredicateValue,
|
|
642
|
+
type: DispatchParsedType<T>,
|
|
643
|
+
state: any,
|
|
644
|
+
) =>
|
|
645
|
+
dispatchToAPIRawValue(
|
|
646
|
+
type,
|
|
647
|
+
specification.types,
|
|
648
|
+
apiConverters,
|
|
649
|
+
injectedPrimitives,
|
|
650
|
+
)(value, state),
|
|
651
|
+
getTypeByLookupName: (typeLookupName: string) =>
|
|
652
|
+
MapRepo.Operations.tryFindWithError(
|
|
653
|
+
typeLookupName,
|
|
654
|
+
specification.types,
|
|
655
|
+
() => `cannot find type "${typeLookupName}" in types`,
|
|
656
|
+
),
|
|
657
|
+
}),
|
|
412
658
|
),
|
|
413
|
-
|
|
414
|
-
ErrorRenderer,
|
|
415
|
-
parseToApiByType: (
|
|
416
|
-
type: DispatchParsedType<T>,
|
|
417
|
-
value: PredicateValue,
|
|
418
|
-
state: any,
|
|
419
|
-
) =>
|
|
420
|
-
dispatchToAPIRawValue(
|
|
421
|
-
type,
|
|
422
|
-
specification.types,
|
|
423
|
-
apiConverters,
|
|
424
|
-
injectedPrimitives,
|
|
425
|
-
)(value, state),
|
|
426
|
-
},
|
|
427
|
-
parseEntityFromApiByTypeLookupName: (
|
|
428
|
-
typeLookupName: string,
|
|
429
|
-
raw: any,
|
|
430
|
-
) =>
|
|
431
|
-
MapRepo.Operations.tryFindWithError(
|
|
432
|
-
typeLookupName,
|
|
433
|
-
specification.types,
|
|
434
|
-
() =>
|
|
435
|
-
`cannot find type "${typeLookupName}" when parsing launchers`,
|
|
436
|
-
).Then((type) =>
|
|
437
|
-
dispatchFromAPIRawValue(
|
|
438
|
-
type,
|
|
439
|
-
specification.types,
|
|
440
|
-
apiConverters,
|
|
441
|
-
injectedPrimitives,
|
|
442
|
-
)(raw),
|
|
443
|
-
),
|
|
444
|
-
parseValueToApi: (
|
|
445
|
-
value: PredicateValue,
|
|
446
|
-
type: DispatchParsedType<T>,
|
|
447
|
-
state: any,
|
|
448
|
-
) =>
|
|
449
|
-
dispatchToAPIRawValue(
|
|
450
|
-
type,
|
|
451
|
-
specification.types,
|
|
452
|
-
apiConverters,
|
|
453
|
-
injectedPrimitives,
|
|
454
|
-
)(value, state),
|
|
455
|
-
getTypeByLookupName: (typeLookupName: string) =>
|
|
456
|
-
MapRepo.Operations.tryFindWithError(
|
|
457
|
-
typeLookupName,
|
|
458
|
-
specification.types,
|
|
459
|
-
() => `cannot find type "${typeLookupName}" in types`,
|
|
460
|
-
),
|
|
461
|
-
}),
|
|
659
|
+
),
|
|
462
660
|
)
|
|
463
661
|
.MapErrors((errors) =>
|
|
464
662
|
errors.map((error) => `${error}\n...When parsing launchers`),
|
|
@@ -392,38 +392,43 @@ export const TableAbstractRendererState = {
|
|
|
392
392
|
fromApiRaw: (value: any) => ValueOrErrors<PredicateValue, string>,
|
|
393
393
|
): OrderedMap<string, ValueRecord> =>
|
|
394
394
|
OrderedMap(
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
395
|
+
values === null || values === undefined
|
|
396
|
+
? OrderedMap()
|
|
397
|
+
: Object.entries(values).map(([key, _]) => {
|
|
398
|
+
const parsedRow = fromApiRaw(_);
|
|
399
|
+
if (parsedRow.kind == "errors") {
|
|
400
|
+
console.error(parsedRow.errors.toJS());
|
|
401
|
+
return [
|
|
402
|
+
key.toString(),
|
|
403
|
+
PredicateValue.Default.record(OrderedMap()),
|
|
404
|
+
];
|
|
405
|
+
}
|
|
406
|
+
if (!PredicateValue.Operations.IsRecord(parsedRow.value)) {
|
|
407
|
+
console.error("Expected a record");
|
|
408
|
+
return [
|
|
409
|
+
key.toString(),
|
|
410
|
+
PredicateValue.Default.record(OrderedMap()),
|
|
411
|
+
];
|
|
412
|
+
}
|
|
413
|
+
if (!parsedRow.value.fields.has("Id")) {
|
|
414
|
+
console.error("Expected a record with 'Id' field");
|
|
415
|
+
return [
|
|
416
|
+
key.toString(),
|
|
417
|
+
PredicateValue.Default.record(OrderedMap()),
|
|
418
|
+
];
|
|
419
|
+
}
|
|
420
|
+
if (typeof parsedRow.value.fields.get("Id")! !== "string") {
|
|
421
|
+
console.error("Id must be a string");
|
|
422
|
+
return [
|
|
423
|
+
key.toString(),
|
|
424
|
+
PredicateValue.Default.record(OrderedMap()),
|
|
425
|
+
];
|
|
426
|
+
}
|
|
427
|
+
return [
|
|
428
|
+
parsedRow.value.fields.get("Id")! as string,
|
|
429
|
+
parsedRow.value,
|
|
430
|
+
];
|
|
431
|
+
}),
|
|
427
432
|
),
|
|
428
433
|
},
|
|
429
434
|
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../../../../../../../../../main";
|
|
7
7
|
import { ListRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/list/state";
|
|
8
8
|
import { NestedDispatcher } from "../nestedDispatcher/state";
|
|
9
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
9
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
10
10
|
|
|
11
11
|
//TODO check type
|
|
12
12
|
export const ListDispatcher = {
|
package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/lookup/state.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { ValueOrErrors } from "../../../../../../../../../main";
|
|
8
8
|
import { LookupRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/lookup/state";
|
|
9
9
|
import { Dispatcher } from "../../state";
|
|
10
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
10
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
11
11
|
|
|
12
12
|
export const LookupDispatcher = {
|
|
13
13
|
Operations: {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
Template,
|
|
6
6
|
} from "../../../../../../../../../main";
|
|
7
7
|
import { MapRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/map/state";
|
|
8
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
8
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
9
9
|
import { NestedDispatcher } from "../nestedDispatcher/state";
|
|
10
10
|
|
|
11
11
|
export const MapDispatcher = {
|
package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/multiSelection/state.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { Template } from "../../../../../../../../template/state";
|
|
|
13
13
|
import { OrderedMap } from "immutable";
|
|
14
14
|
import { StreamRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/stream/state";
|
|
15
15
|
import { EnumRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/enum/state";
|
|
16
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
16
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
17
17
|
|
|
18
18
|
export const MultiSelectionDispatcher = {
|
|
19
19
|
Operations: {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "../../../../../../../../../main";
|
|
6
6
|
import { NestedRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/nestedRenderer/state";
|
|
7
7
|
import { Dispatcher } from "../../state";
|
|
8
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
8
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
9
9
|
|
|
10
10
|
export const NestedDispatcher = {
|
|
11
11
|
Operations: {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../../../../../../../../../main";
|
|
11
11
|
import { OneRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/one/state";
|
|
12
12
|
import { NestedDispatcher } from "../nestedDispatcher/state";
|
|
13
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
13
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
14
14
|
|
|
15
15
|
export const OneDispatcher = {
|
|
16
16
|
Operations: {
|
package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/primitive/state.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { BoolAbstractRenderer } from "../../../abstract-renderers/boolean/templa
|
|
|
14
14
|
import { SecretAbstractRenderer } from "../../../abstract-renderers/secret/template";
|
|
15
15
|
import { Base64FileAbstractRenderer } from "../../../abstract-renderers/base-64-file/template";
|
|
16
16
|
import { PrimitiveRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/primitive/state";
|
|
17
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
17
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
18
18
|
|
|
19
19
|
export const PrimitiveDispatcher = {
|
|
20
20
|
Operations: {
|
package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/readOnly/state.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../../../../../../../../../main";
|
|
7
7
|
import { ReadOnlyRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/readOnly/state";
|
|
8
8
|
import { NestedDispatcher } from "../nestedDispatcher/state";
|
|
9
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
9
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
10
10
|
|
|
11
11
|
export const ReadOnlyDispatcher = {
|
|
12
12
|
Operations: {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ValueOrErrors,
|
|
5
5
|
} from "../../../../../../../../../../main";
|
|
6
6
|
import { RecordFieldRenderer } from "../../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/record/domains/recordFieldRenderer/state";
|
|
7
|
-
import { DispatcherContextWithApiSources } from "../../../../../
|
|
7
|
+
import { DispatcherContextWithApiSources } from "../../../../../state";
|
|
8
8
|
import { NestedDispatcher } from "../../nestedDispatcher/state";
|
|
9
9
|
|
|
10
10
|
export const RecordFieldDispatcher = {
|
package/src/forms/domains/dispatched-forms/runner/domains/dispatcher/domains/record/state.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../../../../../../../../../main";
|
|
11
11
|
import { RecordRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/record/state";
|
|
12
12
|
import { RecordFieldDispatcher } from "./recordField/state";
|
|
13
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
13
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
14
14
|
|
|
15
15
|
export const RecordDispatcher = {
|
|
16
16
|
Operations: {
|
|
@@ -13,7 +13,7 @@ import { Template } from "../../../../../../../../template/state";
|
|
|
13
13
|
import { OrderedMap } from "immutable";
|
|
14
14
|
import { EnumRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/enum/state";
|
|
15
15
|
import { StreamRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/stream/state";
|
|
16
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
16
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
17
17
|
|
|
18
18
|
export const SingleSelectionDispatcher = {
|
|
19
19
|
Operations: {
|
|
@@ -8,7 +8,7 @@ import { SumAbstractRenderer } from "../../../abstract-renderers/sum/template";
|
|
|
8
8
|
import { SumRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/sum/state";
|
|
9
9
|
import { NestedDispatcher } from "../nestedDispatcher/state";
|
|
10
10
|
import { SumUnitDateRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/sumUnitDate/state";
|
|
11
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
11
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
12
12
|
|
|
13
13
|
export const SumDispatcher = {
|
|
14
14
|
Operations: {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import { DispatchTableApiSource } from "../../../../../../../../../main";
|
|
17
17
|
import { NestedDispatcher } from "../nestedDispatcher/state";
|
|
18
18
|
import { TableRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/table/state";
|
|
19
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
19
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
20
20
|
import { List, Map } from "immutable";
|
|
21
21
|
|
|
22
22
|
export const TableDispatcher = {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { TupleType } from "../../../../../deserializer/domains/specification/domains/types/state";
|
|
12
12
|
import { TupleRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/tuple/state";
|
|
13
13
|
import { NestedDispatcher } from "../nestedDispatcher/state";
|
|
14
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
14
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
15
15
|
|
|
16
16
|
export const TupleDispatcher = {
|
|
17
17
|
Operations: {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
|
|
13
13
|
import { UnionRenderer } from "../../../../../deserializer/domains/specification/domains/forms/domains/renderer/domains/union/state";
|
|
14
14
|
import { Dispatcher } from "../../state";
|
|
15
|
-
import { DispatcherContextWithApiSources } from "../../../../
|
|
15
|
+
import { DispatcherContextWithApiSources } from "../../../../state";
|
|
16
16
|
|
|
17
17
|
export const UnionDispatcher = {
|
|
18
18
|
Operations: {
|