@coopenomics/factory 2.2.5 → 2.2.7
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 +644 -118
- package/dist/index.d.cts +133 -62
- package/dist/index.d.mts +133 -62
- package/dist/index.d.ts +133 -62
- package/dist/index.mjs +639 -119
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -77,7 +77,7 @@ const decisionSchema = {
|
|
|
77
77
|
voters_percent: { type: "number" }
|
|
78
78
|
},
|
|
79
79
|
required: ["id", "date", "time", "votes_for", "votes_against", "votes_abstained", "voters_percent"],
|
|
80
|
-
additionalProperties:
|
|
80
|
+
additionalProperties: true
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
const entrepreneurSchema = {
|
|
@@ -118,7 +118,7 @@ const organizationSchema = {
|
|
|
118
118
|
type: "object",
|
|
119
119
|
properties: {
|
|
120
120
|
username: { type: "string" },
|
|
121
|
-
type: { type: "string", enum: ["coop", "ooo", "oao", "zao", "pao", "ao"] },
|
|
121
|
+
type: { type: "string", enum: ["coop", "prodcoop", "ooo", "oao", "zao", "pao", "ao"] },
|
|
122
122
|
short_name: { type: "string" },
|
|
123
123
|
full_name: { type: "string" },
|
|
124
124
|
represented_by: {
|
|
@@ -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$f = Cooperative$1.Registry.WalletAgreement.registry_id;
|
|
357
|
+
const Schema$f = {
|
|
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$f = {
|
|
368
368
|
title: Cooperative$1.Registry.WalletAgreement.title,
|
|
369
369
|
description: Cooperative$1.Registry.WalletAgreement.description,
|
|
370
|
-
model: Schema$
|
|
370
|
+
model: Schema$f,
|
|
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$f,
|
|
378
|
+
Template: Template$f,
|
|
379
|
+
registry_id: registry_id$f
|
|
380
380
|
};
|
|
381
381
|
|
|
382
|
-
const registry_id$
|
|
383
|
-
const Schema$
|
|
382
|
+
const registry_id$e = Cooperative$1.Registry.RegulationElectronicSignature.registry_id;
|
|
383
|
+
const Schema$e = {
|
|
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$e = {
|
|
394
394
|
title: Cooperative$1.Registry.RegulationElectronicSignature.title,
|
|
395
395
|
description: Cooperative$1.Registry.RegulationElectronicSignature.description,
|
|
396
|
-
model: Schema$
|
|
396
|
+
model: Schema$e,
|
|
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$e,
|
|
404
|
+
Template: Template$e,
|
|
405
|
+
registry_id: registry_id$e
|
|
406
406
|
};
|
|
407
407
|
|
|
408
|
-
const registry_id$
|
|
409
|
-
const Schema$
|
|
408
|
+
const registry_id$d = Cooperative$1.Registry.PrivacyPolicy.registry_id;
|
|
409
|
+
const Schema$d = {
|
|
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$d = {
|
|
420
420
|
title: Cooperative$1.Registry.PrivacyPolicy.title,
|
|
421
421
|
description: Cooperative$1.Registry.PrivacyPolicy.description,
|
|
422
|
-
model: Schema$
|
|
422
|
+
model: Schema$d,
|
|
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$d,
|
|
430
|
+
Template: Template$d,
|
|
431
|
+
registry_id: registry_id$d
|
|
432
432
|
};
|
|
433
433
|
|
|
434
|
-
const registry_id$
|
|
435
|
-
const Schema$
|
|
434
|
+
const registry_id$c = Cooperative$1.Registry.UserAgreement.registry_id;
|
|
435
|
+
const Schema$c = {
|
|
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$c = {
|
|
453
453
|
title: Cooperative$1.Registry.UserAgreement.title,
|
|
454
454
|
description: Cooperative$1.Registry.UserAgreement.description,
|
|
455
|
-
model: Schema$
|
|
455
|
+
model: Schema$c,
|
|
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$c,
|
|
463
|
+
Template: Template$c,
|
|
464
|
+
registry_id: registry_id$c
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
-
const registry_id$
|
|
468
|
-
const Schema$
|
|
467
|
+
const registry_id$b = Cooperative$1.Registry.CoopenomicsAgreement.registry_id;
|
|
468
|
+
const Schema$b = {
|
|
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$b = {
|
|
480
480
|
title: Cooperative$1.Registry.CoopenomicsAgreement.title,
|
|
481
481
|
description: Cooperative$1.Registry.CoopenomicsAgreement.description,
|
|
482
|
-
model: Schema$
|
|
482
|
+
model: Schema$b,
|
|
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$b,
|
|
490
|
+
Template: Template$b,
|
|
491
|
+
registry_id: registry_id$b
|
|
492
492
|
};
|
|
493
493
|
|
|
494
|
-
const registry_id$
|
|
495
|
-
const Schema$
|
|
494
|
+
const registry_id$a = Cooperative$1.Registry.ParticipantApplication.registry_id;
|
|
495
|
+
const Schema$a = {
|
|
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$a = {
|
|
568
568
|
title: Cooperative$1.Registry.ParticipantApplication.title,
|
|
569
569
|
description: Cooperative$1.Registry.ParticipantApplication.description,
|
|
570
|
-
model: Schema$
|
|
570
|
+
model: Schema$a,
|
|
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$a,
|
|
578
|
+
Template: Template$a,
|
|
579
|
+
registry_id: registry_id$a
|
|
580
580
|
};
|
|
581
581
|
|
|
582
|
-
const registry_id$
|
|
583
|
-
const Schema$
|
|
582
|
+
const registry_id$9 = Cooperative$1.Registry.DecisionOfParticipantApplication.registry_id;
|
|
583
|
+
const Schema$9 = {
|
|
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$9 = {
|
|
646
648
|
title: Cooperative$1.Registry.DecisionOfParticipantApplication.title,
|
|
647
649
|
description: Cooperative$1.Registry.DecisionOfParticipantApplication.description,
|
|
648
|
-
model: Schema$
|
|
650
|
+
model: Schema$9,
|
|
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$9,
|
|
658
|
+
Template: Template$9,
|
|
659
|
+
registry_id: registry_id$9
|
|
658
660
|
};
|
|
659
661
|
|
|
660
|
-
const registry_id$
|
|
661
|
-
const Schema$
|
|
662
|
+
const registry_id$8 = Cooperative$1.Registry.SelectBranchStatement.registry_id;
|
|
663
|
+
const Schema$8 = {
|
|
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$8 = {
|
|
717
719
|
title: Cooperative$1.Registry.SelectBranchStatement.title,
|
|
718
720
|
description: Cooperative$1.Registry.SelectBranchStatement.description,
|
|
719
|
-
model: Schema$
|
|
721
|
+
model: Schema$8,
|
|
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$8,
|
|
729
|
+
Template: Template$8,
|
|
730
|
+
registry_id: registry_id$8
|
|
729
731
|
};
|
|
730
732
|
|
|
731
|
-
const registry_id$
|
|
732
|
-
const Schema$
|
|
733
|
+
const registry_id$7 = Cooperative$1.Registry.ProjectFreeDecision.registry_id;
|
|
734
|
+
const Schema$7 = {
|
|
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$7 = {
|
|
768
770
|
title: Cooperative$1.Registry.ProjectFreeDecision.title,
|
|
769
771
|
description: Cooperative$1.Registry.ProjectFreeDecision.description,
|
|
770
|
-
model: Schema$
|
|
772
|
+
model: Schema$7,
|
|
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$7,
|
|
780
|
+
Template: Template$7,
|
|
781
|
+
registry_id: registry_id$7
|
|
780
782
|
};
|
|
781
783
|
|
|
782
|
-
const registry_id = Cooperative$1.Registry.FreeDecision.registry_id;
|
|
783
|
-
const Schema = {
|
|
784
|
+
const registry_id$6 = Cooperative$1.Registry.FreeDecision.registry_id;
|
|
785
|
+
const Schema$6 = {
|
|
784
786
|
type: "object",
|
|
785
787
|
properties: {
|
|
786
788
|
coop: {
|
|
@@ -816,20 +818,259 @@ 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$6 = {
|
|
825
829
|
title: Cooperative$1.Registry.FreeDecision.title,
|
|
826
830
|
description: Cooperative$1.Registry.FreeDecision.description,
|
|
827
|
-
model: Schema,
|
|
831
|
+
model: Schema$6,
|
|
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$6,
|
|
839
|
+
Template: Template$6,
|
|
840
|
+
registry_id: registry_id$6
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
const CommonRequestSchema = {
|
|
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: "string" },
|
|
851
|
+
total_cost: { type: "string" },
|
|
852
|
+
currency: { type: "string" },
|
|
853
|
+
type: { type: "string" },
|
|
854
|
+
program_id: { type: "number" }
|
|
855
|
+
},
|
|
856
|
+
required: [
|
|
857
|
+
"hash",
|
|
858
|
+
"title",
|
|
859
|
+
"unit_of_measurement",
|
|
860
|
+
"units",
|
|
861
|
+
"unit_cost",
|
|
862
|
+
"total_cost",
|
|
863
|
+
"currency",
|
|
864
|
+
"type",
|
|
865
|
+
"program_id"
|
|
866
|
+
],
|
|
867
|
+
additionalProperties: true
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
const CommonUserSchema = {
|
|
871
|
+
type: "object",
|
|
872
|
+
properties: {
|
|
873
|
+
full_name_or_short_name: { type: "string" },
|
|
874
|
+
birthdate_or_ogrn: { type: "string" }
|
|
875
|
+
},
|
|
876
|
+
required: ["full_name_or_short_name", "birthdate_or_ogrn"],
|
|
877
|
+
additionalProperties: true
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
const registry_id$5 = Cooperative$1.Registry.AssetContributionStatement.registry_id;
|
|
881
|
+
const Schema$5 = {
|
|
882
|
+
type: "object",
|
|
883
|
+
properties: {
|
|
884
|
+
meta: IMetaJSONSchema,
|
|
885
|
+
coop: CooperativeSchema,
|
|
886
|
+
vars: VarsSchema,
|
|
887
|
+
request: CommonRequestSchema,
|
|
888
|
+
user: CommonUserSchema
|
|
889
|
+
},
|
|
890
|
+
required: ["meta", "coop", "vars", "request", "user"],
|
|
891
|
+
additionalProperties: true
|
|
892
|
+
};
|
|
893
|
+
const Template$5 = {
|
|
894
|
+
title: Cooperative$1.Registry.AssetContributionStatement.title,
|
|
895
|
+
description: Cooperative$1.Registry.AssetContributionStatement.description,
|
|
896
|
+
model: Schema$5,
|
|
897
|
+
context: Cooperative$1.Registry.AssetContributionStatement.context,
|
|
898
|
+
translations: Cooperative$1.Registry.AssetContributionStatement.translations
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
const AssetContributionStatement = {
|
|
902
|
+
__proto__: null,
|
|
903
|
+
Schema: Schema$5,
|
|
904
|
+
Template: Template$5,
|
|
905
|
+
registry_id: registry_id$5
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
const registry_id$4 = Cooperative$1.Registry.ReturnByAssetStatement.registry_id;
|
|
909
|
+
const Schema$4 = {
|
|
910
|
+
type: "object",
|
|
911
|
+
properties: {
|
|
912
|
+
meta: IMetaJSONSchema,
|
|
913
|
+
coop: CooperativeSchema,
|
|
914
|
+
vars: VarsSchema,
|
|
915
|
+
request: CommonRequestSchema,
|
|
916
|
+
user: CommonUserSchema
|
|
917
|
+
},
|
|
918
|
+
required: ["meta", "coop", "vars", "request", "user"],
|
|
919
|
+
additionalProperties: true
|
|
920
|
+
};
|
|
921
|
+
const Template$4 = {
|
|
922
|
+
title: Cooperative$1.Registry.ReturnByAssetStatement.title,
|
|
923
|
+
description: Cooperative$1.Registry.ReturnByAssetStatement.description,
|
|
924
|
+
model: Schema$4,
|
|
925
|
+
context: Cooperative$1.Registry.ReturnByAssetStatement.context,
|
|
926
|
+
translations: Cooperative$1.Registry.ReturnByAssetStatement.translations
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
const ReturnByAssetStatement = {
|
|
930
|
+
__proto__: null,
|
|
931
|
+
Schema: Schema$4,
|
|
932
|
+
Template: Template$4,
|
|
933
|
+
registry_id: registry_id$4
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
const registry_id$3 = Cooperative$1.Registry.AssetContributionDecision.registry_id;
|
|
937
|
+
const Schema$3 = {
|
|
938
|
+
type: "object",
|
|
939
|
+
properties: {
|
|
940
|
+
meta: IMetaJSONSchema,
|
|
941
|
+
coop: CooperativeSchema,
|
|
942
|
+
vars: VarsSchema,
|
|
943
|
+
request: CommonRequestSchema,
|
|
944
|
+
user: CommonUserSchema,
|
|
945
|
+
decision: decisionSchema
|
|
946
|
+
},
|
|
947
|
+
required: ["meta", "coop", "vars", "request", "user", "decision"],
|
|
948
|
+
additionalProperties: true
|
|
949
|
+
};
|
|
950
|
+
const Template$3 = {
|
|
951
|
+
title: Cooperative$1.Registry.AssetContributionDecision.title,
|
|
952
|
+
description: Cooperative$1.Registry.AssetContributionDecision.description,
|
|
953
|
+
model: Schema$3,
|
|
954
|
+
context: Cooperative$1.Registry.AssetContributionDecision.context,
|
|
955
|
+
translations: Cooperative$1.Registry.AssetContributionDecision.translations
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
const AssetContributionDecision = {
|
|
959
|
+
__proto__: null,
|
|
960
|
+
Schema: Schema$3,
|
|
961
|
+
Template: Template$3,
|
|
962
|
+
registry_id: registry_id$3
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
const registry_id$2 = Cooperative$1.Registry.ReturnByAssetDecision.registry_id;
|
|
966
|
+
const Schema$2 = {
|
|
967
|
+
type: "object",
|
|
968
|
+
properties: {
|
|
969
|
+
meta: IMetaJSONSchema,
|
|
970
|
+
coop: CooperativeSchema,
|
|
971
|
+
vars: VarsSchema,
|
|
972
|
+
request: CommonRequestSchema,
|
|
973
|
+
user: CommonUserSchema,
|
|
974
|
+
decision: decisionSchema
|
|
975
|
+
},
|
|
976
|
+
required: ["meta", "coop", "vars", "request", "user", "decision"],
|
|
977
|
+
additionalProperties: true
|
|
978
|
+
};
|
|
979
|
+
const Template$2 = {
|
|
980
|
+
title: Cooperative$1.Registry.ReturnByAssetDecision.title,
|
|
981
|
+
description: Cooperative$1.Registry.ReturnByAssetDecision.description,
|
|
982
|
+
model: Schema$2,
|
|
983
|
+
context: Cooperative$1.Registry.ReturnByAssetDecision.context,
|
|
984
|
+
translations: Cooperative$1.Registry.ReturnByAssetDecision.translations
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
const ReturnByAssetDecision = {
|
|
988
|
+
__proto__: null,
|
|
989
|
+
Schema: Schema$2,
|
|
990
|
+
Template: Template$2,
|
|
991
|
+
registry_id: registry_id$2
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
const FirstLastMiddleNameSchema = {
|
|
995
|
+
type: "object",
|
|
996
|
+
properties: {
|
|
997
|
+
first_name: { type: "string" },
|
|
998
|
+
last_name: { type: "string" },
|
|
999
|
+
middle_name: { type: "string" }
|
|
1000
|
+
},
|
|
1001
|
+
required: ["first_name", "last_name", "middle_name"],
|
|
1002
|
+
additionalProperties: true
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
const CommonProgramSchema = {
|
|
1006
|
+
type: "object",
|
|
1007
|
+
properties: {
|
|
1008
|
+
name: { type: "string" }
|
|
1009
|
+
},
|
|
1010
|
+
required: ["name"],
|
|
1011
|
+
additionalProperties: true
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
const registry_id$1 = Cooperative$1.Registry.AssetContributionAct.registry_id;
|
|
1015
|
+
const Schema$1 = {
|
|
1016
|
+
type: "object",
|
|
1017
|
+
properties: {
|
|
1018
|
+
meta: IMetaJSONSchema,
|
|
1019
|
+
coop: CooperativeSchema,
|
|
1020
|
+
vars: VarsSchema,
|
|
1021
|
+
request: CommonRequestSchema,
|
|
1022
|
+
user: CommonUserSchema,
|
|
1023
|
+
decision: decisionSchema,
|
|
1024
|
+
act_id: { type: "string" },
|
|
1025
|
+
receiver: FirstLastMiddleNameSchema,
|
|
1026
|
+
program: CommonProgramSchema,
|
|
1027
|
+
branch: { ...organizationSchema, nullable: true }
|
|
1028
|
+
},
|
|
1029
|
+
required: ["meta", "coop", "vars", "request", "user", "decision", "act_id", "receiver", "program"],
|
|
1030
|
+
additionalProperties: true
|
|
1031
|
+
};
|
|
1032
|
+
const Template$1 = {
|
|
1033
|
+
title: Cooperative$1.Registry.AssetContributionAct.title,
|
|
1034
|
+
description: Cooperative$1.Registry.AssetContributionAct.description,
|
|
1035
|
+
model: Schema$1,
|
|
1036
|
+
context: Cooperative$1.Registry.AssetContributionAct.context,
|
|
1037
|
+
translations: Cooperative$1.Registry.AssetContributionAct.translations
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
const AssetContributionAct = {
|
|
1041
|
+
__proto__: null,
|
|
1042
|
+
Schema: Schema$1,
|
|
1043
|
+
Template: Template$1,
|
|
1044
|
+
registry_id: registry_id$1
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
const registry_id = Cooperative$1.Registry.ReturnByAssetAct.registry_id;
|
|
1048
|
+
const Schema = {
|
|
1049
|
+
type: "object",
|
|
1050
|
+
properties: {
|
|
1051
|
+
meta: IMetaJSONSchema,
|
|
1052
|
+
coop: CooperativeSchema,
|
|
1053
|
+
vars: VarsSchema,
|
|
1054
|
+
request: CommonRequestSchema,
|
|
1055
|
+
user: CommonUserSchema,
|
|
1056
|
+
decision: decisionSchema,
|
|
1057
|
+
act_id: { type: "string" },
|
|
1058
|
+
transmitter: FirstLastMiddleNameSchema,
|
|
1059
|
+
program: CommonProgramSchema,
|
|
1060
|
+
branch: { ...organizationSchema, nullable: true }
|
|
1061
|
+
},
|
|
1062
|
+
required: ["meta", "coop", "vars", "request", "user", "decision", "act_id", "transmitter", "program"],
|
|
1063
|
+
additionalProperties: true
|
|
1064
|
+
};
|
|
1065
|
+
const Template = {
|
|
1066
|
+
title: Cooperative$1.Registry.ReturnByAssetAct.title,
|
|
1067
|
+
description: Cooperative$1.Registry.ReturnByAssetAct.description,
|
|
1068
|
+
model: Schema,
|
|
1069
|
+
context: Cooperative$1.Registry.ReturnByAssetAct.context,
|
|
1070
|
+
translations: Cooperative$1.Registry.ReturnByAssetAct.translations
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
const ReturnByAssetAct = {
|
|
833
1074
|
__proto__: null,
|
|
834
1075
|
Schema: Schema,
|
|
835
1076
|
Template: Template,
|
|
@@ -846,7 +1087,13 @@ const Registry = {
|
|
|
846
1087
|
101: SelectBranchStatement,
|
|
847
1088
|
501: DecisionOfParticipantApplication,
|
|
848
1089
|
599: ProjectFreeDecision,
|
|
849
|
-
600: FreeDecision
|
|
1090
|
+
600: FreeDecision,
|
|
1091
|
+
700: AssetContributionStatement,
|
|
1092
|
+
701: AssetContributionDecision,
|
|
1093
|
+
702: AssetContributionAct,
|
|
1094
|
+
800: ReturnByAssetStatement,
|
|
1095
|
+
801: ReturnByAssetDecision,
|
|
1096
|
+
802: ReturnByAssetAct
|
|
850
1097
|
};
|
|
851
1098
|
|
|
852
1099
|
var __defProp$c = Object.defineProperty;
|
|
@@ -1467,7 +1714,7 @@ class PDFService {
|
|
|
1467
1714
|
|
|
1468
1715
|
const name = "@coopenomics/factory";
|
|
1469
1716
|
const type = "module";
|
|
1470
|
-
const version = "2.2.
|
|
1717
|
+
const version = "2.2.7";
|
|
1471
1718
|
const packageManager = "pnpm@9.0.6";
|
|
1472
1719
|
const description = "";
|
|
1473
1720
|
const author = "Alex Ant <chairman.voskhod@gmail.com>";
|
|
@@ -1516,7 +1763,7 @@ const dependencies = {
|
|
|
1516
1763
|
"ajv-formats": "^3.0.1",
|
|
1517
1764
|
"ajv-i18n": "^4.2.0",
|
|
1518
1765
|
axios: "^1.7.2",
|
|
1519
|
-
cooptypes: "2.2.
|
|
1766
|
+
cooptypes: "2.2.7",
|
|
1520
1767
|
dotenv: "^16.4.5",
|
|
1521
1768
|
"eosjs-ecc": "^4.0.7",
|
|
1522
1769
|
handlebars: "^4.7.8",
|
|
@@ -1558,7 +1805,7 @@ const pnpm = {
|
|
|
1558
1805
|
"vite@>=5.1.0 <=5.1.6": ">=5.1.7"
|
|
1559
1806
|
}
|
|
1560
1807
|
};
|
|
1561
|
-
const gitHead = "
|
|
1808
|
+
const gitHead = "3be56ba462561e4dd9e7225bb95b254b20f89042";
|
|
1562
1809
|
const packageJson = {
|
|
1563
1810
|
name: name,
|
|
1564
1811
|
type: type,
|
|
@@ -1663,6 +1910,24 @@ class DocFactory {
|
|
|
1663
1910
|
throw new Error("\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B");
|
|
1664
1911
|
return vars;
|
|
1665
1912
|
}
|
|
1913
|
+
async getRequest(_request_id, _block_num) {
|
|
1914
|
+
return {
|
|
1915
|
+
hash: "1234567890",
|
|
1916
|
+
title: "\u041C\u043E\u043B\u043E\u043A\u043E \u0411\u0443\u0440\u0451\u043D\u043A\u0430",
|
|
1917
|
+
unit_of_measurement: "\u043B\u0438\u0442\u0440\u044B",
|
|
1918
|
+
units: 100,
|
|
1919
|
+
unit_cost: "1000",
|
|
1920
|
+
total_cost: "100000",
|
|
1921
|
+
currency: "RUB",
|
|
1922
|
+
type: "receive",
|
|
1923
|
+
program_id: 1
|
|
1924
|
+
};
|
|
1925
|
+
}
|
|
1926
|
+
async getProgram(_program_id) {
|
|
1927
|
+
return {
|
|
1928
|
+
name: "\u0421\u041E\u0421\u0415\u0414\u0418"
|
|
1929
|
+
};
|
|
1930
|
+
}
|
|
1666
1931
|
async getDecision(coop, coopname, decision_id, created_at) {
|
|
1667
1932
|
const votes_for_actions = (await getFetch(`${getEnvVar("SIMPLE_EXPLORER_API")}/get-actions`, new URLSearchParams({
|
|
1668
1933
|
filter: JSON.stringify({
|
|
@@ -1769,6 +2034,28 @@ class DocFactory {
|
|
|
1769
2034
|
}
|
|
1770
2035
|
return "";
|
|
1771
2036
|
}
|
|
2037
|
+
getFullParticipantName(data) {
|
|
2038
|
+
if ("first_name" in data) {
|
|
2039
|
+
return `${data.last_name} ${data.first_name} ${data.middle_name}`;
|
|
2040
|
+
} else if ("short_name" in data) {
|
|
2041
|
+
return data.short_name;
|
|
2042
|
+
}
|
|
2043
|
+
return "";
|
|
2044
|
+
}
|
|
2045
|
+
getFirstLastMiddleName(data) {
|
|
2046
|
+
return {
|
|
2047
|
+
first_name: "first_name" in data ? data.first_name : "",
|
|
2048
|
+
last_name: "last_name" in data ? data.last_name : "",
|
|
2049
|
+
middle_name: "middle_name" in data ? data.middle_name : ""
|
|
2050
|
+
};
|
|
2051
|
+
}
|
|
2052
|
+
getCommonUser(data) {
|
|
2053
|
+
return {
|
|
2054
|
+
full_name_or_short_name: this.getFullParticipantName(data),
|
|
2055
|
+
// or_short_name
|
|
2056
|
+
birthdate_or_ogrn: "birthdate" in data ? data.birthdate : "details" in data ? data.details.ogrn : ""
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
1772
2059
|
async saveDraft(document) {
|
|
1773
2060
|
await this.storage.saveDraft(document);
|
|
1774
2061
|
}
|
|
@@ -1816,16 +2103,16 @@ class DocFactory {
|
|
|
1816
2103
|
}
|
|
1817
2104
|
}
|
|
1818
2105
|
|
|
1819
|
-
let Factory$
|
|
2106
|
+
let Factory$f = class Factory extends DocFactory {
|
|
1820
2107
|
constructor(storage) {
|
|
1821
2108
|
super(storage);
|
|
1822
2109
|
}
|
|
1823
2110
|
async generateDocument(data, options) {
|
|
1824
2111
|
let template;
|
|
1825
2112
|
if (process.env.SOURCE === "local") {
|
|
1826
|
-
template = Template$
|
|
2113
|
+
template = Template$f;
|
|
1827
2114
|
} else {
|
|
1828
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2115
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$f, data.block_num);
|
|
1829
2116
|
}
|
|
1830
2117
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1831
2118
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1843,16 +2130,16 @@ let Factory$9 = class Factory extends DocFactory {
|
|
|
1843
2130
|
}
|
|
1844
2131
|
};
|
|
1845
2132
|
|
|
1846
|
-
let Factory$
|
|
2133
|
+
let Factory$e = class Factory extends DocFactory {
|
|
1847
2134
|
constructor(storage) {
|
|
1848
2135
|
super(storage);
|
|
1849
2136
|
}
|
|
1850
2137
|
async generateDocument(data, options) {
|
|
1851
2138
|
let template;
|
|
1852
2139
|
if (process.env.SOURCE === "local") {
|
|
1853
|
-
template = Template$
|
|
2140
|
+
template = Template$e;
|
|
1854
2141
|
} else {
|
|
1855
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2142
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$e, data.block_num);
|
|
1856
2143
|
}
|
|
1857
2144
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1858
2145
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1870,16 +2157,16 @@ let Factory$8 = class Factory extends DocFactory {
|
|
|
1870
2157
|
}
|
|
1871
2158
|
};
|
|
1872
2159
|
|
|
1873
|
-
let Factory$
|
|
2160
|
+
let Factory$d = class Factory extends DocFactory {
|
|
1874
2161
|
constructor(storage) {
|
|
1875
2162
|
super(storage);
|
|
1876
2163
|
}
|
|
1877
2164
|
async generateDocument(data, options) {
|
|
1878
2165
|
let template;
|
|
1879
2166
|
if (process.env.SOURCE === "local") {
|
|
1880
|
-
template = Template$
|
|
2167
|
+
template = Template$d;
|
|
1881
2168
|
} else {
|
|
1882
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2169
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$d, data.block_num);
|
|
1883
2170
|
}
|
|
1884
2171
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1885
2172
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1897,16 +2184,16 @@ let Factory$7 = class Factory extends DocFactory {
|
|
|
1897
2184
|
}
|
|
1898
2185
|
};
|
|
1899
2186
|
|
|
1900
|
-
let Factory$
|
|
2187
|
+
let Factory$c = class Factory extends DocFactory {
|
|
1901
2188
|
constructor(storage) {
|
|
1902
2189
|
super(storage);
|
|
1903
2190
|
}
|
|
1904
2191
|
async generateDocument(data, options) {
|
|
1905
2192
|
let template;
|
|
1906
2193
|
if (process.env.SOURCE === "local") {
|
|
1907
|
-
template = Template$
|
|
2194
|
+
template = Template$c;
|
|
1908
2195
|
} else {
|
|
1909
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2196
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$c, data.block_num);
|
|
1910
2197
|
}
|
|
1911
2198
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1912
2199
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1928,16 +2215,16 @@ let Factory$6 = class Factory extends DocFactory {
|
|
|
1928
2215
|
}
|
|
1929
2216
|
};
|
|
1930
2217
|
|
|
1931
|
-
let Factory$
|
|
2218
|
+
let Factory$b = class Factory extends DocFactory {
|
|
1932
2219
|
constructor(storage) {
|
|
1933
2220
|
super(storage);
|
|
1934
2221
|
}
|
|
1935
2222
|
async generateDocument(data, options) {
|
|
1936
2223
|
let template;
|
|
1937
2224
|
if (process.env.SOURCE === "local") {
|
|
1938
|
-
template = Template$
|
|
2225
|
+
template = Template$b;
|
|
1939
2226
|
} else {
|
|
1940
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2227
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$b, data.block_num);
|
|
1941
2228
|
}
|
|
1942
2229
|
const meta = await super.getMeta({ title: template.title, ...data });
|
|
1943
2230
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
@@ -1957,16 +2244,16 @@ let Factory$5 = class Factory extends DocFactory {
|
|
|
1957
2244
|
}
|
|
1958
2245
|
};
|
|
1959
2246
|
|
|
1960
|
-
let Factory$
|
|
2247
|
+
let Factory$a = class Factory extends DocFactory {
|
|
1961
2248
|
constructor(storage) {
|
|
1962
2249
|
super(storage);
|
|
1963
2250
|
}
|
|
1964
2251
|
async generateDocument(data, _options) {
|
|
1965
2252
|
let template;
|
|
1966
2253
|
if (process.env.SOURCE === "local") {
|
|
1967
|
-
template = Template$
|
|
2254
|
+
template = Template$8;
|
|
1968
2255
|
} else {
|
|
1969
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2256
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$8, data.block_num);
|
|
1970
2257
|
}
|
|
1971
2258
|
const user = await super.getUser(data.username, data.block_num);
|
|
1972
2259
|
const userData = {
|
|
@@ -1988,16 +2275,16 @@ let Factory$4 = class Factory extends DocFactory {
|
|
|
1988
2275
|
}
|
|
1989
2276
|
};
|
|
1990
2277
|
|
|
1991
|
-
let Factory$
|
|
2278
|
+
let Factory$9 = class Factory extends DocFactory {
|
|
1992
2279
|
constructor(storage) {
|
|
1993
2280
|
super(storage);
|
|
1994
2281
|
}
|
|
1995
2282
|
async generateDocument(data, _options) {
|
|
1996
2283
|
let template;
|
|
1997
2284
|
if (process.env.SOURCE === "local") {
|
|
1998
|
-
template = Template$
|
|
2285
|
+
template = Template$a;
|
|
1999
2286
|
} else {
|
|
2000
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2287
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$a, data.block_num);
|
|
2001
2288
|
}
|
|
2002
2289
|
const user = await super.getUser(data.username, data.block_num);
|
|
2003
2290
|
let bank_account = {};
|
|
@@ -2010,6 +2297,8 @@ let Factory$3 = class Factory extends DocFactory {
|
|
|
2010
2297
|
}
|
|
2011
2298
|
};
|
|
2012
2299
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
2300
|
+
const coop_bank_account = await super.getBankAccount(data.coopname, data.block_num);
|
|
2301
|
+
const extended_coop = { ...coop, bank_account: coop_bank_account };
|
|
2013
2302
|
if (coop.is_branched && !data.braname)
|
|
2014
2303
|
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
2304
|
let branch;
|
|
@@ -2037,7 +2326,7 @@ let Factory$3 = class Factory extends DocFactory {
|
|
|
2037
2326
|
}
|
|
2038
2327
|
}
|
|
2039
2328
|
const vars = await super.getVars(data.coopname, data.block_num);
|
|
2040
|
-
const combinedData = { ...userData, meta, coop, branch, type: user.type, vars, signature };
|
|
2329
|
+
const combinedData = { ...userData, meta, coop: extended_coop, branch, type: user.type, vars, signature };
|
|
2041
2330
|
await super.validate(combinedData, template.model);
|
|
2042
2331
|
const translation = template.translations[meta.lang];
|
|
2043
2332
|
const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, data.skip_save);
|
|
@@ -2045,22 +2334,23 @@ let Factory$3 = class Factory extends DocFactory {
|
|
|
2045
2334
|
}
|
|
2046
2335
|
};
|
|
2047
2336
|
|
|
2048
|
-
let Factory$
|
|
2337
|
+
let Factory$8 = class Factory extends DocFactory {
|
|
2049
2338
|
constructor(storage) {
|
|
2050
2339
|
super(storage);
|
|
2051
2340
|
}
|
|
2052
2341
|
async generateDocument(data, options) {
|
|
2053
2342
|
let template;
|
|
2054
2343
|
if (process.env.SOURCE === "local") {
|
|
2055
|
-
template = Template$
|
|
2344
|
+
template = Template$9;
|
|
2056
2345
|
} else {
|
|
2057
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2346
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$9, data.block_num);
|
|
2058
2347
|
}
|
|
2059
2348
|
const user = await super.getUser(data.username, data.block_num);
|
|
2060
2349
|
const userData = {
|
|
2061
2350
|
[user.type]: user.data
|
|
2062
2351
|
};
|
|
2063
2352
|
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
2353
|
+
const vars = await super.getVars(data.coopname, data.block_num);
|
|
2064
2354
|
const meta = await super.getMeta({
|
|
2065
2355
|
title: template.title,
|
|
2066
2356
|
...data
|
|
@@ -2073,6 +2363,7 @@ let Factory$2 = class Factory extends DocFactory {
|
|
|
2073
2363
|
);
|
|
2074
2364
|
const combinedData = {
|
|
2075
2365
|
...userData,
|
|
2366
|
+
vars,
|
|
2076
2367
|
meta,
|
|
2077
2368
|
coop,
|
|
2078
2369
|
type: user.type,
|
|
@@ -2092,16 +2383,16 @@ let Factory$2 = class Factory extends DocFactory {
|
|
|
2092
2383
|
}
|
|
2093
2384
|
};
|
|
2094
2385
|
|
|
2095
|
-
let Factory$
|
|
2386
|
+
let Factory$7 = class Factory extends DocFactory {
|
|
2096
2387
|
constructor(storage) {
|
|
2097
2388
|
super(storage);
|
|
2098
2389
|
}
|
|
2099
2390
|
async generateDocument(data, options) {
|
|
2100
2391
|
let template;
|
|
2101
2392
|
if (process.env.SOURCE === "local") {
|
|
2102
|
-
template = Template$
|
|
2393
|
+
template = Template$7;
|
|
2103
2394
|
} else {
|
|
2104
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id$
|
|
2395
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$7, data.block_num);
|
|
2105
2396
|
}
|
|
2106
2397
|
const user = await this.getUser(data.username, data.block_num);
|
|
2107
2398
|
const suggester_name = await this.getFullName(user.data);
|
|
@@ -2137,16 +2428,16 @@ let Factory$1 = class Factory extends DocFactory {
|
|
|
2137
2428
|
}
|
|
2138
2429
|
};
|
|
2139
2430
|
|
|
2140
|
-
class Factory extends DocFactory {
|
|
2431
|
+
let Factory$6 = class Factory extends DocFactory {
|
|
2141
2432
|
constructor(storage) {
|
|
2142
2433
|
super(storage);
|
|
2143
2434
|
}
|
|
2144
2435
|
async generateDocument(data, options) {
|
|
2145
2436
|
let template;
|
|
2146
2437
|
if (process.env.SOURCE === "local") {
|
|
2147
|
-
template = Template;
|
|
2438
|
+
template = Template$6;
|
|
2148
2439
|
} else {
|
|
2149
|
-
template = await this.getTemplate(DraftContract.contractName.production, registry_id, data.block_num);
|
|
2440
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$6, data.block_num);
|
|
2150
2441
|
}
|
|
2151
2442
|
const user = await this.getUser(data.username, data.block_num);
|
|
2152
2443
|
const userData = {
|
|
@@ -2166,13 +2457,14 @@ class Factory extends DocFactory {
|
|
|
2166
2457
|
if (!data.project_id)
|
|
2167
2458
|
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
2459
|
const project = await this.getProject(data.project_id, data.block_num);
|
|
2169
|
-
|
|
2460
|
+
const vars = await super.getVars(data.coopname, data.block_num);
|
|
2170
2461
|
const combinedData = {
|
|
2171
2462
|
...userData,
|
|
2172
2463
|
meta,
|
|
2173
2464
|
coop,
|
|
2174
2465
|
decision,
|
|
2175
|
-
project
|
|
2466
|
+
project,
|
|
2467
|
+
vars
|
|
2176
2468
|
};
|
|
2177
2469
|
await this.validate(combinedData, template.model);
|
|
2178
2470
|
const translation = template.translations[meta.lang];
|
|
@@ -2186,6 +2478,222 @@ class Factory extends DocFactory {
|
|
|
2186
2478
|
);
|
|
2187
2479
|
return document;
|
|
2188
2480
|
}
|
|
2481
|
+
};
|
|
2482
|
+
|
|
2483
|
+
let Factory$5 = class Factory extends DocFactory {
|
|
2484
|
+
constructor(storage) {
|
|
2485
|
+
super(storage);
|
|
2486
|
+
}
|
|
2487
|
+
async generateDocument(data, options) {
|
|
2488
|
+
let template;
|
|
2489
|
+
if (process.env.SOURCE === "local") {
|
|
2490
|
+
template = Template$5;
|
|
2491
|
+
} else {
|
|
2492
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$5, data.block_num);
|
|
2493
|
+
}
|
|
2494
|
+
const meta = await super.getMeta({ title: template.title, ...data });
|
|
2495
|
+
const coop = await super.getCooperative(data.coopname, data.block_num);
|
|
2496
|
+
const vars = await super.getVars(data.coopname, data.block_num);
|
|
2497
|
+
const user = await super.getUser(data.username, data.block_num);
|
|
2498
|
+
const request = data.request;
|
|
2499
|
+
const commonUser = this.getCommonUser(user.data);
|
|
2500
|
+
const combinedData = {
|
|
2501
|
+
meta,
|
|
2502
|
+
coop,
|
|
2503
|
+
vars,
|
|
2504
|
+
user: commonUser,
|
|
2505
|
+
request
|
|
2506
|
+
};
|
|
2507
|
+
await super.validate(combinedData, template.model);
|
|
2508
|
+
const translation = template.translations[meta.lang];
|
|
2509
|
+
const document = await super.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
|
|
2510
|
+
return document;
|
|
2511
|
+
}
|
|
2512
|
+
};
|
|
2513
|
+
|
|
2514
|
+
let Factory$4 = class Factory extends DocFactory {
|
|
2515
|
+
constructor(storage) {
|
|
2516
|
+
super(storage);
|
|
2517
|
+
}
|
|
2518
|
+
async generateDocument(data, options) {
|
|
2519
|
+
let template;
|
|
2520
|
+
if (process.env.SOURCE === "local") {
|
|
2521
|
+
template = Template$4;
|
|
2522
|
+
} else {
|
|
2523
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$4, data.block_num);
|
|
2524
|
+
}
|
|
2525
|
+
const meta = await this.getMeta({ title: template.title, ...data });
|
|
2526
|
+
const coop = await this.getCooperative(data.coopname, data.block_num);
|
|
2527
|
+
const vars = await this.getVars(data.coopname, data.block_num);
|
|
2528
|
+
const user = await this.getUser(data.username, data.block_num);
|
|
2529
|
+
const request = data.request;
|
|
2530
|
+
const commonUser = this.getCommonUser(user.data);
|
|
2531
|
+
const combinedData = {
|
|
2532
|
+
meta,
|
|
2533
|
+
coop,
|
|
2534
|
+
vars,
|
|
2535
|
+
user: commonUser,
|
|
2536
|
+
request
|
|
2537
|
+
};
|
|
2538
|
+
await this.validate(combinedData, template.model);
|
|
2539
|
+
const translation = template.translations[meta.lang];
|
|
2540
|
+
const document = await super.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
|
|
2541
|
+
return document;
|
|
2542
|
+
}
|
|
2543
|
+
};
|
|
2544
|
+
|
|
2545
|
+
let Factory$3 = class Factory extends DocFactory {
|
|
2546
|
+
constructor(storage) {
|
|
2547
|
+
super(storage);
|
|
2548
|
+
}
|
|
2549
|
+
async generateDocument(data, options) {
|
|
2550
|
+
let template;
|
|
2551
|
+
if (process.env.SOURCE === "local") {
|
|
2552
|
+
template = Template$3;
|
|
2553
|
+
} else {
|
|
2554
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$3, data.block_num);
|
|
2555
|
+
}
|
|
2556
|
+
const meta = await this.getMeta({ title: template.title, ...data });
|
|
2557
|
+
const coop = await this.getCooperative(data.coopname, data.block_num);
|
|
2558
|
+
const vars = await this.getVars(data.coopname, data.block_num);
|
|
2559
|
+
const user = await this.getUser(data.username, data.block_num);
|
|
2560
|
+
const request = await this.getRequest(data.request_id, data.block_num);
|
|
2561
|
+
const decision = await this.getDecision(coop, data.coopname, data.decision_id, meta.created_at);
|
|
2562
|
+
const commonUser = this.getCommonUser(user.data);
|
|
2563
|
+
const combinedData = {
|
|
2564
|
+
meta,
|
|
2565
|
+
coop,
|
|
2566
|
+
vars,
|
|
2567
|
+
user: commonUser,
|
|
2568
|
+
request,
|
|
2569
|
+
decision
|
|
2570
|
+
};
|
|
2571
|
+
await this.validate(combinedData, template.model);
|
|
2572
|
+
const translation = template.translations[meta.lang];
|
|
2573
|
+
const document = await this.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
|
|
2574
|
+
return document;
|
|
2575
|
+
}
|
|
2576
|
+
};
|
|
2577
|
+
|
|
2578
|
+
let Factory$2 = class Factory extends DocFactory {
|
|
2579
|
+
constructor(storage) {
|
|
2580
|
+
super(storage);
|
|
2581
|
+
}
|
|
2582
|
+
async generateDocument(data, options) {
|
|
2583
|
+
let template;
|
|
2584
|
+
if (process.env.SOURCE === "local") {
|
|
2585
|
+
template = Template$1;
|
|
2586
|
+
} else {
|
|
2587
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$1, data.block_num);
|
|
2588
|
+
}
|
|
2589
|
+
const meta = await this.getMeta({ title: template.title, ...data });
|
|
2590
|
+
const coop = await this.getCooperative(data.coopname, data.block_num);
|
|
2591
|
+
const vars = await this.getVars(data.coopname, data.block_num);
|
|
2592
|
+
const user = await this.getUser(data.username, data.block_num);
|
|
2593
|
+
const request = await this.getRequest(data.request_id, data.block_num);
|
|
2594
|
+
const decision = await this.getDecision(coop, data.coopname, data.decision_id, meta.created_at);
|
|
2595
|
+
const commonUser = this.getCommonUser(user.data);
|
|
2596
|
+
const receiver = await this.getUser(data.receiver, data.block_num);
|
|
2597
|
+
if (coop.is_branched && !data.braname)
|
|
2598
|
+
throw new Error("Branch name is required");
|
|
2599
|
+
let branch;
|
|
2600
|
+
if (data.braname)
|
|
2601
|
+
branch = await this.getOrganization(data.braname, data.block_num);
|
|
2602
|
+
const program = await this.getProgram(request.program_id);
|
|
2603
|
+
const combinedData = {
|
|
2604
|
+
meta,
|
|
2605
|
+
coop,
|
|
2606
|
+
vars,
|
|
2607
|
+
user: commonUser,
|
|
2608
|
+
request,
|
|
2609
|
+
decision,
|
|
2610
|
+
program,
|
|
2611
|
+
act_id: data.act_id,
|
|
2612
|
+
receiver: this.getFirstLastMiddleName(receiver.data),
|
|
2613
|
+
branch
|
|
2614
|
+
};
|
|
2615
|
+
await this.validate(combinedData, template.model);
|
|
2616
|
+
const translation = template.translations[meta.lang];
|
|
2617
|
+
const document = await this.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
|
|
2618
|
+
return document;
|
|
2619
|
+
}
|
|
2620
|
+
};
|
|
2621
|
+
|
|
2622
|
+
let Factory$1 = class Factory extends DocFactory {
|
|
2623
|
+
constructor(storage) {
|
|
2624
|
+
super(storage);
|
|
2625
|
+
}
|
|
2626
|
+
async generateDocument(data, options) {
|
|
2627
|
+
let template;
|
|
2628
|
+
if (process.env.SOURCE === "local") {
|
|
2629
|
+
template = Template$2;
|
|
2630
|
+
} else {
|
|
2631
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id$2, data.block_num);
|
|
2632
|
+
}
|
|
2633
|
+
const meta = await this.getMeta({ title: template.title, ...data });
|
|
2634
|
+
const coop = await this.getCooperative(data.coopname, data.block_num);
|
|
2635
|
+
const vars = await this.getVars(data.coopname, data.block_num);
|
|
2636
|
+
const user = await this.getUser(data.username, data.block_num);
|
|
2637
|
+
const request = await this.getRequest(data.request_id, data.block_num);
|
|
2638
|
+
const decision = await this.getDecision(coop, data.coopname, data.decision_id, meta.created_at);
|
|
2639
|
+
const commonUser = this.getCommonUser(user.data);
|
|
2640
|
+
const combinedData = {
|
|
2641
|
+
meta,
|
|
2642
|
+
coop,
|
|
2643
|
+
vars,
|
|
2644
|
+
user: commonUser,
|
|
2645
|
+
request,
|
|
2646
|
+
decision
|
|
2647
|
+
};
|
|
2648
|
+
await this.validate(combinedData, template.model);
|
|
2649
|
+
const translation = template.translations[meta.lang];
|
|
2650
|
+
const document = await this.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
|
|
2651
|
+
return document;
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
|
|
2655
|
+
class Factory extends DocFactory {
|
|
2656
|
+
constructor(storage) {
|
|
2657
|
+
super(storage);
|
|
2658
|
+
}
|
|
2659
|
+
async generateDocument(data, options) {
|
|
2660
|
+
let template;
|
|
2661
|
+
if (process.env.SOURCE === "local") {
|
|
2662
|
+
template = Template;
|
|
2663
|
+
} else {
|
|
2664
|
+
template = await this.getTemplate(DraftContract.contractName.production, registry_id, data.block_num);
|
|
2665
|
+
}
|
|
2666
|
+
const meta = await this.getMeta({ title: template.title, ...data });
|
|
2667
|
+
const coop = await this.getCooperative(data.coopname, data.block_num);
|
|
2668
|
+
const vars = await this.getVars(data.coopname, data.block_num);
|
|
2669
|
+
const user = await this.getUser(data.username, data.block_num);
|
|
2670
|
+
const request = await this.getRequest(data.request_id, data.block_num);
|
|
2671
|
+
const decision = await this.getDecision(coop, data.coopname, data.decision_id, meta.created_at);
|
|
2672
|
+
const commonUser = this.getCommonUser(user.data);
|
|
2673
|
+
const transmitter = await this.getUser(data.transmitter, data.block_num);
|
|
2674
|
+
if (coop.is_branched && !data.braname)
|
|
2675
|
+
throw new Error("Branch name is required");
|
|
2676
|
+
let branch;
|
|
2677
|
+
if (data.braname)
|
|
2678
|
+
branch = await this.getOrganization(data.braname, data.block_num);
|
|
2679
|
+
const program = await this.getProgram(request.program_id);
|
|
2680
|
+
const combinedData = {
|
|
2681
|
+
meta,
|
|
2682
|
+
coop,
|
|
2683
|
+
vars,
|
|
2684
|
+
user: commonUser,
|
|
2685
|
+
request,
|
|
2686
|
+
decision,
|
|
2687
|
+
program,
|
|
2688
|
+
act_id: data.act_id,
|
|
2689
|
+
transmitter: this.getFirstLastMiddleName(transmitter.data),
|
|
2690
|
+
branch
|
|
2691
|
+
};
|
|
2692
|
+
await this.validate(combinedData, template.model);
|
|
2693
|
+
const translation = template.translations[meta.lang];
|
|
2694
|
+
const document = await this.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
|
|
2695
|
+
return document;
|
|
2696
|
+
}
|
|
2189
2697
|
}
|
|
2190
2698
|
|
|
2191
2699
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -2250,26 +2758,38 @@ class Generator {
|
|
|
2250
2758
|
async connect(mongoUri) {
|
|
2251
2759
|
this.storage = new MongoDBConnector(mongoUri);
|
|
2252
2760
|
this.factories = {
|
|
2253
|
-
[registry_id$
|
|
2761
|
+
[registry_id$f]: new Factory$f(this.storage),
|
|
2254
2762
|
// 1
|
|
2255
|
-
[registry_id$
|
|
2763
|
+
[registry_id$e]: new Factory$e(this.storage),
|
|
2256
2764
|
// 2
|
|
2257
|
-
[registry_id$
|
|
2765
|
+
[registry_id$d]: new Factory$d(this.storage),
|
|
2258
2766
|
// 3
|
|
2259
|
-
[registry_id$
|
|
2767
|
+
[registry_id$c]: new Factory$c(this.storage),
|
|
2260
2768
|
// 4
|
|
2261
|
-
[registry_id$
|
|
2769
|
+
[registry_id$b]: new Factory$b(this.storage),
|
|
2262
2770
|
// 50
|
|
2263
|
-
[registry_id$
|
|
2771
|
+
[registry_id$a]: new Factory$9(this.storage),
|
|
2264
2772
|
// 100
|
|
2265
|
-
[registry_id$
|
|
2773
|
+
[registry_id$8]: new Factory$a(this.storage),
|
|
2266
2774
|
// 101
|
|
2267
|
-
[registry_id$
|
|
2775
|
+
[registry_id$9]: new Factory$8(this.storage),
|
|
2268
2776
|
// 501
|
|
2269
|
-
[registry_id$
|
|
2777
|
+
[registry_id$7]: new Factory$7(this.storage),
|
|
2270
2778
|
// 599
|
|
2271
|
-
[registry_id]: new Factory(this.storage)
|
|
2779
|
+
[registry_id$6]: new Factory$6(this.storage),
|
|
2272
2780
|
// 600
|
|
2781
|
+
[registry_id$5]: new Factory$5(this.storage),
|
|
2782
|
+
// 700
|
|
2783
|
+
[registry_id$4]: new Factory$4(this.storage),
|
|
2784
|
+
// 800
|
|
2785
|
+
[registry_id$2]: new Factory$1(this.storage),
|
|
2786
|
+
// 801
|
|
2787
|
+
[registry_id]: new Factory(this.storage),
|
|
2788
|
+
// 802
|
|
2789
|
+
[registry_id$3]: new Factory$3(this.storage),
|
|
2790
|
+
// 701
|
|
2791
|
+
[registry_id$1]: new Factory$2(this.storage)
|
|
2792
|
+
// 702
|
|
2273
2793
|
};
|
|
2274
2794
|
await this.storage.connect();
|
|
2275
2795
|
}
|
|
@@ -2334,4 +2854,4 @@ class Generator {
|
|
|
2334
2854
|
}
|
|
2335
2855
|
}
|
|
2336
2856
|
|
|
2337
|
-
export { BankAccountSchema, CoopenomicsAgreement, CooperativeSchema, DecisionOfParticipantApplication, FreeDecision, Generator, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, SelectBranchStatement, UserAgreement, VarsSchema, WalletAgreement, decisionSchema, entrepreneurSchema, individualSchema, organizationSchema, paymentMethodSchema };
|
|
2857
|
+
export { AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, CoopenomicsAgreement, CooperativeSchema, DecisionOfParticipantApplication, FreeDecision, Generator, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, SelectBranchStatement, UserAgreement, VarsSchema, WalletAgreement, decisionSchema, entrepreneurSchema, individualSchema, organizationSchema, paymentMethodSchema };
|