@umbraco/playwright-testhelpers 15.0.13 → 15.0.15
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/lib/helpers/ConstantHelper.d.ts +7 -0
- package/dist/lib/helpers/ConstantHelper.js +7 -0
- package/dist/lib/helpers/ConstantHelper.js.map +1 -1
- package/dist/lib/helpers/ContentUiHelper.d.ts +29 -0
- package/dist/lib/helpers/ContentUiHelper.js +102 -3
- package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeApiHelper.d.ts +1 -0
- package/dist/lib/helpers/DataTypeApiHelper.js +11 -0
- package/dist/lib/helpers/DataTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentApiHelper.d.ts +10 -0
- package/dist/lib/helpers/DocumentApiHelper.js +448 -0
- package/dist/lib/helpers/DocumentApiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeApiHelper.d.ts +1 -0
- package/dist/lib/helpers/DocumentTypeApiHelper.js +34 -0
- package/dist/lib/helpers/DocumentTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/FormsUiHelper.d.ts +0 -1
- package/dist/lib/helpers/FormsUiHelper.js +1 -3
- package/dist/lib/helpers/FormsUiHelper.js.map +1 -1
- package/dist/lib/helpers/UiBaseLocators.d.ts +2 -0
- package/dist/lib/helpers/UiBaseLocators.js +4 -0
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -665,6 +665,208 @@ class DocumentApiHelper {
|
|
|
665
665
|
.build();
|
|
666
666
|
return await this.create(document);
|
|
667
667
|
}
|
|
668
|
+
async createDefaultDocumentWithABlockGridEditorAndBlockWithValue(documentName, documentTypeName, blockGridDataTypeName, elementTypeId, elementTypePropertyAlias, elementTypePropertyValue, elementTypePropertyEditorAlias, groupName = 'TestGroup') {
|
|
669
|
+
const crypto = require('crypto');
|
|
670
|
+
const blockContentKey = crypto.randomUUID();
|
|
671
|
+
const blockGridDataTypeId = await this.api.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridDataTypeName, elementTypeId, true) || '';
|
|
672
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridDataTypeName, blockGridDataTypeId, groupName) || '';
|
|
673
|
+
await this.ensureNameNotExists(documentName);
|
|
674
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
675
|
+
.withDocumentTypeId(documentTypeId)
|
|
676
|
+
.addVariant()
|
|
677
|
+
.withName(documentName)
|
|
678
|
+
.done()
|
|
679
|
+
.addValue()
|
|
680
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockGridDataTypeName))
|
|
681
|
+
.addBlockGridValue()
|
|
682
|
+
.addContentData()
|
|
683
|
+
.withContentTypeKey(elementTypeId)
|
|
684
|
+
.withKey(blockContentKey)
|
|
685
|
+
.addContentDataValue()
|
|
686
|
+
.withAlias(elementTypePropertyAlias)
|
|
687
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
688
|
+
.withValue(elementTypePropertyValue)
|
|
689
|
+
.done()
|
|
690
|
+
.done()
|
|
691
|
+
.addExpose()
|
|
692
|
+
.withContentKey(blockContentKey)
|
|
693
|
+
.done()
|
|
694
|
+
.addLayout()
|
|
695
|
+
.withContentKey(blockContentKey)
|
|
696
|
+
.done()
|
|
697
|
+
.done()
|
|
698
|
+
.done()
|
|
699
|
+
.build();
|
|
700
|
+
return await this.create(document);
|
|
701
|
+
}
|
|
702
|
+
async createDefaultDocumentWithABlockGridEditorAndBlockWithValueAndTwoGroups(documentName, documentTypeName, blockGridDataTypeName, elementTypeId, elementTypePropertyAlias, elementTypePropertyValue, elementTypePropertyEditorAlias, groupName = 'TestGroup', secondPropertyName, secondGroupName = 'GroupTwoName') {
|
|
703
|
+
const crypto = require('crypto');
|
|
704
|
+
const blockContentKey = crypto.randomUUID();
|
|
705
|
+
const blockGridDataTypeId = await this.api.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridDataTypeName, elementTypeId, true) || '';
|
|
706
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditorAndTwoGroups(documentTypeName, blockGridDataTypeName, blockGridDataTypeId, groupName, secondPropertyName, blockGridDataTypeId, secondGroupName) || '';
|
|
707
|
+
await this.ensureNameNotExists(documentName);
|
|
708
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
709
|
+
.withDocumentTypeId(documentTypeId)
|
|
710
|
+
.addVariant()
|
|
711
|
+
.withName(documentName)
|
|
712
|
+
.done()
|
|
713
|
+
.addValue()
|
|
714
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockGridDataTypeName))
|
|
715
|
+
.addBlockGridValue()
|
|
716
|
+
.addContentData()
|
|
717
|
+
.withContentTypeKey(elementTypeId)
|
|
718
|
+
.withKey(blockContentKey)
|
|
719
|
+
.addContentDataValue()
|
|
720
|
+
.withAlias(elementTypePropertyAlias)
|
|
721
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
722
|
+
.withValue(elementTypePropertyValue)
|
|
723
|
+
.done()
|
|
724
|
+
.done()
|
|
725
|
+
.addExpose()
|
|
726
|
+
.withContentKey(blockContentKey)
|
|
727
|
+
.done()
|
|
728
|
+
.addLayout()
|
|
729
|
+
.withContentKey(blockContentKey)
|
|
730
|
+
.done()
|
|
731
|
+
.done()
|
|
732
|
+
.done()
|
|
733
|
+
.build();
|
|
734
|
+
return await this.create(document);
|
|
735
|
+
}
|
|
736
|
+
async createDefaultDocumentWithABlockGridEditorAndBlockWithTwoValues(documentName, documentTypeName, blockGridDataTypeName, elementTypeId, elementTypePropertyAlias, elementTypePropertyValue, elementTypePropertyEditorAlias, groupName = 'TestGroup', secondElementTypePropertyValue) {
|
|
737
|
+
const crypto = require('crypto');
|
|
738
|
+
const blockContentKey = crypto.randomUUID();
|
|
739
|
+
const secondBlockContentKey = crypto.randomUUID();
|
|
740
|
+
const blockGridDataTypeId = await this.api.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridDataTypeName, elementTypeId, true) || '';
|
|
741
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockGridDataTypeName, blockGridDataTypeId, groupName) || '';
|
|
742
|
+
await this.ensureNameNotExists(documentName);
|
|
743
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
744
|
+
.withDocumentTypeId(documentTypeId)
|
|
745
|
+
.addVariant()
|
|
746
|
+
.withName(documentName)
|
|
747
|
+
.done()
|
|
748
|
+
.addValue()
|
|
749
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockGridDataTypeName))
|
|
750
|
+
.addBlockGridValue()
|
|
751
|
+
.addContentData()
|
|
752
|
+
.withContentTypeKey(elementTypeId)
|
|
753
|
+
.withKey(blockContentKey)
|
|
754
|
+
.addContentDataValue()
|
|
755
|
+
.withAlias(elementTypePropertyAlias)
|
|
756
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
757
|
+
.withValue(elementTypePropertyValue)
|
|
758
|
+
.done()
|
|
759
|
+
.done()
|
|
760
|
+
.addContentData()
|
|
761
|
+
.withContentTypeKey(elementTypeId)
|
|
762
|
+
.withKey(secondBlockContentKey)
|
|
763
|
+
.addContentDataValue()
|
|
764
|
+
.withAlias(elementTypePropertyAlias)
|
|
765
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
766
|
+
.withValue(secondElementTypePropertyValue)
|
|
767
|
+
.done()
|
|
768
|
+
.done()
|
|
769
|
+
.addExpose()
|
|
770
|
+
.withContentKey(blockContentKey)
|
|
771
|
+
.done()
|
|
772
|
+
.addExpose()
|
|
773
|
+
.withContentKey(secondBlockContentKey)
|
|
774
|
+
.done()
|
|
775
|
+
.addLayout()
|
|
776
|
+
.withContentKey(blockContentKey)
|
|
777
|
+
.done()
|
|
778
|
+
.addLayout()
|
|
779
|
+
.withContentKey(secondBlockContentKey)
|
|
780
|
+
.done()
|
|
781
|
+
.done()
|
|
782
|
+
.done()
|
|
783
|
+
.build();
|
|
784
|
+
return await this.create(document);
|
|
785
|
+
}
|
|
786
|
+
async createDefaultDocumentWithABlockGridEditorAndBlockWithTwoValuesAndTwoGroups(documentName, documentTypeName, blockGridDataTypeName, elementTypeId, elementTypePropertyAlias, elementTypePropertyValue, elementTypePropertyEditorAlias, groupName = 'TestGroup', secondElementTypePropertyValue, secondPropertyName, secondGroupName) {
|
|
787
|
+
const crypto = require('crypto');
|
|
788
|
+
const blockContentKey = crypto.randomUUID();
|
|
789
|
+
const secondBlockContentKey = crypto.randomUUID();
|
|
790
|
+
const blockGridDataTypeId = await this.api.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridDataTypeName, elementTypeId, true) || '';
|
|
791
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditorAndTwoGroups(documentTypeName, blockGridDataTypeName, blockGridDataTypeId, groupName, secondPropertyName, blockGridDataTypeId, secondGroupName) || '';
|
|
792
|
+
await this.ensureNameNotExists(documentName);
|
|
793
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
794
|
+
.withDocumentTypeId(documentTypeId)
|
|
795
|
+
.addVariant()
|
|
796
|
+
.withName(documentName)
|
|
797
|
+
.done()
|
|
798
|
+
.addValue()
|
|
799
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockGridDataTypeName))
|
|
800
|
+
.addBlockGridValue()
|
|
801
|
+
.addContentData()
|
|
802
|
+
.withContentTypeKey(elementTypeId)
|
|
803
|
+
.withKey(blockContentKey)
|
|
804
|
+
.addContentDataValue()
|
|
805
|
+
.withAlias(elementTypePropertyAlias)
|
|
806
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
807
|
+
.withValue(elementTypePropertyValue)
|
|
808
|
+
.done()
|
|
809
|
+
.done()
|
|
810
|
+
.addContentData()
|
|
811
|
+
.withContentTypeKey(elementTypeId)
|
|
812
|
+
.withKey(secondBlockContentKey)
|
|
813
|
+
.addContentDataValue()
|
|
814
|
+
.withAlias(elementTypePropertyAlias)
|
|
815
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
816
|
+
.withValue(secondElementTypePropertyValue)
|
|
817
|
+
.done()
|
|
818
|
+
.done()
|
|
819
|
+
.addExpose()
|
|
820
|
+
.withContentKey(blockContentKey)
|
|
821
|
+
.done()
|
|
822
|
+
.addExpose()
|
|
823
|
+
.withContentKey(secondBlockContentKey)
|
|
824
|
+
.done()
|
|
825
|
+
.addLayout()
|
|
826
|
+
.withContentKey(blockContentKey)
|
|
827
|
+
.done()
|
|
828
|
+
.addLayout()
|
|
829
|
+
.withContentKey(secondBlockContentKey)
|
|
830
|
+
.done()
|
|
831
|
+
.done()
|
|
832
|
+
.done()
|
|
833
|
+
.build();
|
|
834
|
+
return await this.create(document);
|
|
835
|
+
}
|
|
836
|
+
async createDefaultDocumentWithABlockListEditorAndBlockWithValue(documentName, documentTypeName, blockListDataTypeName, elementTypeId, elementTypePropertyAlias, elementTypePropertyValue, elementTypePropertyEditorAlias, groupName) {
|
|
837
|
+
const crypto = require('crypto');
|
|
838
|
+
const blockContentKey = crypto.randomUUID();
|
|
839
|
+
const blockListDataTypeId = await this.api.dataType.createBlockListDataTypeWithABlock(blockListDataTypeName, elementTypeId) || '';
|
|
840
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListDataTypeName, blockListDataTypeId, groupName) || '';
|
|
841
|
+
await this.ensureNameNotExists(documentName);
|
|
842
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
843
|
+
.withDocumentTypeId(documentTypeId)
|
|
844
|
+
.addVariant()
|
|
845
|
+
.withName(documentName)
|
|
846
|
+
.done()
|
|
847
|
+
.addValue()
|
|
848
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockListDataTypeName))
|
|
849
|
+
.addBlockListValue()
|
|
850
|
+
.addContentData()
|
|
851
|
+
.withContentTypeKey(elementTypeId)
|
|
852
|
+
.withKey(blockContentKey)
|
|
853
|
+
.addContentDataValue()
|
|
854
|
+
.withAlias(elementTypePropertyAlias)
|
|
855
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
856
|
+
.withValue(elementTypePropertyValue)
|
|
857
|
+
.done()
|
|
858
|
+
.done()
|
|
859
|
+
.addExpose()
|
|
860
|
+
.withContentKey(blockContentKey)
|
|
861
|
+
.done()
|
|
862
|
+
.addLayout()
|
|
863
|
+
.withContentKey(blockContentKey)
|
|
864
|
+
.done()
|
|
865
|
+
.done()
|
|
866
|
+
.done()
|
|
867
|
+
.build();
|
|
868
|
+
return await this.create(document);
|
|
869
|
+
}
|
|
668
870
|
async createDefaultDocumentWithABlockListEditor(documentName, elementTypeId, documentTypeName, blockListDataTypeName) {
|
|
669
871
|
const crypto = require('crypto');
|
|
670
872
|
const blockContentKey = crypto.randomUUID();
|
|
@@ -694,6 +896,252 @@ class DocumentApiHelper {
|
|
|
694
896
|
.build();
|
|
695
897
|
return await this.create(document);
|
|
696
898
|
}
|
|
899
|
+
async createDefaultDocumentWithABlockListEditorAndBlockWithValueAndTwoGroups(documentName, documentTypeName, blockListDataTypeName, elementTypeId, elementTypePropertyAlias, elementTypePropertyValue, elementTypePropertyEditorAlias, groupName = 'TestGroup', secondPropertyName, secondGroupName = 'GroupTwoName') {
|
|
900
|
+
const crypto = require('crypto');
|
|
901
|
+
const blockContentKey = crypto.randomUUID();
|
|
902
|
+
const blockListDataTypeId = await this.api.dataType.createBlockListDataTypeWithABlock(blockListDataTypeName, elementTypeId) || '';
|
|
903
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditorAndTwoGroups(documentTypeName, blockListDataTypeName, blockListDataTypeId, groupName, secondPropertyName, blockListDataTypeId, secondGroupName) || '';
|
|
904
|
+
await this.ensureNameNotExists(documentName);
|
|
905
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
906
|
+
.withDocumentTypeId(documentTypeId)
|
|
907
|
+
.addVariant()
|
|
908
|
+
.withName(documentName)
|
|
909
|
+
.done()
|
|
910
|
+
.addValue()
|
|
911
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockListDataTypeName))
|
|
912
|
+
.addBlockListValue()
|
|
913
|
+
.addContentData()
|
|
914
|
+
.withContentTypeKey(elementTypeId)
|
|
915
|
+
.withKey(blockContentKey)
|
|
916
|
+
.addContentDataValue()
|
|
917
|
+
.withAlias(elementTypePropertyAlias)
|
|
918
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
919
|
+
.withValue(elementTypePropertyValue)
|
|
920
|
+
.done()
|
|
921
|
+
.done()
|
|
922
|
+
.addExpose()
|
|
923
|
+
.withContentKey(blockContentKey)
|
|
924
|
+
.done()
|
|
925
|
+
.addLayout()
|
|
926
|
+
.withContentKey(blockContentKey)
|
|
927
|
+
.done()
|
|
928
|
+
.done()
|
|
929
|
+
.done()
|
|
930
|
+
.build();
|
|
931
|
+
return await this.create(document);
|
|
932
|
+
}
|
|
933
|
+
async createDefaultDocumentWithABlockListEditorAndBlockWithTwoValues(documentName, documentTypeName, blockListDataTypeName, elementTypeId, elementTypePropertyAlias, elementTypePropertyValue, elementTypePropertyEditorAlias, groupName = 'TestGroup', secondElementTypePropertyValue) {
|
|
934
|
+
const crypto = require('crypto');
|
|
935
|
+
const blockContentKey = crypto.randomUUID();
|
|
936
|
+
const secondBlockContentKey = crypto.randomUUID();
|
|
937
|
+
const blockListDataTypeId = await this.api.dataType.createBlockListDataTypeWithABlock(blockListDataTypeName, elementTypeId) || '';
|
|
938
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditor(documentTypeName, blockListDataTypeName, blockListDataTypeId, groupName) || '';
|
|
939
|
+
await this.ensureNameNotExists(documentName);
|
|
940
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
941
|
+
.withDocumentTypeId(documentTypeId)
|
|
942
|
+
.addVariant()
|
|
943
|
+
.withName(documentName)
|
|
944
|
+
.done()
|
|
945
|
+
.addValue()
|
|
946
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockListDataTypeName))
|
|
947
|
+
.addBlockListValue()
|
|
948
|
+
.addContentData()
|
|
949
|
+
.withContentTypeKey(elementTypeId)
|
|
950
|
+
.withKey(blockContentKey)
|
|
951
|
+
.addContentDataValue()
|
|
952
|
+
.withAlias(elementTypePropertyAlias)
|
|
953
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
954
|
+
.withValue(elementTypePropertyValue)
|
|
955
|
+
.done()
|
|
956
|
+
.done()
|
|
957
|
+
.addContentData()
|
|
958
|
+
.withContentTypeKey(elementTypeId)
|
|
959
|
+
.withKey(secondBlockContentKey)
|
|
960
|
+
.addContentDataValue()
|
|
961
|
+
.withAlias(elementTypePropertyAlias)
|
|
962
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
963
|
+
.withValue(secondElementTypePropertyValue)
|
|
964
|
+
.done()
|
|
965
|
+
.done()
|
|
966
|
+
.addExpose()
|
|
967
|
+
.withContentKey(blockContentKey)
|
|
968
|
+
.done()
|
|
969
|
+
.addExpose()
|
|
970
|
+
.withContentKey(secondBlockContentKey)
|
|
971
|
+
.done()
|
|
972
|
+
.addLayout()
|
|
973
|
+
.withContentKey(blockContentKey)
|
|
974
|
+
.done()
|
|
975
|
+
.addLayout()
|
|
976
|
+
.withContentKey(secondBlockContentKey)
|
|
977
|
+
.done()
|
|
978
|
+
.done()
|
|
979
|
+
.done()
|
|
980
|
+
.build();
|
|
981
|
+
return await this.create(document);
|
|
982
|
+
}
|
|
983
|
+
async createDefaultDocumentWithABlockListEditorAndBlockWithTwoValuesAndTwoGroups(documentName, documentTypeName, blockListDataTypeName, elementTypeId, elementTypePropertyAlias, elementTypePropertyValue, elementTypePropertyEditorAlias, groupName = 'TestGroup', secondElementTypePropertyValue, secondPropertyName, secondGroupName) {
|
|
984
|
+
const crypto = require('crypto');
|
|
985
|
+
const blockContentKey = crypto.randomUUID();
|
|
986
|
+
const secondBlockContentKey = crypto.randomUUID();
|
|
987
|
+
const blockListDataTypeId = await this.api.dataType.createBlockListDataTypeWithABlock(blockListDataTypeName, elementTypeId) || '';
|
|
988
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditorAndTwoGroups(documentTypeName, blockListDataTypeName, blockListDataTypeId, groupName, secondPropertyName, blockListDataTypeId, secondGroupName) || '';
|
|
989
|
+
await this.ensureNameNotExists(documentName);
|
|
990
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
991
|
+
.withDocumentTypeId(documentTypeId)
|
|
992
|
+
.addVariant()
|
|
993
|
+
.withName(documentName)
|
|
994
|
+
.done()
|
|
995
|
+
.addValue()
|
|
996
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockListDataTypeName))
|
|
997
|
+
.addBlockListValue()
|
|
998
|
+
.addContentData()
|
|
999
|
+
.withContentTypeKey(elementTypeId)
|
|
1000
|
+
.withKey(blockContentKey)
|
|
1001
|
+
.addContentDataValue()
|
|
1002
|
+
.withAlias(elementTypePropertyAlias)
|
|
1003
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
1004
|
+
.withValue(elementTypePropertyValue)
|
|
1005
|
+
.done()
|
|
1006
|
+
.done()
|
|
1007
|
+
.addContentData()
|
|
1008
|
+
.withContentTypeKey(elementTypeId)
|
|
1009
|
+
.withKey(secondBlockContentKey)
|
|
1010
|
+
.addContentDataValue()
|
|
1011
|
+
.withAlias(elementTypePropertyAlias)
|
|
1012
|
+
.withEditorAlias(elementTypePropertyEditorAlias)
|
|
1013
|
+
.withValue(secondElementTypePropertyValue)
|
|
1014
|
+
.done()
|
|
1015
|
+
.done()
|
|
1016
|
+
.addExpose()
|
|
1017
|
+
.withContentKey(blockContentKey)
|
|
1018
|
+
.done()
|
|
1019
|
+
.addExpose()
|
|
1020
|
+
.withContentKey(secondBlockContentKey)
|
|
1021
|
+
.done()
|
|
1022
|
+
.addLayout()
|
|
1023
|
+
.withContentKey(blockContentKey)
|
|
1024
|
+
.done()
|
|
1025
|
+
.addLayout()
|
|
1026
|
+
.withContentKey(secondBlockContentKey)
|
|
1027
|
+
.done()
|
|
1028
|
+
.done()
|
|
1029
|
+
.done()
|
|
1030
|
+
.build();
|
|
1031
|
+
return await this.create(document);
|
|
1032
|
+
}
|
|
1033
|
+
async createDefaultDocumentWithABlockListEditorAndBlockGridEditorWithSameAllowedBlock(documentName, documentTypeName, blockListDataTypeName, blockGridDataTypeName, elementTypeId, elementTypePropertyAlias, blockListElementTypePropertyValue, blockListElementTypePropertyEditorAlias, blockListGroupName = 'TestBlockList', blockGridElementTypePropertyValue, blockGridElementTypePropertyEditorAlias, blockGridGroupName = 'TestBlockGrid') {
|
|
1034
|
+
const crypto = require('crypto');
|
|
1035
|
+
const blockListContentKey = crypto.randomUUID();
|
|
1036
|
+
const blockGridContentKey = crypto.randomUUID();
|
|
1037
|
+
const blockListDataTypeId = await this.api.dataType.createBlockListDataTypeWithABlock(blockListDataTypeName, elementTypeId) || '';
|
|
1038
|
+
const blockGridDataTypeId = await this.api.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridDataTypeName, elementTypeId) || '';
|
|
1039
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditorAndTwoGroups(documentTypeName, blockListDataTypeName, blockListDataTypeId, blockListGroupName, blockGridDataTypeName, blockGridDataTypeId, blockGridGroupName) || '';
|
|
1040
|
+
await this.ensureNameNotExists(documentName);
|
|
1041
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
1042
|
+
.withDocumentTypeId(documentTypeId)
|
|
1043
|
+
.addVariant()
|
|
1044
|
+
.withName(documentName)
|
|
1045
|
+
.done()
|
|
1046
|
+
.addValue()
|
|
1047
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockListDataTypeName))
|
|
1048
|
+
.addBlockListValue()
|
|
1049
|
+
.addContentData()
|
|
1050
|
+
.withContentTypeKey(elementTypeId)
|
|
1051
|
+
.withKey(blockListContentKey)
|
|
1052
|
+
.addContentDataValue()
|
|
1053
|
+
.withAlias(elementTypePropertyAlias)
|
|
1054
|
+
.withEditorAlias(blockListElementTypePropertyEditorAlias)
|
|
1055
|
+
.withValue(blockListElementTypePropertyValue)
|
|
1056
|
+
.done()
|
|
1057
|
+
.done()
|
|
1058
|
+
.addExpose()
|
|
1059
|
+
.withContentKey(blockListContentKey)
|
|
1060
|
+
.done()
|
|
1061
|
+
.addLayout()
|
|
1062
|
+
.withContentKey(blockListContentKey)
|
|
1063
|
+
.done()
|
|
1064
|
+
.done()
|
|
1065
|
+
.done()
|
|
1066
|
+
.addValue()
|
|
1067
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockGridDataTypeName))
|
|
1068
|
+
.addBlockGridValue()
|
|
1069
|
+
.addContentData()
|
|
1070
|
+
.withContentTypeKey(elementTypeId)
|
|
1071
|
+
.withKey(blockGridContentKey)
|
|
1072
|
+
.addContentDataValue()
|
|
1073
|
+
.withAlias(elementTypePropertyAlias)
|
|
1074
|
+
.withEditorAlias(blockGridElementTypePropertyEditorAlias)
|
|
1075
|
+
.withValue(blockGridElementTypePropertyValue)
|
|
1076
|
+
.done()
|
|
1077
|
+
.done()
|
|
1078
|
+
.addExpose()
|
|
1079
|
+
.withContentKey(blockGridContentKey)
|
|
1080
|
+
.done()
|
|
1081
|
+
.addLayout()
|
|
1082
|
+
.withContentKey(blockGridContentKey)
|
|
1083
|
+
.done()
|
|
1084
|
+
.done()
|
|
1085
|
+
.done()
|
|
1086
|
+
.build();
|
|
1087
|
+
return await this.create(document);
|
|
1088
|
+
}
|
|
1089
|
+
async createDefaultDocumentWithABlockListEditorAndBlockGridEditorWithDifferentAllowedBlock(documentName, documentTypeName, blockListDataTypeName, blockGridDataTypeName, blockListElementTypeId, blockListElementTypePropertyAlias, blockListElementTypePropertyValue, blockListElementTypePropertyEditorAlias, blockListGroupName = 'TestBlockList', blockGridElementTypeId, blockGridElementTypePropertyAlias, blockGridElementTypePropertyValue, blockGridElementTypePropertyEditorAlias, blockGridGroupName = 'TestBlockGrid') {
|
|
1090
|
+
const crypto = require('crypto');
|
|
1091
|
+
const blockListContentKey = crypto.randomUUID();
|
|
1092
|
+
const blockGridContentKey = crypto.randomUUID();
|
|
1093
|
+
const blockListDataTypeId = await this.api.dataType.createBlockListDataTypeWithABlock(blockListDataTypeName, blockListElementTypeId) || '';
|
|
1094
|
+
const blockGridDataTypeId = await this.api.dataType.createBlockGridWithABlockAndAllowAtRoot(blockGridDataTypeName, blockGridElementTypeId) || '';
|
|
1095
|
+
const documentTypeId = await this.api.documentType.createDocumentTypeWithPropertyEditorAndTwoGroups(documentTypeName, blockListDataTypeName, blockListDataTypeId, blockListGroupName, blockGridDataTypeName, blockGridDataTypeId, blockGridGroupName) || '';
|
|
1096
|
+
await this.ensureNameNotExists(documentName);
|
|
1097
|
+
const document = new json_models_builders_1.DocumentBuilder()
|
|
1098
|
+
.withDocumentTypeId(documentTypeId)
|
|
1099
|
+
.addVariant()
|
|
1100
|
+
.withName(documentName)
|
|
1101
|
+
.done()
|
|
1102
|
+
.addValue()
|
|
1103
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockListDataTypeName))
|
|
1104
|
+
.addBlockListValue()
|
|
1105
|
+
.addContentData()
|
|
1106
|
+
.withContentTypeKey(blockListElementTypeId)
|
|
1107
|
+
.withKey(blockListContentKey)
|
|
1108
|
+
.addContentDataValue()
|
|
1109
|
+
.withAlias(blockListElementTypePropertyAlias)
|
|
1110
|
+
.withEditorAlias(blockListElementTypePropertyEditorAlias)
|
|
1111
|
+
.withValue(blockListElementTypePropertyValue)
|
|
1112
|
+
.done()
|
|
1113
|
+
.done()
|
|
1114
|
+
.addExpose()
|
|
1115
|
+
.withContentKey(blockListContentKey)
|
|
1116
|
+
.done()
|
|
1117
|
+
.addLayout()
|
|
1118
|
+
.withContentKey(blockListContentKey)
|
|
1119
|
+
.done()
|
|
1120
|
+
.done()
|
|
1121
|
+
.done()
|
|
1122
|
+
.addValue()
|
|
1123
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(blockGridDataTypeName))
|
|
1124
|
+
.addBlockGridValue()
|
|
1125
|
+
.addContentData()
|
|
1126
|
+
.withContentTypeKey(blockGridElementTypeId)
|
|
1127
|
+
.withKey(blockGridContentKey)
|
|
1128
|
+
.addContentDataValue()
|
|
1129
|
+
.withAlias(blockGridElementTypePropertyAlias)
|
|
1130
|
+
.withEditorAlias(blockGridElementTypePropertyEditorAlias)
|
|
1131
|
+
.withValue(blockGridElementTypePropertyValue)
|
|
1132
|
+
.done()
|
|
1133
|
+
.done()
|
|
1134
|
+
.addExpose()
|
|
1135
|
+
.withContentKey(blockGridContentKey)
|
|
1136
|
+
.done()
|
|
1137
|
+
.addLayout()
|
|
1138
|
+
.withContentKey(blockGridContentKey)
|
|
1139
|
+
.done()
|
|
1140
|
+
.done()
|
|
1141
|
+
.done()
|
|
1142
|
+
.build();
|
|
1143
|
+
return await this.create(document);
|
|
1144
|
+
}
|
|
697
1145
|
}
|
|
698
1146
|
exports.DocumentApiHelper = DocumentApiHelper;
|
|
699
1147
|
//# sourceMappingURL=DocumentApiHelper.js.map
|