@coopenomics/factory 2.2.4 → 2.2.6
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/index.cjs +298 -116
- package/dist/index.d.cts +77 -54
- package/dist/index.d.mts +77 -54
- package/dist/index.d.ts +77 -54
- package/dist/index.mjs +297 -117
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -353,8 +353,8 @@ const VarsSchema = {
|
|
|
353
353
|
additionalProperties: true
|
|
354
354
|
};
|
|
355
355
|
|
|
356
|
-
const registry_id$
|
|
357
|
-
const Schema$
|
|
356
|
+
const registry_id$b = Cooperative$1.Registry.WalletAgreement.registry_id;
|
|
357
|
+
const Schema$b = {
|
|
358
358
|
type: "object",
|
|
359
359
|
properties: {
|
|
360
360
|
meta: IMetaJSONSchema,
|
|
@@ -364,23 +364,23 @@ const Schema$9 = {
|
|
|
364
364
|
required: ["meta", "coop", "vars"],
|
|
365
365
|
additionalProperties: true
|
|
366
366
|
};
|
|
367
|
-
const Template$
|
|
367
|
+
const Template$b = {
|
|
368
368
|
title: Cooperative$1.Registry.WalletAgreement.title,
|
|
369
369
|
description: Cooperative$1.Registry.WalletAgreement.description,
|
|
370
|
-
model: Schema$
|
|
370
|
+
model: Schema$b,
|
|
371
371
|
context: Cooperative$1.Registry.WalletAgreement.context,
|
|
372
372
|
translations: Cooperative$1.Registry.WalletAgreement.translations
|
|
373
373
|
};
|
|
374
374
|
|
|
375
375
|
const WalletAgreement = {
|
|
376
376
|
__proto__: null,
|
|
377
|
-
Schema: Schema$
|
|
378
|
-
Template: Template$
|
|
379
|
-
registry_id: registry_id$
|
|
377
|
+
Schema: Schema$b,
|
|
378
|
+
Template: Template$b,
|
|
379
|
+
registry_id: registry_id$b
|
|
380
380
|
};
|
|
381
381
|
|
|
382
|
-
const registry_id$
|
|
383
|
-
const Schema$
|
|
382
|
+
const registry_id$a = Cooperative$1.Registry.RegulationElectronicSignature.registry_id;
|
|
383
|
+
const Schema$a = {
|
|
384
384
|
type: "object",
|
|
385
385
|
properties: {
|
|
386
386
|
meta: IMetaJSONSchema,
|
|
@@ -390,23 +390,23 @@ const Schema$8 = {
|
|
|
390
390
|
required: ["meta", "coop", "vars"],
|
|
391
391
|
additionalProperties: true
|
|
392
392
|
};
|
|
393
|
-
const Template$
|
|
393
|
+
const Template$a = {
|
|
394
394
|
title: Cooperative$1.Registry.RegulationElectronicSignature.title,
|
|
395
395
|
description: Cooperative$1.Registry.RegulationElectronicSignature.description,
|
|
396
|
-
model: Schema$
|
|
396
|
+
model: Schema$a,
|
|
397
397
|
context: Cooperative$1.Registry.RegulationElectronicSignature.context,
|
|
398
398
|
translations: Cooperative$1.Registry.RegulationElectronicSignature.translations
|
|
399
399
|
};
|
|
400
400
|
|
|
401
401
|
const RegulationElectronicSignaturet = {
|
|
402
402
|
__proto__: null,
|
|
403
|
-
Schema: Schema$
|
|
404
|
-
Template: Template$
|
|
405
|
-
registry_id: registry_id$
|
|
403
|
+
Schema: Schema$a,
|
|
404
|
+
Template: Template$a,
|
|
405
|
+
registry_id: registry_id$a
|
|
406
406
|
};
|
|
407
407
|
|
|
408
|
-
const registry_id$
|
|
409
|
-
const Schema$
|
|
408
|
+
const registry_id$9 = Cooperative$1.Registry.PrivacyPolicy.registry_id;
|
|
409
|
+
const Schema$9 = {
|
|
410
410
|
type: "object",
|
|
411
411
|
properties: {
|
|
412
412
|
meta: IMetaJSONSchema,
|
|
@@ -416,23 +416,23 @@ const Schema$7 = {
|
|
|
416
416
|
required: ["meta", "coop", "vars"],
|
|
417
417
|
additionalProperties: true
|
|
418
418
|
};
|
|
419
|
-
const Template$
|
|
419
|
+
const Template$9 = {
|
|
420
420
|
title: Cooperative$1.Registry.PrivacyPolicy.title,
|
|
421
421
|
description: Cooperative$1.Registry.PrivacyPolicy.description,
|
|
422
|
-
model: Schema$
|
|
422
|
+
model: Schema$9,
|
|
423
423
|
context: Cooperative$1.Registry.PrivacyPolicy.context,
|
|
424
424
|
translations: Cooperative$1.Registry.PrivacyPolicy.translations
|
|
425
425
|
};
|
|
426
426
|
|
|
427
427
|
const PrivacyPolicy = {
|
|
428
428
|
__proto__: null,
|
|
429
|
-
Schema: Schema$
|
|
430
|
-
Template: Template$
|
|
431
|
-
registry_id: registry_id$
|
|
429
|
+
Schema: Schema$9,
|
|
430
|
+
Template: Template$9,
|
|
431
|
+
registry_id: registry_id$9
|
|
432
432
|
};
|
|
433
433
|
|
|
434
|
-
const registry_id$
|
|
435
|
-
const Schema$
|
|
434
|
+
const registry_id$8 = Cooperative$1.Registry.UserAgreement.registry_id;
|
|
435
|
+
const Schema$8 = {
|
|
436
436
|
type: "object",
|
|
437
437
|
properties: {
|
|
438
438
|
meta: IMetaJSONSchema,
|
|
@@ -449,23 +449,23 @@ const Schema$6 = {
|
|
|
449
449
|
required: ["meta", "coop", "vars", "user"],
|
|
450
450
|
additionalProperties: true
|
|
451
451
|
};
|
|
452
|
-
const Template$
|
|
452
|
+
const Template$8 = {
|
|
453
453
|
title: Cooperative$1.Registry.UserAgreement.title,
|
|
454
454
|
description: Cooperative$1.Registry.UserAgreement.description,
|
|
455
|
-
model: Schema$
|
|
455
|
+
model: Schema$8,
|
|
456
456
|
context: Cooperative$1.Registry.UserAgreement.context,
|
|
457
457
|
translations: Cooperative$1.Registry.UserAgreement.translations
|
|
458
458
|
};
|
|
459
459
|
|
|
460
460
|
const UserAgreement = {
|
|
461
461
|
__proto__: null,
|
|
462
|
-
Schema: Schema$
|
|
463
|
-
Template: Template$
|
|
464
|
-
registry_id: registry_id$
|
|
462
|
+
Schema: Schema$8,
|
|
463
|
+
Template: Template$8,
|
|
464
|
+
registry_id: registry_id$8
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
-
const registry_id$
|
|
468
|
-
const Schema$
|
|
467
|
+
const registry_id$7 = Cooperative$1.Registry.CoopenomicsAgreement.registry_id;
|
|
468
|
+
const Schema$7 = {
|
|
469
469
|
type: "object",
|
|
470
470
|
properties: {
|
|
471
471
|
meta: IMetaJSONSchema,
|
|
@@ -476,23 +476,23 @@ const Schema$5 = {
|
|
|
476
476
|
required: ["meta", "coop", "vars", "partner"],
|
|
477
477
|
additionalProperties: true
|
|
478
478
|
};
|
|
479
|
-
const Template$
|
|
479
|
+
const Template$7 = {
|
|
480
480
|
title: Cooperative$1.Registry.CoopenomicsAgreement.title,
|
|
481
481
|
description: Cooperative$1.Registry.CoopenomicsAgreement.description,
|
|
482
|
-
model: Schema$
|
|
482
|
+
model: Schema$7,
|
|
483
483
|
context: Cooperative$1.Registry.CoopenomicsAgreement.context,
|
|
484
484
|
translations: Cooperative$1.Registry.CoopenomicsAgreement.translations
|
|
485
485
|
};
|
|
486
486
|
|
|
487
487
|
const CoopenomicsAgreement = {
|
|
488
488
|
__proto__: null,
|
|
489
|
-
Schema: Schema$
|
|
490
|
-
Template: Template$
|
|
491
|
-
registry_id: registry_id$
|
|
489
|
+
Schema: Schema$7,
|
|
490
|
+
Template: Template$7,
|
|
491
|
+
registry_id: registry_id$7
|
|
492
492
|
};
|
|
493
493
|
|
|
494
|
-
const registry_id$
|
|
495
|
-
const Schema$
|
|
494
|
+
const registry_id$6 = Cooperative$1.Registry.ParticipantApplication.registry_id;
|
|
495
|
+
const Schema$6 = {
|
|
496
496
|
type: "object",
|
|
497
497
|
properties: {
|
|
498
498
|
type: {
|
|
@@ -564,23 +564,23 @@ const Schema$4 = {
|
|
|
564
564
|
required: ["meta", "coop", "type", "signature"],
|
|
565
565
|
additionalProperties: true
|
|
566
566
|
};
|
|
567
|
-
const Template$
|
|
567
|
+
const Template$6 = {
|
|
568
568
|
title: Cooperative$1.Registry.ParticipantApplication.title,
|
|
569
569
|
description: Cooperative$1.Registry.ParticipantApplication.description,
|
|
570
|
-
model: Schema$
|
|
570
|
+
model: Schema$6,
|
|
571
571
|
context: Cooperative$1.Registry.ParticipantApplication.context,
|
|
572
572
|
translations: Cooperative$1.Registry.ParticipantApplication.translations
|
|
573
573
|
};
|
|
574
574
|
|
|
575
575
|
const ParticipantApplication = {
|
|
576
576
|
__proto__: null,
|
|
577
|
-
Schema: Schema$
|
|
578
|
-
Template: Template$
|
|
579
|
-
registry_id: registry_id$
|
|
577
|
+
Schema: Schema$6,
|
|
578
|
+
Template: Template$6,
|
|
579
|
+
registry_id: registry_id$6
|
|
580
580
|
};
|
|
581
581
|
|
|
582
|
-
const registry_id$
|
|
583
|
-
const Schema$
|
|
582
|
+
const registry_id$5 = Cooperative$1.Registry.DecisionOfParticipantApplication.registry_id;
|
|
583
|
+
const Schema$5 = {
|
|
584
584
|
type: "object",
|
|
585
585
|
properties: {
|
|
586
586
|
type: {
|
|
@@ -637,28 +637,30 @@ const Schema$3 = {
|
|
|
637
637
|
},
|
|
638
638
|
required: [...IMetaJSONSchema.required],
|
|
639
639
|
additionalProperties: true
|
|
640
|
-
}
|
|
640
|
+
},
|
|
641
|
+
vars: VarsSchema
|
|
641
642
|
},
|
|
642
643
|
required: ["meta", "coop", "type", "decision"],
|
|
644
|
+
// vars не добавляем в обязательные параметры для обратной совместимости (начиная с 2.26)
|
|
643
645
|
additionalProperties: true
|
|
644
646
|
};
|
|
645
|
-
const Template$
|
|
647
|
+
const Template$5 = {
|
|
646
648
|
title: Cooperative$1.Registry.DecisionOfParticipantApplication.title,
|
|
647
649
|
description: Cooperative$1.Registry.DecisionOfParticipantApplication.description,
|
|
648
|
-
model: Schema$
|
|
650
|
+
model: Schema$5,
|
|
649
651
|
context: Cooperative$1.Registry.DecisionOfParticipantApplication.context,
|
|
650
652
|
translations: Cooperative$1.Registry.DecisionOfParticipantApplication.translations
|
|
651
653
|
};
|
|
652
654
|
|
|
653
655
|
const DecisionOfParticipantApplication = {
|
|
654
656
|
__proto__: null,
|
|
655
|
-
Schema: Schema$
|
|
656
|
-
Template: Template$
|
|
657
|
-
registry_id: registry_id$
|
|
657
|
+
Schema: Schema$5,
|
|
658
|
+
Template: Template$5,
|
|
659
|
+
registry_id: registry_id$5
|
|
658
660
|
};
|
|
659
661
|
|
|
660
|
-
const registry_id$
|
|
661
|
-
const Schema$
|
|
662
|
+
const registry_id$4 = Cooperative$1.Registry.SelectBranchStatement.registry_id;
|
|
663
|
+
const Schema$4 = {
|
|
662
664
|
type: "object",
|
|
663
665
|
properties: {
|
|
664
666
|
type: {
|
|
@@ -713,23 +715,23 @@ const Schema$2 = {
|
|
|
713
715
|
required: ["meta", "type", "branch", "vars"],
|
|
714
716
|
additionalProperties: true
|
|
715
717
|
};
|
|
716
|
-
const Template$
|
|
718
|
+
const Template$4 = {
|
|
717
719
|
title: Cooperative$1.Registry.SelectBranchStatement.title,
|
|
718
720
|
description: Cooperative$1.Registry.SelectBranchStatement.description,
|
|
719
|
-
model: Schema$
|
|
721
|
+
model: Schema$4,
|
|
720
722
|
context: Cooperative$1.Registry.SelectBranchStatement.context,
|
|
721
723
|
translations: Cooperative$1.Registry.SelectBranchStatement.translations
|
|
722
724
|
};
|
|
723
725
|
|
|
724
726
|
const SelectBranchStatement = {
|
|
725
727
|
__proto__: null,
|
|
726
|
-
Schema: Schema$
|
|
727
|
-
Template: Template$
|
|
728
|
-
registry_id: registry_id$
|
|
728
|
+
Schema: Schema$4,
|
|
729
|
+
Template: Template$4,
|
|
730
|
+
registry_id: registry_id$4
|
|
729
731
|
};
|
|
730
732
|
|
|
731
|
-
const registry_id$
|
|
732
|
-
const Schema$
|
|
733
|
+
const registry_id$3 = Cooperative$1.Registry.ProjectFreeDecision.registry_id;
|
|
734
|
+
const Schema$3 = {
|
|
733
735
|
type: "object",
|
|
734
736
|
properties: {
|
|
735
737
|
coop: {
|
|
@@ -764,23 +766,23 @@ const Schema$1 = {
|
|
|
764
766
|
required: ["meta", "coop", "project", "suggester_name", "vars"],
|
|
765
767
|
additionalProperties: true
|
|
766
768
|
};
|
|
767
|
-
const Template$
|
|
769
|
+
const Template$3 = {
|
|
768
770
|
title: Cooperative$1.Registry.ProjectFreeDecision.title,
|
|
769
771
|
description: Cooperative$1.Registry.ProjectFreeDecision.description,
|
|
770
|
-
model: Schema$
|
|
772
|
+
model: Schema$3,
|
|
771
773
|
context: Cooperative$1.Registry.ProjectFreeDecision.context,
|
|
772
774
|
translations: Cooperative$1.Registry.ProjectFreeDecision.translations
|
|
773
775
|
};
|
|
774
776
|
|
|
775
777
|
const ProjectFreeDecision = {
|
|
776
778
|
__proto__: null,
|
|
777
|
-
Schema: Schema$
|
|
778
|
-
Template: Template$
|
|
779
|
-
registry_id: registry_id$
|
|
779
|
+
Schema: Schema$3,
|
|
780
|
+
Template: Template$3,
|
|
781
|
+
registry_id: registry_id$3
|
|
780
782
|
};
|
|
781
783
|
|
|
782
|
-
const registry_id = Cooperative$1.Registry.FreeDecision.registry_id;
|
|
783
|
-
const Schema = {
|
|
784
|
+
const registry_id$2 = Cooperative$1.Registry.FreeDecision.registry_id;
|
|
785
|
+
const Schema$2 = {
|
|
784
786
|
type: "object",
|
|
785
787
|
properties: {
|
|
786
788
|
coop: {
|
|
@@ -816,20 +818,113 @@ const Schema = {
|
|
|
816
818
|
},
|
|
817
819
|
required: ["id", "question", "decision"],
|
|
818
820
|
additionalProperties: true
|
|
819
|
-
}
|
|
821
|
+
},
|
|
822
|
+
vars: VarsSchema
|
|
820
823
|
},
|
|
821
824
|
required: ["meta", "coop", "decision", "project"],
|
|
825
|
+
// vars не вносим для обратной совместимости начиная с версии 2.25
|
|
822
826
|
additionalProperties: true
|
|
823
827
|
};
|
|
824
|
-
const Template = {
|
|
828
|
+
const Template$2 = {
|
|
825
829
|
title: Cooperative$1.Registry.FreeDecision.title,
|
|
826
830
|
description: Cooperative$1.Registry.FreeDecision.description,
|
|
827
|
-
model: Schema,
|
|
831
|
+
model: Schema$2,
|
|
828
832
|
context: Cooperative$1.Registry.FreeDecision.context,
|
|
829
833
|
translations: Cooperative$1.Registry.FreeDecision.translations
|
|
830
834
|
};
|
|
831
835
|
|
|
832
836
|
const FreeDecision = {
|
|
837
|
+
__proto__: null,
|
|
838
|
+
Schema: Schema$2,
|
|
839
|
+
Template: Template$2,
|
|
840
|
+
registry_id: registry_id$2
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
const MiddlewareRequestSchema = {
|
|
844
|
+
type: "object",
|
|
845
|
+
properties: {
|
|
846
|
+
hash: { type: "string" },
|
|
847
|
+
title: { type: "string" },
|
|
848
|
+
unit_of_measurement: { type: "string" },
|
|
849
|
+
units: { type: "number" },
|
|
850
|
+
unit_cost: { type: "number" },
|
|
851
|
+
total_cost: { type: "number" },
|
|
852
|
+
currency: { type: "string" },
|
|
853
|
+
type: { type: "string" }
|
|
854
|
+
},
|
|
855
|
+
required: [
|
|
856
|
+
"hash",
|
|
857
|
+
"title",
|
|
858
|
+
"unit_of_measurement",
|
|
859
|
+
"units",
|
|
860
|
+
"unit_cost",
|
|
861
|
+
"total_cost",
|
|
862
|
+
"currency",
|
|
863
|
+
"type"
|
|
864
|
+
],
|
|
865
|
+
additionalProperties: true
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
const IMiddlewareUserSchema = {
|
|
869
|
+
type: "object",
|
|
870
|
+
properties: {
|
|
871
|
+
full_name: { type: "string" }
|
|
872
|
+
},
|
|
873
|
+
required: ["full_name"],
|
|
874
|
+
additionalProperties: true
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
const registry_id$1 = Cooperative$1.Registry.AssetContributionStatement.registry_id;
|
|
878
|
+
const Schema$1 = {
|
|
879
|
+
type: "object",
|
|
880
|
+
properties: {
|
|
881
|
+
meta: IMetaJSONSchema,
|
|
882
|
+
coop: CooperativeSchema,
|
|
883
|
+
vars: VarsSchema,
|
|
884
|
+
request: MiddlewareRequestSchema,
|
|
885
|
+
user: IMiddlewareUserSchema,
|
|
886
|
+
currency: { type: "string" }
|
|
887
|
+
},
|
|
888
|
+
required: ["meta", "coop", "vars", "request", "user", "currency"],
|
|
889
|
+
additionalProperties: true
|
|
890
|
+
};
|
|
891
|
+
const Template$1 = {
|
|
892
|
+
title: Cooperative$1.Registry.AssetContributionStatement.title,
|
|
893
|
+
description: Cooperative$1.Registry.AssetContributionStatement.description,
|
|
894
|
+
model: Schema$1,
|
|
895
|
+
context: Cooperative$1.Registry.AssetContributionStatement.context,
|
|
896
|
+
translations: Cooperative$1.Registry.AssetContributionStatement.translations
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
const AssetContributionStatement = {
|
|
900
|
+
__proto__: null,
|
|
901
|
+
Schema: Schema$1,
|
|
902
|
+
Template: Template$1,
|
|
903
|
+
registry_id: registry_id$1
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
const registry_id = Cooperative$1.Registry.ReturnByAssetStatement.registry_id;
|
|
907
|
+
const Schema = {
|
|
908
|
+
type: "object",
|
|
909
|
+
properties: {
|
|
910
|
+
meta: IMetaJSONSchema,
|
|
911
|
+
coop: CooperativeSchema,
|
|
912
|
+
vars: VarsSchema,
|
|
913
|
+
request: MiddlewareRequestSchema,
|
|
914
|
+
user: IMiddlewareUserSchema
|
|
915
|
+
},
|
|
916
|
+
required: ["meta", "coop", "vars", "request", "user"],
|
|
917
|
+
additionalProperties: true
|
|
918
|
+
};
|
|
919
|
+
const Template = {
|
|
920
|
+
title: Cooperative$1.Registry.ReturnByAssetStatement.title,
|
|
921
|
+
description: Cooperative$1.Registry.ReturnByAssetStatement.description,
|
|
922
|
+
model: Schema,
|
|
923
|
+
context: Cooperative$1.Registry.ReturnByAssetStatement.context,
|
|
924
|
+
translations: Cooperative$1.Registry.ReturnByAssetStatement.translations
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
const ReturnByAssetStatement = {
|
|
833
928
|
__proto__: null,
|
|
834
929
|
Schema: Schema,
|
|
835
930
|
Template: Template,
|
|
@@ -846,7 +941,9 @@ const Registry = {
|
|
|
846
941
|
101: SelectBranchStatement,
|
|
847
942
|
501: DecisionOfParticipantApplication,
|
|
848
943
|
599: ProjectFreeDecision,
|
|
849
|
-
600: FreeDecision
|
|
944
|
+
600: FreeDecision,
|
|
945
|
+
700: AssetContributionStatement,
|
|
946
|
+
800: ReturnByAssetStatement
|
|
850
947
|
};
|
|
851
948
|
|
|
852
949
|
var __defProp$c = Object.defineProperty;
|
|
@@ -1467,7 +1564,7 @@ class PDFService {
|
|
|
1467
1564
|
|
|
1468
1565
|
const name = "@coopenomics/factory";
|
|
1469
1566
|
const type = "module";
|
|
1470
|
-
const version = "2.2.
|
|
1567
|
+
const version = "2.2.6";
|
|
1471
1568
|
const packageManager = "pnpm@9.0.6";
|
|
1472
1569
|
const description = "";
|
|
1473
1570
|
const author = "Alex Ant <chairman.voskhod@gmail.com>";
|
|
@@ -1516,7 +1613,7 @@ const dependencies = {
|
|
|
1516
1613
|
"ajv-formats": "^3.0.1",
|
|
1517
1614
|
"ajv-i18n": "^4.2.0",
|
|
1518
1615
|
axios: "^1.7.2",
|
|
1519
|
-
cooptypes: "2.2.
|
|
1616
|
+
cooptypes: "2.2.6",
|
|
1520
1617
|
dotenv: "^16.4.5",
|
|
1521
1618
|
"eosjs-ecc": "^4.0.7",
|
|
1522
1619
|
handlebars: "^4.7.8",
|
|
@@ -1558,7 +1655,7 @@ const pnpm = {
|
|
|
1558
1655
|
"vite@>=5.1.0 <=5.1.6": ">=5.1.7"
|
|
1559
1656
|
}
|
|
1560
1657
|
};
|
|
1561
|
-
const gitHead = "
|
|
1658
|
+
const gitHead = "d0bd4428bebd6971c23c27d8d26643d72e3f07cb";
|
|
1562
1659
|
const packageJson = {
|
|
1563
1660
|
name: name,
|
|
1564
1661
|
type: type,
|
|
@@ -1769,6 +1866,14 @@ class DocFactory {
|
|
|
1769
1866
|
}
|
|
1770
1867
|
return "";
|
|
1771
1868
|
}
|
|
1869
|
+
getFullParticipantName(data) {
|
|
1870
|
+
if ("first_name" in data) {
|
|
1871
|
+
return `${data.last_name} ${data.first_name} ${data.middle_name}`;
|
|
1872
|
+
} else if ("short_name" in data) {
|
|
1873
|
+
return data.short_name;
|
|
1874
|
+
}
|
|
1875
|
+
return "";
|
|
1876
|
+
}
|
|
1772
1877
|
async saveDraft(document) {
|
|
1773
1878
|
await this.storage.saveDraft(document);
|
|
1774
1879
|
}
|
|
@@ -1816,16 +1921,16 @@ class DocFactory {
|
|
|
1816
1921
|
}
|
|
1817
1922
|
}
|
|
1818
1923
|
|
|
1819
|
-
let Factory$
|
|
1924
|
+
let Factory$b = class Factory extends DocFactory {
|
|
1820
1925
|
constructor(storage) {
|
|
1821
1926
|
super(storage);
|
|
1822
1927
|
}
|
|
1823
1928
|
async generateDocument(data, options) {
|
|
1824
1929
|
let template;
|
|
1825
1930
|
if (process.env.SOURCE === "local") {
|
|
1826
|
-
template = Template$
|
|
1931
|
+
template = Template$b;
|
|
1827
1932
|
} else {
|
|
1828
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
1933
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$b, data.block_num);
|
|
1829
1934
|
}
|
|
1830
1935
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1831
1936
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1843,16 +1948,16 @@ let Factory$9 = class Factory extends DocFactory {
|
|
|
1843
1948
|
}
|
|
1844
1949
|
};
|
|
1845
1950
|
|
|
1846
|
-
let Factory$
|
|
1951
|
+
let Factory$a = class Factory extends DocFactory {
|
|
1847
1952
|
constructor(storage) {
|
|
1848
1953
|
super(storage);
|
|
1849
1954
|
}
|
|
1850
1955
|
async generateDocument(data, options) {
|
|
1851
1956
|
let template;
|
|
1852
1957
|
if (process.env.SOURCE === "local") {
|
|
1853
|
-
template = Template$
|
|
1958
|
+
template = Template$a;
|
|
1854
1959
|
} else {
|
|
1855
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
1960
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$a, data.block_num);
|
|
1856
1961
|
}
|
|
1857
1962
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1858
1963
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1870,16 +1975,16 @@ let Factory$8 = class Factory extends DocFactory {
|
|
|
1870
1975
|
}
|
|
1871
1976
|
};
|
|
1872
1977
|
|
|
1873
|
-
let Factory$
|
|
1978
|
+
let Factory$9 = class Factory extends DocFactory {
|
|
1874
1979
|
constructor(storage) {
|
|
1875
1980
|
super(storage);
|
|
1876
1981
|
}
|
|
1877
1982
|
async generateDocument(data, options) {
|
|
1878
1983
|
let template;
|
|
1879
1984
|
if (process.env.SOURCE === "local") {
|
|
1880
|
-
template = Template$
|
|
1985
|
+
template = Template$9;
|
|
1881
1986
|
} else {
|
|
1882
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
1987
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$9, data.block_num);
|
|
1883
1988
|
}
|
|
1884
1989
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1885
1990
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1897,16 +2002,16 @@ let Factory$7 = class Factory extends DocFactory {
|
|
|
1897
2002
|
}
|
|
1898
2003
|
};
|
|
1899
2004
|
|
|
1900
|
-
let Factory$
|
|
2005
|
+
let Factory$8 = class Factory extends DocFactory {
|
|
1901
2006
|
constructor(storage) {
|
|
1902
2007
|
super(storage);
|
|
1903
2008
|
}
|
|
1904
2009
|
async generateDocument(data, options) {
|
|
1905
2010
|
let template;
|
|
1906
2011
|
if (process.env.SOURCE === "local") {
|
|
1907
|
-
template = Template$
|
|
2012
|
+
template = Template$8;
|
|
1908
2013
|
} else {
|
|
1909
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2014
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$8, data.block_num);
|
|
1910
2015
|
}
|
|
1911
2016
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1912
2017
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1928,16 +2033,16 @@ let Factory$6 = class Factory extends DocFactory {
|
|
|
1928
2033
|
}
|
|
1929
2034
|
};
|
|
1930
2035
|
|
|
1931
|
-
let Factory$
|
|
2036
|
+
let Factory$7 = class Factory extends DocFactory {
|
|
1932
2037
|
constructor(storage) {
|
|
1933
2038
|
super(storage);
|
|
1934
2039
|
}
|
|
1935
2040
|
async generateDocument(data, options) {
|
|
1936
2041
|
let template;
|
|
1937
2042
|
if (process.env.SOURCE === "local") {
|
|
1938
|
-
template = Template$
|
|
2043
|
+
template = Template$7;
|
|
1939
2044
|
} else {
|
|
1940
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2045
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$7, data.block_num);
|
|
1941
2046
|
}
|
|
1942
2047
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1943
2048
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1957,16 +2062,16 @@ let Factory$5 = class Factory extends DocFactory {
|
|
|
1957
2062
|
}
|
|
1958
2063
|
};
|
|
1959
2064
|
|
|
1960
|
-
let Factory$
|
|
2065
|
+
let Factory$6 = class Factory extends DocFactory {
|
|
1961
2066
|
constructor(storage) {
|
|
1962
2067
|
super(storage);
|
|
1963
2068
|
}
|
|
1964
2069
|
async generateDocument(data, _options) {
|
|
1965
2070
|
let template;
|
|
1966
2071
|
if (process.env.SOURCE === "local") {
|
|
1967
|
-
template = Template$
|
|
2072
|
+
template = Template$4;
|
|
1968
2073
|
} else {
|
|
1969
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2074
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$4, data.block_num);
|
|
1970
2075
|
}
|
|
1971
2076
|
const user = await super.getUser(data.username, data.block_num);
|
|
1972
2077
|
const userData = {
|
|
@@ -1988,16 +2093,16 @@ let Factory$4 = class Factory extends DocFactory {
|
|
|
1988
2093
|
}
|
|
1989
2094
|
};
|
|
1990
2095
|
|
|
1991
|
-
let Factory$
|
|
2096
|
+
let Factory$5 = class Factory extends DocFactory {
|
|
1992
2097
|
constructor(storage) {
|
|
1993
2098
|
super(storage);
|
|
1994
2099
|
}
|
|
1995
2100
|
async generateDocument(data, _options) {
|
|
1996
2101
|
let template;
|
|
1997
2102
|
if (process.env.SOURCE === "local") {
|
|
1998
|
-
template = Template$
|
|
2103
|
+
template = Template$6;
|
|
1999
2104
|
} else {
|
|
2000
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2105
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$6, data.block_num);
|
|
2001
2106
|
}
|
|
2002
2107
|
const user = await super.getUser(data.username, data.block_num);
|
|
2003
2108
|
let bank_account = {};
|
|
@@ -2010,6 +2115,8 @@ let Factory$3 = class Factory extends DocFactory {
|
|
|
2010
2115
|
}
|
|
2011
2116
|
};
|
|
2012
2117
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
2118
|
+
const coop_bank_account = await super.getBankAccount(data.coopname, data.block_num);
|
|
2119
|
+
const extended_coop = { ...coop, bank_account: coop_bank_account };
|
|
2013
2120
|
if (coop.is_branched && !data.braname)
|
|
2014
2121
|
throw new Error("\u041A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u044B\u0439 \u0443\u0447\u0430\u0441\u0442\u043E\u043A \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0443\u043A\u0430\u0437\u0430\u043D");
|
|
2015
2122
|
let branch;
|
|
@@ -2037,7 +2144,7 @@ let Factory$3 = class Factory extends DocFactory {
|
|
|
2037
2144
|
}
|
|
2038
2145
|
}
|
|
2039
2146
|
const vars = await super.getVars(data.coopname, data.block_num);
|
|
2040
|
-
const combinedData = { ...userData, meta, coop, branch, type: user.type, vars, signature };
|
|
2147
|
+
const combinedData = { ...userData, meta, coop: extended_coop, branch, type: user.type, vars, signature };
|
|
2041
2148
|
await super.validate(combinedData, template.model);
|
|
2042
2149
|
const translation = template.translations[meta.lang];
|
|
2043
2150
|
const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, data.skip_save);
|
|
@@ -2045,22 +2152,23 @@ let Factory$3 = class Factory extends DocFactory {
|
|
|
2045
2152
|
}
|
|
2046
2153
|
};
|
|
2047
2154
|
|
|
2048
|
-
let Factory$
|
|
2155
|
+
let Factory$4 = class Factory extends DocFactory {
|
|
2049
2156
|
constructor(storage) {
|
|
2050
2157
|
super(storage);
|
|
2051
2158
|
}
|
|
2052
2159
|
async generateDocument(data, options) {
|
|
2053
2160
|
let template;
|
|
2054
2161
|
if (process.env.SOURCE === "local") {
|
|
2055
|
-
template = Template$
|
|
2162
|
+
template = Template$5;
|
|
2056
2163
|
} else {
|
|
2057
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2164
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$5, data.block_num);
|
|
2058
2165
|
}
|
|
2059
2166
|
const user = await super.getUser(data.username, data.block_num);
|
|
2060
2167
|
const userData = {
|
|
2061
2168
|
[user.type]: user.data
|
|
2062
2169
|
};
|
|
2063
2170
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
2171
|
+
const vars = await super.getVars(data.coopname, data.block_num);
|
|
2064
2172
|
const meta = await super.getMeta({
|
|
2065
2173
|
title: template.title,
|
|
2066
2174
|
...data
|
|
@@ -2073,6 +2181,7 @@ let Factory$2 = class Factory extends DocFactory {
|
|
|
2073
2181
|
);
|
|
2074
2182
|
const combinedData = {
|
|
2075
2183
|
...userData,
|
|
2184
|
+
vars,
|
|
2076
2185
|
meta,
|
|
2077
2186
|
coop,
|
|
2078
2187
|
type: user.type,
|
|
@@ -2092,16 +2201,16 @@ let Factory$2 = class Factory extends DocFactory {
|
|
|
2092
2201
|
}
|
|
2093
2202
|
};
|
|
2094
2203
|
|
|
2095
|
-
let Factory$
|
|
2204
|
+
let Factory$3 = class Factory extends DocFactory {
|
|
2096
2205
|
constructor(storage) {
|
|
2097
2206
|
super(storage);
|
|
2098
2207
|
}
|
|
2099
2208
|
async generateDocument(data, options) {
|
|
2100
2209
|
let template;
|
|
2101
2210
|
if (process.env.SOURCE === "local") {
|
|
2102
|
-
template = Template$
|
|
2211
|
+
template = Template$3;
|
|
2103
2212
|
} else {
|
|
2104
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2213
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$3, data.block_num);
|
|
2105
2214
|
}
|
|
2106
2215
|
const user = await this.getUser(data.username, data.block_num);
|
|
2107
2216
|
const suggester_name = await this.getFullName(user.data);
|
|
@@ -2137,16 +2246,16 @@ let Factory$1 = class Factory extends DocFactory {
|
|
|
2137
2246
|
}
|
|
2138
2247
|
};
|
|
2139
2248
|
|
|
2140
|
-
class Factory extends DocFactory {
|
|
2249
|
+
let Factory$2 = class Factory extends DocFactory {
|
|
2141
2250
|
constructor(storage) {
|
|
2142
2251
|
super(storage);
|
|
2143
2252
|
}
|
|
2144
2253
|
async generateDocument(data, options) {
|
|
2145
2254
|
let template;
|
|
2146
2255
|
if (process.env.SOURCE === "local") {
|
|
2147
|
-
template = Template;
|
|
2256
|
+
template = Template$2;
|
|
2148
2257
|
} else {
|
|
2149
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id, data.block_num);
|
|
2258
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$2, data.block_num);
|
|
2150
2259
|
}
|
|
2151
2260
|
const user = await this.getUser(data.username, data.block_num);
|
|
2152
2261
|
const userData = {
|
|
@@ -2166,13 +2275,14 @@ class Factory extends DocFactory {
|
|
|
2166
2275
|
if (!data.project_id)
|
|
2167
2276
|
throw new Error("\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u043D\u0435 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D");
|
|
2168
2277
|
const project = await this.getProject(data.project_id, data.block_num);
|
|
2169
|
-
|
|
2278
|
+
const vars = await super.getVars(data.coopname, data.block_num);
|
|
2170
2279
|
const combinedData = {
|
|
2171
2280
|
...userData,
|
|
2172
2281
|
meta,
|
|
2173
2282
|
coop,
|
|
2174
2283
|
decision,
|
|
2175
|
-
project
|
|
2284
|
+
project,
|
|
2285
|
+
vars
|
|
2176
2286
|
};
|
|
2177
2287
|
await this.validate(combinedData, template.model);
|
|
2178
2288
|
const translation = template.translations[meta.lang];
|
|
@@ -2186,6 +2296,72 @@ class Factory extends DocFactory {
|
|
|
2186
2296
|
);
|
|
2187
2297
|
return document;
|
|
2188
2298
|
}
|
|
2299
|
+
};
|
|
2300
|
+
|
|
2301
|
+
let Factory$1 = class Factory extends DocFactory {
|
|
2302
|
+
constructor(storage) {
|
|
2303
|
+
super(storage);
|
|
2304
|
+
}
|
|
2305
|
+
async generateDocument(data, options) {
|
|
2306
|
+
let template;
|
|
2307
|
+
if (process.env.SOURCE === "local") {
|
|
2308
|
+
template = Template$1;
|
|
2309
|
+
} else {
|
|
2310
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$1, data.block_num);
|
|
2311
|
+
}
|
|
2312
|
+
const meta = await super.getMeta({ title: template.title, ...data });
|
|
2313
|
+
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
2314
|
+
const vars = await super.getVars(data.coopname, data.block_num);
|
|
2315
|
+
const user = await super.getUser(data.username, data.block_num);
|
|
2316
|
+
const request = data.request;
|
|
2317
|
+
const full_name = await super.getFullParticipantName(user.data);
|
|
2318
|
+
const combinedData = {
|
|
2319
|
+
meta,
|
|
2320
|
+
coop,
|
|
2321
|
+
vars,
|
|
2322
|
+
user: {
|
|
2323
|
+
full_name
|
|
2324
|
+
},
|
|
2325
|
+
request
|
|
2326
|
+
};
|
|
2327
|
+
await super.validate(combinedData, template.model);
|
|
2328
|
+
const translation = template.translations[meta.lang];
|
|
2329
|
+
const document = await super.generatePDF(full_name, template.context, combinedData, translation, meta, options?.skip_save);
|
|
2330
|
+
return document;
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
|
|
2334
|
+
class Factory extends DocFactory {
|
|
2335
|
+
constructor(storage) {
|
|
2336
|
+
super(storage);
|
|
2337
|
+
}
|
|
2338
|
+
async generateDocument(data, options) {
|
|
2339
|
+
let template;
|
|
2340
|
+
if (process.env.SOURCE === "local") {
|
|
2341
|
+
template = Template;
|
|
2342
|
+
} else {
|
|
2343
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id, data.block_num);
|
|
2344
|
+
}
|
|
2345
|
+
const meta = await this.getMeta({ title: template.title, ...data });
|
|
2346
|
+
const coop = await this.getCooperative(data.coopname, data.block_num);
|
|
2347
|
+
const vars = await this.getVars(data.coopname, data.block_num);
|
|
2348
|
+
const user = await this.getUser(data.username, data.block_num);
|
|
2349
|
+
const request = data.request;
|
|
2350
|
+
const full_name = await this.getFullParticipantName(user.data);
|
|
2351
|
+
const combinedData = {
|
|
2352
|
+
meta,
|
|
2353
|
+
coop,
|
|
2354
|
+
vars,
|
|
2355
|
+
user: {
|
|
2356
|
+
full_name
|
|
2357
|
+
},
|
|
2358
|
+
request
|
|
2359
|
+
};
|
|
2360
|
+
await this.validate(combinedData, template.model);
|
|
2361
|
+
const translation = template.translations[meta.lang];
|
|
2362
|
+
const document = await super.generatePDF(full_name, template.context, combinedData, translation, meta, options?.skip_save);
|
|
2363
|
+
return document;
|
|
2364
|
+
}
|
|
2189
2365
|
}
|
|
2190
2366
|
|
|
2191
2367
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -2250,26 +2426,30 @@ class Generator {
|
|
|
2250
2426
|
async connect(mongoUri) {
|
|
2251
2427
|
this.storage = new MongoDBConnector(mongoUri);
|
|
2252
2428
|
this.factories = {
|
|
2253
|
-
[registry_id$
|
|
2429
|
+
[registry_id$b]: new Factory$b(this.storage),
|
|
2254
2430
|
// 1
|
|
2255
|
-
[registry_id$
|
|
2431
|
+
[registry_id$a]: new Factory$a(this.storage),
|
|
2256
2432
|
// 2
|
|
2257
|
-
[registry_id$
|
|
2433
|
+
[registry_id$9]: new Factory$9(this.storage),
|
|
2258
2434
|
// 3
|
|
2259
|
-
[registry_id$
|
|
2435
|
+
[registry_id$8]: new Factory$8(this.storage),
|
|
2260
2436
|
// 4
|
|
2261
|
-
[registry_id$
|
|
2437
|
+
[registry_id$7]: new Factory$7(this.storage),
|
|
2262
2438
|
// 50
|
|
2263
|
-
[registry_id$
|
|
2439
|
+
[registry_id$6]: new Factory$5(this.storage),
|
|
2264
2440
|
// 100
|
|
2265
|
-
[registry_id$
|
|
2441
|
+
[registry_id$4]: new Factory$6(this.storage),
|
|
2266
2442
|
// 101
|
|
2267
|
-
[registry_id$
|
|
2443
|
+
[registry_id$5]: new Factory$4(this.storage),
|
|
2268
2444
|
// 501
|
|
2269
|
-
[registry_id$
|
|
2445
|
+
[registry_id$3]: new Factory$3(this.storage),
|
|
2270
2446
|
// 599
|
|
2271
|
-
[registry_id]: new Factory(this.storage)
|
|
2447
|
+
[registry_id$2]: new Factory$2(this.storage),
|
|
2272
2448
|
// 600
|
|
2449
|
+
[registry_id$1]: new Factory$1(this.storage),
|
|
2450
|
+
// 700
|
|
2451
|
+
[registry_id]: new Factory(this.storage)
|
|
2452
|
+
// 800
|
|
2273
2453
|
};
|
|
2274
2454
|
await this.storage.connect();
|
|
2275
2455
|
}
|
|
@@ -2334,4 +2514,4 @@ class Generator {
|
|
|
2334
2514
|
}
|
|
2335
2515
|
}
|
|
2336
2516
|
|
|
2337
|
-
export { BankAccountSchema, CoopenomicsAgreement, CooperativeSchema, DecisionOfParticipantApplication, FreeDecision, Generator, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, SelectBranchStatement, UserAgreement, VarsSchema, WalletAgreement, decisionSchema, entrepreneurSchema, individualSchema, organizationSchema, paymentMethodSchema };
|
|
2517
|
+
export { AssetContributionStatement, BankAccountSchema, CoopenomicsAgreement, CooperativeSchema, DecisionOfParticipantApplication, FreeDecision, Generator, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ReturnByAssetStatement, SelectBranchStatement, UserAgreement, VarsSchema, WalletAgreement, decisionSchema, entrepreneurSchema, individualSchema, organizationSchema, paymentMethodSchema };
|