cozy-client 60.31.0 → 60.32.0

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.
@@ -3126,7 +3126,7 @@ var CozyClient = /*#__PURE__*/function () {
3126
3126
  CozyClient.hooks = CozyClient.hooks || {};
3127
3127
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
3128
3128
 
3129
- CozyClient.version = "60.31.0";
3129
+ CozyClient.version = "60.32.0";
3130
3130
 
3131
3131
  _microee.default.mixin(CozyClient);
3132
3132
 
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "$comment": "Shared contract vectors for io.cozy.banners. Every client implementing the doctype runs these and must produce `expected` from `input`. Published with the doctype in cozy-doctypes, alongside docs/io.cozy.banners.md.",
3
3
  "now": "2026-07-22T12:00:00Z",
4
- "supportedDoctypeVersion": 1,
5
4
  "expectedShape": "An ordered list of the banners a client displays, each reduced to the values that rendering depends on: bannerId, the severity and surface actually used after any fallback, and whether a call to action is shown.",
6
5
  "cases": [
7
6
  {
@@ -70,13 +69,15 @@
70
69
  "bannerId": "a.high",
71
70
  "severity": "info",
72
71
  "surface": "banner",
73
- "cta": false
72
+ "cta": false,
73
+ "secondaryCta": false
74
74
  },
75
75
  {
76
76
  "bannerId": "b.low",
77
77
  "severity": "info",
78
78
  "surface": "banner",
79
- "cta": false
79
+ "cta": false,
80
+ "secondaryCta": false
80
81
  }
81
82
  ]
82
83
  },
@@ -141,13 +142,15 @@
141
142
  "bannerId": "B.upper",
142
143
  "severity": "info",
143
144
  "surface": "banner",
144
- "cta": false
145
+ "cta": false,
146
+ "secondaryCta": false
145
147
  },
146
148
  {
147
149
  "bannerId": "a.lower",
148
150
  "severity": "info",
149
151
  "surface": "banner",
150
- "cta": false
152
+ "cta": false,
153
+ "secondaryCta": false
151
154
  }
152
155
  ]
153
156
  },
@@ -218,7 +221,8 @@
218
221
  "bannerId": "starting",
219
222
  "severity": "info",
220
223
  "surface": "banner",
221
- "cta": false
224
+ "cta": false,
225
+ "secondaryCta": false
222
226
  }
223
227
  ]
224
228
  },
@@ -289,7 +293,8 @@
289
293
  "bannerId": "open",
290
294
  "severity": "info",
291
295
  "surface": "banner",
292
- "cta": false
296
+ "cta": false,
297
+ "secondaryCta": false
293
298
  }
294
299
  ]
295
300
  },
@@ -328,7 +333,8 @@
328
333
  "bannerId": "openended",
329
334
  "severity": "info",
330
335
  "surface": "banner",
331
- "cta": false
336
+ "cta": false,
337
+ "secondaryCta": false
332
338
  }
333
339
  ]
334
340
  },
@@ -366,7 +372,8 @@
366
372
  "bannerId": "absentend",
367
373
  "severity": "info",
368
374
  "surface": "banner",
369
- "cta": false
375
+ "cta": false,
376
+ "secondaryCta": false
370
377
  }
371
378
  ]
372
379
  },
@@ -533,7 +540,8 @@
533
540
  "bannerId": "unknowncat",
534
541
  "severity": "info",
535
542
  "surface": "banner",
536
- "cta": false
543
+ "cta": false,
544
+ "secondaryCta": false
537
545
  }
538
546
  ]
539
547
  },
@@ -572,7 +580,8 @@
572
580
  "bannerId": "unknownsev",
573
581
  "severity": "warning",
574
582
  "surface": "banner",
575
- "cta": false
583
+ "cta": false,
584
+ "secondaryCta": false
576
585
  }
577
586
  ]
578
587
  },
@@ -611,7 +620,8 @@
611
620
  "bannerId": "unknownsurface",
612
621
  "severity": "info",
613
622
  "surface": "banner",
614
- "cta": false
623
+ "cta": false,
624
+ "secondaryCta": false
615
625
  }
616
626
  ]
617
627
  },
@@ -654,50 +664,8 @@
654
664
  "bannerId": "withcta",
655
665
  "severity": "info",
656
666
  "surface": "banner",
657
- "cta": true
658
- }
659
- ]
660
- },
661
- {
662
- "name": "a call to action on any other scheme is dropped and the banner still renders",
663
- "input": [
664
- {
665
- "_id": "doc019",
666
- "_rev": "1-aaa",
667
- "bannerId": "badcta",
668
- "category": "quota",
669
- "severity": "info",
670
- "surface": "banner",
671
- "text": "Message.",
672
- "lang": "en",
673
- "cta": {
674
- "label": "Upgrade",
675
- "url": "javascript:alert(1)"
676
- },
677
- "dismissible": true,
678
- "dismissedAt": null,
679
- "priority": 50,
680
- "startsAt": "2026-07-01T00:00:00Z",
681
- "endsAt": null,
682
- "source": {
683
- "trigger": "test",
684
- "at": "2026-07-01T00:00:00Z"
685
- },
686
- "cozyMetadata": {
687
- "createdAt": "2026-07-01T00:00:00Z",
688
- "createdByApp": "stack",
689
- "doctypeVersion": "1",
690
- "metadataVersion": 1,
691
- "updatedAt": "2026-07-01T00:00:00Z"
692
- }
693
- }
694
- ],
695
- "expected": [
696
- {
697
- "bannerId": "badcta",
698
- "severity": "info",
699
- "surface": "banner",
700
- "cta": false
667
+ "cta": true,
668
+ "secondaryCta": false
701
669
  }
702
670
  ]
703
671
  },
@@ -737,89 +705,28 @@
737
705
  "bannerId": "nullcta",
738
706
  "severity": "info",
739
707
  "surface": "banner",
740
- "cta": false
708
+ "cta": false,
709
+ "secondaryCta": false
741
710
  }
742
711
  ]
743
712
  },
744
713
  {
745
- "name": "a document written by anything other than the stack is not rendered",
746
- "input": [
747
- {
748
- "_id": "doc021",
749
- "_rev": "1-aaa",
750
- "bannerId": "untrusted",
751
- "category": "quota",
752
- "severity": "info",
753
- "surface": "banner",
754
- "text": "Message.",
755
- "lang": "en",
756
- "dismissible": true,
757
- "dismissedAt": null,
758
- "priority": 50,
759
- "startsAt": "2026-07-01T00:00:00Z",
760
- "endsAt": null,
761
- "source": {
762
- "trigger": "test",
763
- "at": "2026-07-01T00:00:00Z"
764
- },
765
- "cozyMetadata": {
766
- "createdAt": "2026-07-01T00:00:00Z",
767
- "createdByApp": "drive",
768
- "doctypeVersion": "1",
769
- "metadataVersion": 1,
770
- "updatedAt": "2026-07-01T00:00:00Z"
771
- }
772
- }
773
- ],
774
- "expected": []
775
- },
776
- {
777
- "name": "a document above the supported version is skipped",
778
- "supportedDoctypeVersion": 1,
714
+ "name": "a secondary call to action renders alongside the primary one",
779
715
  "input": [
780
716
  {
781
- "_id": "doc022",
717
+ "_id": "doc019",
782
718
  "_rev": "1-aaa",
783
- "bannerId": "toonew",
784
- "category": "quota",
785
- "severity": "error",
786
- "surface": "banner",
719
+ "bannerId": "withsecondary",
720
+ "category": "billing",
721
+ "severity": "warning",
722
+ "surface": "modal",
787
723
  "text": "Message.",
788
724
  "lang": "en",
789
- "dismissible": true,
790
- "dismissedAt": null,
791
- "priority": 50,
792
- "startsAt": "2026-07-01T00:00:00Z",
793
- "endsAt": null,
794
- "source": {
795
- "trigger": "test",
796
- "at": "2026-07-01T00:00:00Z"
725
+ "cta": {
726
+ "label": "Update payment method",
727
+ "url": "https://example.org/billing"
797
728
  },
798
- "cozyMetadata": {
799
- "createdAt": "2026-07-01T00:00:00Z",
800
- "createdByApp": "stack",
801
- "doctypeVersion": "2",
802
- "metadataVersion": 1,
803
- "updatedAt": "2026-07-01T00:00:00Z"
804
- }
805
- }
806
- ],
807
- "expected": []
808
- },
809
- {
810
- "name": "the highest supported version of a bannerId wins, and the others are not rendered",
811
- "supportedDoctypeVersion": 2,
812
- "input": [
813
- {
814
- "_id": "doc023",
815
- "_rev": "1-aaa",
816
- "bannerId": "dual",
817
- "category": "quota",
818
- "severity": "info",
819
- "surface": "banner",
820
- "text": "Message.",
821
- "lang": "en",
822
- "dismissible": true,
729
+ "dismissible": false,
823
730
  "dismissedAt": null,
824
731
  "priority": 50,
825
732
  "startsAt": "2026-07-01T00:00:00Z",
@@ -834,149 +741,36 @@
834
741
  "doctypeVersion": "1",
835
742
  "metadataVersion": 1,
836
743
  "updatedAt": "2026-07-01T00:00:00Z"
837
- }
838
- },
839
- {
840
- "_id": "doc024",
841
- "_rev": "1-aaa",
842
- "bannerId": "dual",
843
- "category": "quota",
844
- "severity": "error",
845
- "surface": "banner",
846
- "text": "Message.",
847
- "lang": "en",
848
- "dismissible": true,
849
- "dismissedAt": null,
850
- "priority": 50,
851
- "startsAt": "2026-07-01T00:00:00Z",
852
- "endsAt": null,
853
- "source": {
854
- "trigger": "test",
855
- "at": "2026-07-01T00:00:00Z"
856
- },
857
- "cozyMetadata": {
858
- "createdAt": "2026-07-01T00:00:00Z",
859
- "createdByApp": "stack",
860
- "doctypeVersion": "3",
861
- "metadataVersion": 1,
862
- "updatedAt": "2026-07-01T00:00:00Z"
863
- }
864
- },
865
- {
866
- "_id": "doc025",
867
- "_rev": "1-aaa",
868
- "bannerId": "dual",
869
- "category": "quota",
870
- "severity": "info",
871
- "surface": "modal",
872
- "text": "Message.",
873
- "lang": "en",
874
- "dismissible": true,
875
- "dismissedAt": null,
876
- "priority": 50,
877
- "startsAt": "2026-07-01T00:00:00Z",
878
- "endsAt": null,
879
- "source": {
880
- "trigger": "test",
881
- "at": "2026-07-01T00:00:00Z"
882
744
  },
883
- "cozyMetadata": {
884
- "createdAt": "2026-07-01T00:00:00Z",
885
- "createdByApp": "stack",
886
- "doctypeVersion": "2",
887
- "metadataVersion": 1,
888
- "updatedAt": "2026-07-01T00:00:00Z"
745
+ "secondaryCta": {
746
+ "label": "Contact support",
747
+ "url": "https://example.org/support"
889
748
  }
890
749
  }
891
750
  ],
892
751
  "expected": [
893
752
  {
894
- "bannerId": "dual",
895
- "severity": "info",
753
+ "bannerId": "withsecondary",
754
+ "severity": "warning",
896
755
  "surface": "modal",
897
- "cta": false
756
+ "cta": true,
757
+ "secondaryCta": true
898
758
  }
899
759
  ]
900
760
  },
901
761
  {
902
- "name": "at equal versions the most recently updated document wins",
903
- "supportedDoctypeVersion": 1,
762
+ "name": "a secondary call to action without a primary one is ignored",
904
763
  "input": [
905
764
  {
906
- "_id": "doc026",
907
- "_rev": "1-aaa",
908
- "bannerId": "same",
909
- "category": "quota",
910
- "severity": "info",
911
- "surface": "banner",
912
- "text": "Message.",
913
- "lang": "en",
914
- "dismissible": true,
915
- "dismissedAt": null,
916
- "priority": 50,
917
- "startsAt": "2026-07-01T00:00:00Z",
918
- "endsAt": null,
919
- "source": {
920
- "trigger": "test",
921
- "at": "2026-07-01T00:00:00Z"
922
- },
923
- "cozyMetadata": {
924
- "createdAt": "2026-07-01T00:00:00Z",
925
- "createdByApp": "stack",
926
- "doctypeVersion": "1",
927
- "metadataVersion": 1,
928
- "updatedAt": "2026-07-02T00:00:00Z"
929
- }
930
- },
931
- {
932
- "_id": "doc027",
765
+ "_id": "doc020",
933
766
  "_rev": "1-aaa",
934
- "bannerId": "same",
935
- "category": "quota",
936
- "severity": "info",
937
- "surface": "modal",
938
- "text": "Message.",
939
- "lang": "en",
940
- "dismissible": true,
941
- "dismissedAt": null,
942
- "priority": 50,
943
- "startsAt": "2026-07-01T00:00:00Z",
944
- "endsAt": null,
945
- "source": {
946
- "trigger": "test",
947
- "at": "2026-07-01T00:00:00Z"
948
- },
949
- "cozyMetadata": {
950
- "createdAt": "2026-07-01T00:00:00Z",
951
- "createdByApp": "stack",
952
- "doctypeVersion": "1",
953
- "metadataVersion": 1,
954
- "updatedAt": "2026-07-09T00:00:00Z"
955
- }
956
- }
957
- ],
958
- "expected": [
959
- {
960
- "bannerId": "same",
961
- "severity": "info",
767
+ "bannerId": "orphansecondary",
768
+ "category": "billing",
769
+ "severity": "warning",
962
770
  "surface": "modal",
963
- "cta": false
964
- }
965
- ]
966
- },
967
- {
968
- "name": "at equal versions and equal updatedAt the lowest _id wins",
969
- "supportedDoctypeVersion": 1,
970
- "input": [
971
- {
972
- "_id": "bbb",
973
- "_rev": "1-aaa",
974
- "bannerId": "tied",
975
- "category": "quota",
976
- "severity": "error",
977
- "surface": "banner",
978
771
  "text": "Message.",
979
772
  "lang": "en",
773
+ "cta": null,
980
774
  "dismissible": true,
981
775
  "dismissedAt": null,
982
776
  "priority": 50,
@@ -992,161 +786,22 @@
992
786
  "doctypeVersion": "1",
993
787
  "metadataVersion": 1,
994
788
  "updatedAt": "2026-07-01T00:00:00Z"
995
- }
996
- },
997
- {
998
- "_id": "aaa",
999
- "_rev": "1-aaa",
1000
- "bannerId": "tied",
1001
- "category": "quota",
1002
- "severity": "info",
1003
- "surface": "modal",
1004
- "text": "Message.",
1005
- "lang": "en",
1006
- "dismissible": true,
1007
- "dismissedAt": null,
1008
- "priority": 50,
1009
- "startsAt": "2026-07-01T00:00:00Z",
1010
- "endsAt": null,
1011
- "source": {
1012
- "trigger": "test",
1013
- "at": "2026-07-01T00:00:00Z"
1014
789
  },
1015
- "cozyMetadata": {
1016
- "createdAt": "2026-07-01T00:00:00Z",
1017
- "createdByApp": "stack",
1018
- "doctypeVersion": "1",
1019
- "metadataVersion": 1,
1020
- "updatedAt": "2026-07-01T00:00:00Z"
790
+ "secondaryCta": {
791
+ "label": "Contact support",
792
+ "url": "https://example.org/support"
1021
793
  }
1022
794
  }
1023
795
  ],
1024
796
  "expected": [
1025
797
  {
1026
- "bannerId": "tied",
1027
- "severity": "info",
798
+ "bannerId": "orphansecondary",
799
+ "severity": "warning",
1028
800
  "surface": "modal",
1029
- "cta": false
801
+ "cta": false,
802
+ "secondaryCta": false
1030
803
  }
1031
804
  ]
1032
- },
1033
- {
1034
- "name": "a dismissal of one version hides every version of that bannerId",
1035
- "supportedDoctypeVersion": 2,
1036
- "input": [
1037
- {
1038
- "_id": "doc030",
1039
- "_rev": "1-aaa",
1040
- "bannerId": "shared",
1041
- "category": "quota",
1042
- "severity": "info",
1043
- "surface": "banner",
1044
- "text": "Message.",
1045
- "lang": "en",
1046
- "dismissible": true,
1047
- "dismissedAt": "2026-07-21T08:00:00Z",
1048
- "priority": 50,
1049
- "startsAt": "2026-07-01T00:00:00Z",
1050
- "endsAt": null,
1051
- "source": {
1052
- "trigger": "test",
1053
- "at": "2026-07-01T00:00:00Z"
1054
- },
1055
- "cozyMetadata": {
1056
- "createdAt": "2026-07-01T00:00:00Z",
1057
- "createdByApp": "stack",
1058
- "doctypeVersion": "1",
1059
- "metadataVersion": 1,
1060
- "updatedAt": "2026-07-01T00:00:00Z"
1061
- }
1062
- },
1063
- {
1064
- "_id": "doc031",
1065
- "_rev": "1-aaa",
1066
- "bannerId": "shared",
1067
- "category": "quota",
1068
- "severity": "info",
1069
- "surface": "banner",
1070
- "text": "Message.",
1071
- "lang": "en",
1072
- "dismissible": true,
1073
- "dismissedAt": null,
1074
- "priority": 50,
1075
- "startsAt": "2026-07-01T00:00:00Z",
1076
- "endsAt": null,
1077
- "source": {
1078
- "trigger": "test",
1079
- "at": "2026-07-01T00:00:00Z"
1080
- },
1081
- "cozyMetadata": {
1082
- "createdAt": "2026-07-01T00:00:00Z",
1083
- "createdByApp": "stack",
1084
- "doctypeVersion": "2",
1085
- "metadataVersion": 1,
1086
- "updatedAt": "2026-07-01T00:00:00Z"
1087
- }
1088
- }
1089
- ],
1090
- "expected": []
1091
- },
1092
- {
1093
- "name": "a dismissal recorded on a version this client cannot read still hides the banner",
1094
- "supportedDoctypeVersion": 1,
1095
- "input": [
1096
- {
1097
- "_id": "docx01",
1098
- "_rev": "1-aaa",
1099
- "bannerId": "crossversion",
1100
- "category": "quota",
1101
- "severity": "info",
1102
- "surface": "banner",
1103
- "text": "Message.",
1104
- "lang": "en",
1105
- "dismissible": true,
1106
- "dismissedAt": null,
1107
- "priority": 50,
1108
- "startsAt": "2026-07-01T00:00:00Z",
1109
- "endsAt": null,
1110
- "source": {
1111
- "trigger": "test",
1112
- "at": "2026-07-01T00:00:00Z"
1113
- },
1114
- "cozyMetadata": {
1115
- "createdAt": "2026-07-01T00:00:00Z",
1116
- "createdByApp": "stack",
1117
- "doctypeVersion": "1",
1118
- "metadataVersion": 1,
1119
- "updatedAt": "2026-07-01T00:00:00Z"
1120
- }
1121
- },
1122
- {
1123
- "_id": "docx02",
1124
- "_rev": "1-aaa",
1125
- "bannerId": "crossversion",
1126
- "category": "quota",
1127
- "severity": "info",
1128
- "surface": "banner",
1129
- "text": "Message.",
1130
- "lang": "en",
1131
- "dismissible": true,
1132
- "dismissedAt": "2026-07-21T08:00:00Z",
1133
- "priority": 50,
1134
- "startsAt": "2026-07-01T00:00:00Z",
1135
- "endsAt": null,
1136
- "source": {
1137
- "trigger": "test",
1138
- "at": "2026-07-01T00:00:00Z"
1139
- },
1140
- "cozyMetadata": {
1141
- "createdAt": "2026-07-01T00:00:00Z",
1142
- "createdByApp": "stack",
1143
- "doctypeVersion": "2",
1144
- "metadataVersion": 1,
1145
- "updatedAt": "2026-07-01T00:00:00Z"
1146
- }
1147
- }
1148
- ],
1149
- "expected": []
1150
805
  }
1151
806
  ]
1152
807
  }