This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
rules.ts
1916 lines (1882 loc) · 66 KB
/
rules.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2018, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const minAPI = 48;
const rulesVersion = '20220520';
const standardNamespaces = [
'c',
'aura',
'lightning',
'ui',
'apex',
'ltng',
'force'
];
//See https://github.com/get-alex/alex#configuration for more information on how to configure the Language Scanner
const alexConfig = {
"noBinary": true,
"profanitySureness": 2,
"allow": ["period","simple","invalid","special","just","fires","host-hostess","gross","executes","execution","KY"]
}
const mdTypes: IMetadataType[] = [{
label: 'Permission Sets',
metadataType: 'PermissionSet'
},
{
label: 'Custom Profiles',
metadataType: 'Profile'
},
{
label: 'Custom Metadata',
metadataType: 'CustomMetadata'
},
{
label: 'Feature Parameters (Boolean)',
metadataType: 'FeatureParameterBoolean'
},
{
label: 'Feature Parameters (Date)',
metadataType: 'FeatureParameterDate'
},
{
label: 'Feature Parameters (Integer)',
metadataType: 'FeatureParameterInteger'
},
{
label: 'Custom Settings',
metadataType: 'CustomSetting__c'
},
{
label: 'Custom Labels',
metadataType: 'CustomLabels'
},
{
label: 'Tabs',
metadataType: 'CustomTab'
},
{
label: 'Flows',
metadataType: 'Flow'
},
{
label: 'Apex Classes',
metadataType: 'ApexClass'
},
{
label: 'Apex Triggers',
metadataType: 'ApexTrigger'
},
{
label: 'Custom Reports',
metadataType: 'Report'
},
{
label: 'Custom Report Types',
metadataType: 'ReportType'
},
{
label: 'Custom Apps',
metadataType: 'CustomApplication'
},
{
label: 'Connected Apps',
metadataType: 'ConnectedApp'
},
{
label: 'Static Resources',
metadataType: 'StaticResource'
},
{
label: 'Sharing Rules',
metadataType: 'SharingRules'
},
{
label: 'Validation Rules',
metadataType: 'ValidationRule'
},
{
label: 'Custom Objects',
metadataType: 'CustomObject'
},
{
label: 'Custom Fields',
metadataType: 'CustomField'
},
{
label: 'Platform Events',
metadataType: 'PlatformEventChannel'
},
{
label: 'Visualforce Pages',
metadataType: 'ApexPage'
},
{
label: 'Aura Web Components',
metadataType: 'AuraDefinitionBundle'
},
{
label: 'Lightning Web Components',
metadataType: 'LightningComponentBundle'
},
{
label: 'CRM Analytics Applications',
metadataType: 'WaveApplication'
},
{
label: 'CRM Analytics Dashboards',
metadataType: 'WaveDashboard'
},
{
label: 'CRM Analytics Dataflows',
metadataType: 'WaveDataflow'
},
{
label: 'CRM Analytics Datasets',
metadataType: 'WaveDataset'
},
{
label: 'CRM Analytics Lenses',
metadataType: 'WaveLens'
},
{
label: 'CRM Analytics Template Bundles',
metadataType: 'WaveTemplateBundle'
},
{
label: 'CRM Analytics Dashboards',
metadataType: 'WaveDashboard'
},
{
label: 'Record Types',
metadataType: 'RecordType'
},
{
label: 'In-App guidance',
metadataType: 'Prompt'
}
];
const enablementRules: IRule[] = [{
name: 'ISV Technical Success Center',
condition: {
metadataType: 'any',
operator: 'always'
},
resultTrue: {
label: 'Visit the ISV Technical Success Center',
message: 'For more resources to help build a successful app, visit the ISV Technical Success Center on the Partner Community',
url: 'http://p.force.com/TECenter'
}
},
{
name: 'SFDXScanner',
condition: {
metadataType: 'ApexClass',
operator: 'exists',
conditionOr: {
metadataType: 'ApexTrigger',
operator: 'exists',
conditionOr: {
metadataType: 'LightningComponentBundle',
operator: 'exists',
conditionOr: {
metadataType: 'AuraDefinitionBundle',
operator: 'exists',
conditionOr: {
metadataType: 'ApexPage',
operator: 'exists'
}
}
}
}
},
resultTrue: {
label: 'Scan your code for vulnerabilities',
message: 'Scan your Apex, Javascript, and Visualforce code for vulnerabilities and violations using the Salesforce Code Analyzer.\nNew in Spring \'22: Salesforce Code Analyzer will detect CRUD and FLS Violations!\n Learn more about sfdx-scanner here.',
url: 'https://forcedotcom.github.io/sfdx-scanner/'
},
},
{
name: 'Flows',
condition: {
metadataType: 'Flow',
operator: 'notexists',
},
resultTrue: {
label: 'Take Advantage of Flows',
message: 'Flows are a powerful tool to enable forms based workflows and process automation to your users. See this webinar for more information.',
url: 'https://partners.salesforce.com/0693A000007S2Dq'
},
},
{
name: 'FlowsLimitations',
condition: {
metadataType: 'Flow',
operator: 'exists',
},
resultTrue: {
label: 'Be aware of packaging limitations for Flows',
message: 'There are limitations on Flows within packages. Please review the following document before packaging your flow.',
url: 'https://help.salesforce.com/articleView?id=flow_considerations_distribute_package.htm'
},
},
{
name: 'Flow Templates',
condition: {
metadataType: 'Flow.FlowTemplate',
operator: 'notexists',
conditionAnd: {
processAlways: false,
metadataType: 'Flow',
operator: 'exists'
}
},
resultTrue: {
label: 'Include your Flows as Templates',
message: 'When packaging a Flow, consider using a Flow Template to allow your subscribers to modify the flow to suit their needs. For more information about Flow Templates see this blog post.',
url: 'https://medium.com/inside-the-salesforce-ecosystem/pre-built-business-processes-how-isvs-use-flow-templates-ddc9910ff93a'
},
},
{
name: 'Batch Apex',
condition: {
metadataType: 'ApexClass.BatchApex',
operator: 'exists'
},
resultTrue: {
label: 'Follow best practices for Batch Apex',
message: 'For more information on Batch Apex Design patterns and how best to package Batch Apex, see this webinar.',
url: 'https://partners.salesforce.com/0693A000006aF9G',
},
},
{
name: 'In App Prompts',
condition: {
metadataType: 'Prompt',
operator: 'notexists'
},
resultTrue: {
label: 'Take Advantage of In-App Prompts',
message: 'For more information about how to use In-App Prompts to keep your users informed, see this blog.',
url: 'https://medium.com/inside-the-salesforce-ecosystem/in-app-prompts-for-isvs-e9b013969016'
},
},
{
name: 'Platform Cache',
condition: {
metadataType: 'PlatformCachePartition',
operator: 'notexists'
},
resultTrue: {
label: 'Supercharge Your App’s Performance with Free Platform Cache',
message: 'As part of the partner program and, with the Spring ’21 release, ISVs can now include that 3MB of platform cache into their managed packages. Check out this blog to see how the free cache provisioning works and what you need to do to take advantage of it.',
url: 'http://bit.ly/ISVTEPlatformCache'
}
},
{
name: 'Custom Fields on Activity',
condition: {
metadataType: 'CustomField.objects.Activity',
operator: 'gte',
operand: 1
},
resultTrue: {
label: 'Be aware of limits on Custom Fields on Activity',
message: 'Please be aware that there is a hard limit of 100 fields on the Activity object including all managed and unmanaged fields. Your package will not install if this raises the number of fields on the Activity object past this threshold in your subscriber\'s org.'
}
},
{
name: 'Platform Events',
condition: {
metadataType: 'PlatformEventChannel',
operator: 'exists'
},
resultTrue: {
label: 'Be aware of Platform Events Best Practices',
message: 'For more information on Platform Events and how to use them within your application, see this webinar.',
url: 'https://partners.salesforce.com/partnerEvent?id=a033A00000GF5BPQA1'
}
},
{
name: 'Change Data Capture',
condition: {
metadataType: 'PlatformEventChannelMember',
operator: 'exists'
},
resultTrue: {
label: 'Be aware of Change Data Capture Best Practices',
message: 'For more information on Change Data Capture and how to use it in your application, please see this webinar.',
url: 'https://developer.salesforce.com/events/webinars/change-data-capture'
}
},
{
name: 'Aura Components',
condition: {
metadataType: 'AuraDefinitionBundle',
operator: 'exists',
conditionAnd: {
metadataType: 'LightningComponentBundle',
operator: 'notexists'
},
},
resultTrue: {
label: 'Learn about migrating from Aura Web Components to Lightning Web Components',
message: 'Lightning Web Components are the new Salesforce standard for Lightning Components featuring easier devlopment, better performance and standards compliance. For a decision matrix on whether you should be considering migrating to LWC see this blog.',
url: 'https://medium.com/inside-the-salesforce-ecosystem/lightning-web-components-an-isv-partner-digest-59d9191f3248'
}
},
{
name: 'Local LWC Development',
condition: {
metadataType: 'LightningComponentBundle',
operator: 'exists'
},
resultTrue: {
label: 'Lightning Web Component Local Development',
message: 'Lightning Component Development can be significantly improved using local development. See this webinar for more information',
url: 'https://developer.salesforce.com/event/salesforce-lightning-base-components-open-source'
}
},
{
name: 'Lightning Web Components Performance Best Practices',
condition: {
metadataType: 'LightningComponentBundle',
operator: 'exists'
},
resultTrue: {
label: 'Lightning Web Components Performance Best Practices',
message: 'Check out this blog for tips, tricks and best practices to get the best performance out of your Lightning Web Components',
url: 'https://developer.salesforce.com/blogs/2020/06/lightning-web-components-performance-best-practices.html'
}
},
{
name: 'Lightning Web Components',
condition: {
metadataType: 'LightningComponentBundle',
operator: 'notexists'
},
resultTrue: {
label: 'Take advantage of Lightning Web Components',
message: 'Find more information about how to leverage the power of LWC and for best practices, see this webinar.',
url: 'https://partners.salesforce.com/0693A000007Kd7oQAC'
}
},
{
name: 'Einstein Analytics Templates',
condition: {
metadataType: 'WaveTemplateBundle',
operator: 'exists'
},
resultTrue: {
label: 'Learn about Einstein Analytics Template Bundles',
message: 'For more information on Creating & Distributing Analytics Apps using Templates see this webinar.',
url: 'https://partners.salesforce.com/partnerEvent?id=a033A00000FYOQOQA5'
}
},
{
name: 'Feature Management',
condition: {
metadataType: 'FeatureParameterBoolean',
operator: 'exists',
conditionOr: {
metadataType: 'FeatureParameterDate',
operator: 'exists',
conditionOr: {
metadataType: 'FeatureParameterInteger',
operator: 'exists'
}
}
},
resultTrue: {
label: 'Learn more about using Feature Management',
message: 'See this webinar for more information on using Feature Management within your package.',
url: 'http://salesforce.vidyard.com/watch/pXTQPKtMkF8vmZDJoBidx9'
}
},
{
name: '@AuraEnabled Critical Update',
condition: {
metadataType: 'ApexClass.AuraEnabledCalls',
operator: 'gt',
operand: 0
},
resultTrue: {
label: 'Learn about @AuraEnabled Permissions',
message: 'A Winter \'21 Critical update changed the permissions needed for users to access @AuraEnabled methods. See the blog below for more information',
url: 'https://developer.salesforce.com/blogs/2020/08/breezing-through-the-upcoming-auraenabled-critical-update.html?utm_campaign=August_2020&utm_source=social&utm_medium=twitter&utm_source=twitter&utm_medium=organic_social&utm_campaign=amer_sfld&utm_content=AMER%2CDevelopers%2CEnglish'
}
},
];
const qualityRules: IRule[] = [
{
name: "PB Workflow Disablement",
condition: {
metadataType: "Flow.FlowTypes.Workflow",
operator: 'exists',
conditionOr: {
metadataType: "Workflow",
operator: 'exists',
conditionOr: {
metadataType: "WorkflowFieldUpdate",
operator: 'exists',
conditionOr: {
metadataType: "WorkflowAlert",
operator: 'exists',
conditionOr: {
metadataType: "WorkflowRule",
operator: 'exists'
}
}
}
}
},
resultTrue: {
label: 'Process Builder and Workflow Rules being retired',
message: 'Process Builders and Workflow Rules are being retired in favour of Flow. Read the information here for more details on the disablement timeline.',
url: 'https://admin.salesforce.com/blog/2021/go-with-the-flow-whats-happening-with-workflow-rules-and-process-builder',
}
},
{
name: 'Hard-Coded URLs',
condition: {
metadataType: 'componentProperties.*.*.hardcodedURLs',
operator: 'exists',
showDetails: true
},
resultTrue: {
label: 'Do Not use Hard-Coded URLs to access Salesforce Orgs',
message: 'Hard-Coded URLs which reference instance names like https://na144.salesforce.com can cause customer org migrations to fail. Use <mydomain>.my.salesforce.com or login.salesforce.com instead',
url: 'https://help.salesforce.com/s/articleView?id=000335670&type=1',
showDetails: true
}
},
{
name: 'Metadata API Version',
condition: {
metadataType: 'apiVersions.mdapi',
operator: 'between',
operand: [20,'minAPI'],
},
resultTrue: {
label: 'Using old Metadata API Version',
message: `You appear to be using a version of Metadata API less than the minimum specified. Use the --minapi flag to adjust the minimum API version.`,
},
},
{
name: 'Apex API Version',
condition: {
metadataType: 'apiVersions.ApexClass.*',
operator: 'between',
operand: [20,'minAPI'],
showDetails: true
},
resultTrue: {
label: 'Using old Apex API Version',
message: `You appear to be using an API version less than the minimum specified. Use the --minapi flag to adjust the minimum API version.`,
showDetails: true
}
},
{
name: 'Trigger API Version',
condition: {
metadataType: 'apiVersions.ApexTrigger.*',
operator: 'between',
operand: [20,'minAPI'],
showDetails: true
},
resultTrue: {
label: 'Using old Trigger API Version',
message: `You appear to be using an API version less than the minimum specified. Use the --minapi flag to adjust the minimum API version.`,
showDetails: true
}
},
{
name: 'Aura Component API Version',
condition: {
metadataType: 'apiVersions.AuraDefinitionBundle.*',
operator: 'between',
operand: [20,'minAPI'],
showDetails: true
},
resultTrue: {
label: 'Using old Aura Component API Version',
message: `You appear to be using an API version less than the minimum specified. Use the --minapi flag to adjust the minimum API version.`,
showDetails: true
}
},
{
name: 'LWC API Version',
condition: {
metadataType: 'apiVersions.LightningComponentBundle.*',
operator: 'between',
operand: [20,'minAPI'],
showDetails: true
},
resultTrue: {
label: 'Using old Lightning Web Component API Version',
message: `You appear to be using an API version less than the minimum specified. Use the --minapi flag to adjust the minimum API version.`,
showDetails: true
}
},
{
name: 'Visualforce API Version',
condition: {
metadataType: 'apiVersions.ApexPage.*',
operator: 'between',
operand: [20,'minAPI'],
},
resultTrue: {
label: 'Using old Visualforce API Version',
message: `You appear to be using an API version less than the minimum specified. Use the --minapi flag to adjust the minimum API version.`,
showDetails: true
}
},
{
name: 'Custom Object Description',
condition: {
metadataType: 'componentProperties.CustomObject',
operator: 'exists',
showDetails: false,
conditionAnd: {
metadataType: 'componentProperties.CustomObject.*.descriptionExists',
operator: 'notexists',
showDetails: true
}
},
resultTrue: {
label: 'Custom Objects should have a description',
message: `It is a best practice that Custom Objects have a description.`,
showDetails: true
}
},
{
name: 'Custom Field Description',
condition: {
metadataType: 'componentProperties.CustomField',
operator: 'exists',
showDetails: false,
conditionAnd: {
metadataType: 'componentProperties.CustomField.*.descriptionExists',
operator: 'notexists',
showDetails: true
}
},
resultTrue: {
label: 'Custom Fields should have a description',
message: `It is a best practice that Custom Fields have a description.`,
showDetails: true
}
},
{
name: 'Triggers per Object',
condition: {
metadataType: 'ApexTrigger.objects.*',
operator: 'gt',
operand: 1,
showDetails: true
},
resultTrue: {
label: 'Multiple Triggers per Object',
message: 'It is a best practice to have 1 trigger per object. Please check triggers on the objects below to see if you can use triggers and trigger handlers to reduce the number of triggers per object.',
showDetails: true
}
},
{
name: 'Process Builders per Object',
condition: {
metadataType: 'Flow.objects.*',
operator: 'gt',
operand: 1,
showDetails: true
},
resultTrue: {
label: 'Multiple Process Builders per Object',
message: 'It is a best best practice to have 1 record-change process per object. Please check Process Builders on the objects below to see if you can combine all processes into one.',
showDetails: true
}
},
{
name: 'Change Processes per Object',
condition: {
metadataType: 'ApexTrigger.objects.*',
operator: 'gte',
operand: 1,
showDetails: true,
conditionAnd: {
metadataType: 'Flow.objects.*',
operator: 'gte',
operand: 1,
conditionPerItem: true
},
},
resultTrue: {
label: 'Multiple Change Processes per Object',
message: 'It is a best best practice to have 1 record-change process per object. Avoid using both Triggers and Process Builders on the same object.',
showDetails: true
}
},
{
name: 'Apex Version Check',
condition: {
metadataType: 'apiVersions.ApexClass.*',
operator: 'gte',
operand: 48
},
resultFalse: {
label: 'New security features in Apex using API version 48 or higher',
message: 'There are new security features added to Apex which greatly simplify FLS checks for Security Review. Update your Apex to API version 48 or higher and review these release notes.',
url:'https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_apex_Security_stripInaccessible_GA.htm\n\thttps://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_apex_WithSecurityEnforced_GA.htm'
}
},
{
name: 'Apex FLS Checks',
condition: {
metadataType: 'apiVersions.ApexClass.*',
operator: 'notexists',
conditionOr: {
metadataType: 'componentProperties.ApexClass.*.StripInaccessible',
operator: 'eq',
operand: 1,
conditionOr: {
metadataType: 'componentProperties.ApexClass.*.SECURITY_ENFORCED',
operator: 'eq',
operand: 1,
conditionAnd: {
metadataType: 'apiVersions.ApexClass.*',
operator: 'gte',
operand: 48,
conditionPerItem: true
}
}
}
},
resultFalse: {
label: 'New Apex Security Features',
message: 'Starting with API version 48, you can use SOQL queries with the WITH SECURITY_ENFORCED modifier as well as the Apex method Security.stripInaccessible to provide FLS and CRUD checks eliminating the need to perform individual field accessibility checks to pass Security Review. Please review the attached release docs for more information',
url: 'https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_apex_Security_stripInaccessible_GA.htm \n https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_apex_WithSecurityEnforced_GA.htm'
}
},
{
name: 'Translations',
condition: {
metadataType: 'Translations',
operator: 'notexists'
},
resultTrue: {
label: 'Use Translations to appeal to a broader audience',
message: 'Users prefer to work in their native language. Consider including translations to make your app multilingual'
}
},
{
name: 'ApexCode',
condition: {
metadataType: 'ApexClass.CharacterCount',
operator: 'gt',
operand: 5000000
},
resultTrue: {
label: 'Large amounts of Apex',
message: 'Total Apex Character count not counting tests and comments is close to the 6M character limit'
}
},
{
name: 'PackagedConsumerKey',
condition: {
metadataType: 'componentProperties.AuthProvider.*.packagedSecret',
operator: 'gte',
operand: 1,
showDetails: true
},
resultTrue: {
label: 'Sensitive value cannot be packaged',
message: 'Starting **RELEASE*** an AuthProvider can no longer be packaged with a consumer key. The key must be configured post installation. See here for more information:',
url: 'https://help.salesforce.com/THELINK',
showDetails: true
}
},
{
name: 'OverloadedAuraEnabled',
condition: {
metadataType: 'componentProperties.ApexClass.*.AuraEnabledMethods',
operator: 'exists',
showDetails: true,
conditionAnd: {
metadataType: 'apiVersions.ApexClass.*',
operator: 'gte',
operand: 55,
conditionPerItem: true,
showDetails: true
}
},
resultTrue: {
label: 'Overloaded AuraEnabled Calls',
message: 'Starting with API Version 55, @AuraEnabled methods cannot be overloaded',
showDetails: true
}
}
];
const alertRules: IRule[] = [
{
name: 'Alerts Signup',
condition: {
metadataType: 'any',
operator: 'always'
},
resultTrue: {
label: 'Stay on Top of Alerts',
message: 'Sign up here to be notified of all Partner Alerts',
url: 'https://sfdc.co/ISVTEAlertsAll'
}
},
{
name: '@AuraEnabled Methods',
condition: {
metadataType: 'ApexClass.AuraEnabledCalls',
operator: 'exists',
expiration: '2021-05-01T00:00:00.000Z',
showDetails: true
},
resultTrue: {
label: '@AuraEnabled Methods',
message: 'New Permissions Required to Access Apex Classes containing @AuraEnabled methods.',
url: 'https://partners.salesforce.com/partnerAlert?id=a033A00000Fvo12QAB',
showDetails: true
}
},
{
name: 'Aura UI Namespace',
condition: {
metadataType: 'componentProperties.AuraDefinitionBundle.*.namespaceReferences.ui',
operator: 'exists',
expiration: '2021-08-01T00:00:00.000Z',
showDetails: true
},
resultTrue: {
label: 'Aura Components in UI Namespace Retiring in Summer \'21',
message: 'In Summer \'21, Lightning Base Components in the ui namespace will be retired.',
url: 'https://sfdc.co/ISVTEAlert20191210',
showDetails: true
}
},
{
name: 'Custom Metadata Permissions',
condition: {
metadataType: 'CustomMetadata',
operator: 'exists',
expiration: '2021-05-01T00:00:00.000Z'
},
resultTrue: {
label: 'Custom Metadata',
message: 'New Permissions Required for Direct Read Access to Custom Metadata Types.',
url: 'https://partners.salesforce.com/partnerAlert?id=a033A00000GimUSQAZ',
}
},
{
name: 'Custom Settings Direct Read',
condition: {
metadataType: 'CustomSetting__c',
operator: 'exists',
expiration: '2021-05-01T00:00:00.000Z'
},
resultTrue: {
label: 'Custom Settings',
message: 'New Permissions Required for Direct Read Access to Custom Settings.',
url: 'https://partners.salesforce.com/partnerAlert?id=a033A00000GimQ6QAJ',
}
},
{
name: 'Territory 1 EOL',
condition: {
metadataType: 'Territory',
operator: 'exists',
expiration: '2021-07-01T00:00:00.000Z'
},
resultTrue: {
label: 'Territory Management 1.0',
message: 'Territory Management will be End of Life starting in Winter \'20. Please migrate to Territory Management 2.0.',
url: 'https://help.salesforce.com/articleView?id=000318370&type=1&mode=1',
}
},
{
name: 'RecordType Access',
condition: {
metadataType: 'RecordType',
operator: 'exists',
expiration: '2020-05-01T00:00:00.000Z'
},
resultTrue: {
label: 'Change to Record Type Access',
message: 'There have been changes to Record Type access in permission sets within Managed Packages for Winter \'20 in response to a Known Issue. Subscribers may need to upgrade your package to see this fix.',
url: 'https://partners.salesforce.com/partnerAlert?id=a033A00000GSdBoQAL',
}
},
{
name: 'Lightning Platform API Versions 7-20',
condition: {
metadataType: 'apiVersions.*.*',
expiration: '2021-08-01T00:00:00.000Z',
operator: 'between',
operand: [7,20],
},
resultTrue: {
label: 'Lightning Platform API Versions 7-20 Retiring in Summer ‘21',
message: 'With the Summer ‘21 release, SOAP, REST, and Bulk API legacy versions 7 through 20 will be retired and no longer supported by Salesforce. When these legacy versions are retired, applications consuming impacted versions of the APIs will experience a disruption as the requests will fail and result in an error indicating that the requested endpoint has been deactivated.',
url: 'https://sfdc.co/ISVTEAlert20200120'
}
},
{
name: 'Salesforce Platform API Versions 21.0 thru 30.0 in Summer 22',
condition: {
metadataType: 'apiVersions.*.*',
expiration: '2022-08-01T00:00:00.000Z',
operator: 'between',
operand: [5,30],
},
resultTrue: {
label: 'Salesforce Platform API Versions 21.0 thru 30.0 in Summer \'22',
message: 'With the Summer ‘22 release, SOAP, REST, and Bulk API legacy versions 21 through 30 will be retired and no longer supported by Salesforce. When these legacy versions are retired, applications consuming impacted versions of the APIs will experience a disruption as the requests will fail and result in an error indicating that the requested endpoint has been deactivated.',
url: 'https://sfdc.co/ISVTEAlert20201109'
}
},
{
name: 'External Sharing Model set to Private for all entities',
condition: {
expiration: '2020-07-1T00:00:00.000Z',
metadataType: 'any',
operator: 'always'
},
resultTrue: {
label: 'All new orgs will sign up with External Sharing Model set to Private for all entities in Spring’20',
message: 'The external sharing model is automatically enabled in Salesforce orgs created in Spring ’20 or after. Also, external access levels are initially set to Private for all objects in these orgs. These changes don’t affect existing customers.',
url: 'https://partners.salesforce.com/partnerAlert?id=a033A00000GNnm3QAD'
}
},
{
name: 'Enhancement to Guest User Sharing Policy',
condition: {
expiration: '2022-10-1T00:00:00.000Z',
metadataType: 'LightningComponentBundle.targets.lightningCommunity__Page',
operator: 'exists',
conditionOr: {
metadataType: 'LightningComponentBundle.targets.lightningCommunity__Default',
operator: 'exists',
conditionOr: {
metadataType: 'ExperienceBundle',
operator: 'exists',
conditionOr: {
metadataType: 'CommunityTemplateDefinition',
operator: 'exists',
conditionOr: {
metadataType: 'componentProperties.AuraDefinitionBundle.*.interfaces.forceCommunity:availableForAllPageTypes',
operator: 'exists',
conditionOr: {
metadataType: 'componentProperties.ApexPage.*.RefersToSite',
operator: 'exists',
conditionOr: {
metadataType: 'componentProperties.ApexTrigger.*.RefersToGuest',
operator: 'exists',
conditionOr: {
metadataType: 'componentProperties.ApexClass.*.RefersToGuest',
operator: 'exists'
}
}
}
}
}
}
}
},
resultTrue: {
label: 'Enhancement to Guest User Sharing Policy',
message: 'The secure guest user record access and assign new records created by guest users to the default owner will be auto-enabled in Summer ‘20 with opt-out & disable options available. The settings will be enforced in Winter ‘21 without opt-out & disable options. If your application uses or can use Guest Users, please refer to this alert link to ensure you will not be impacted.',
url: 'https://sfdc.co/ISVTEAlert20200414'
}
},
{
name: 'Work.com Search',
condition: {
expiration: '2021-10-1T00:00:00.000Z',
metadataType: 'dependencies.namespaces.wkcc',
operator: 'exists'
},
resultTrue: {
label: 'Changing the Location Search Filter Level setting in Command Center, by administrators, may impact Work.com Components',
message: 'With the v5 of Workplace Command Center, Salesforce provides System Administrators with the option of allowing end users to search all levels of the location hierarchy. In previous versions, and by default in Version 5, end users can search only level-1 locations. Not all components running in Workplace Command Center fully support the option to search locations at all levels of the hierarchy. The components that support search at all levels are: Wellness Status, Wellness Status by Location, Location Status, and Operations Feed (tasks).',
url: 'https://sfdc.co/ISVTEAlert20201207'
}
},
{
name: 'New Order Save Behavior',
condition: {
metadataType: 'ApexTrigger.object.Order',
operator: 'exists',
conditionOr: {
metadataType: 'ApexTrigger.object.OrderItem',
operator: 'exists',
conditionOr: {
metadataType: 'Flow.object.Order',
operator: 'exists',
conditionOr: {
metadataType: 'Flow.object.OrderItem',
operator: 'exists',
},
},
},
},
resultTrue: {
label: 'New Order Save Behavior',
message: 'To align with Force.com platform requirements, we’re updating the Order Save Behavior feature starting with the Winter ’21 release. This update improves the evaluation of custom application logic on the parent record. Unlike the previous version, the New Order Save Behavior makes Salesforce run custom application logic whenever an order product update causes a change to the parent order. Custom application logic consists of validation rules, Apex triggers, workflow rules, flows, and processes.',
url: 'https://sfdc.co/ISVTEAlert20200925'
}
},
{
name: "Lightning Platform Components Proactive Enablement",
condition: {
expiration: '2021-10-01T00:00:00.000Z',
metadataType: "LightningComponentBundle",
operator: "exists",
conditionOr: {
metadataType: "AuraDefinitionBundle",
operator: "exists",
}
},
resultTrue: {
label: "Access Security Changes to Lightning Platform Components Proactive Enablement",
message: "During the Summer ‘21 release, Salesforce will be automatically enforcing the Disable Access to Non-global Apex Controller Methods in Managed Packages and Enforce Access Modifiers on Apex Properties in Lightning Component Markup release updates. View the alert to understand the changes and prepare for their impact.",
url: "https://sfdc.co/ISVTEAlert20210209"
}
},
{
name: 'MFA Mandate',
condition: {
expiration: '2023-03-1T00:00:00.000Z',
metadataType: 'any',
operator: 'always'
},
resultTrue: {
label: 'MFA Mandate - Alert to All Partners (w/ emphasis on OEM/reseller partners)',
message: 'Beginning February 1, 2022, all users will be required to adopt Multi-Factor Authentication (MFA) to login to Salesforce products, including OEM products and Salesforce products purchased through a reseller.',
url: 'https://sfdc.co/ISVTEAlert20210202'
}
},
{name: 'Stricter Validation in Visualforce Remoting API',
condition: {
expiration: '2022-12-1T00:00:00.000Z',
metadataType: 'ApexClass.RemoteActionCalls',
operator: 'exists'
},
resultTrue: {
label: 'Stricter Validation in Visualforce Remoting API',
message: 'To ensure that the Visualforce Remoting API is properly secured, calls now have stricter validation. This update is enforced in Winter \'22. Click here to find out more',
url: 'https://sfdc.co/ISVTEremotingupdate'}
},
{
name: 'Candidate Patient Entity Retirement',
condition: {
expiration: '2023-08-1T00:00:00.000Z',
metadataType: 'dependencies.components.HealthCloudGA__CandidatePatient__c',
operator: 'exists',
conditionOr: {
metadataType: 'ApexTrigger.objects.HealthCloudGA__CandidatePatient__c',