ssjs-data 0.4.2 → 0.5.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +54 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssjs-data",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "Canonical SSJS (Server-Side JavaScript) function catalog, Core library objects, Platform methods, and globals for SFMC tooling",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -6,7 +6,10 @@
6
6
  * - prettier-plugin-sfmc (language registration)
7
7
  * - vscode-sfmc-language (completions, hover, diagnostics)
8
8
  *
9
- * Schema version: 0.3.0 — additive fields added in this version:
9
+ * Schema version: 0.4.0 — additive fields added in this version:
10
+ * - ampscriptEquivalent?: string | null — the canonical AMPscript function name this
11
+ * Platform.Function maps to, or null when no AMPscript equivalent exists.
12
+ * Used by mcp-server-sfmc conversion tools. (PLATFORM_FUNCTIONS only)
10
13
  * - isStatic?: boolean — true for namespace-level calls (Class.Method()), false for instance calls
11
14
  * - deprecated?: boolean — true for entries that resolve at runtime but should not be used in new code
12
15
  * - isProperty?: boolean — true for entries accessed without parentheses (e.g. Platform.Request.HasSSL)
@@ -411,6 +414,7 @@ export const PLATFORM_METHODS = [
411
414
  export const PLATFORM_FUNCTIONS = [
412
415
  {
413
416
  name: 'Lookup',
417
+ ampscriptEquivalent: 'Lookup',
414
418
  minArgs: 4,
415
419
  maxArgs: 4,
416
420
  description:
@@ -442,6 +446,7 @@ export const PLATFORM_FUNCTIONS = [
442
446
  },
443
447
  {
444
448
  name: 'LookupRows',
449
+ ampscriptEquivalent: 'LookupRows',
445
450
  minArgs: 3,
446
451
  maxArgs: 3,
447
452
  description:
@@ -473,6 +478,7 @@ export const PLATFORM_FUNCTIONS = [
473
478
  },
474
479
  {
475
480
  name: 'LookupOrderedRows',
481
+ ampscriptEquivalent: 'LookupOrderedRows',
476
482
  minArgs: 5,
477
483
  maxArgs: 5,
478
484
  description:
@@ -517,6 +523,7 @@ export const PLATFORM_FUNCTIONS = [
517
523
  },
518
524
  {
519
525
  name: 'InsertData',
526
+ ampscriptEquivalent: 'InsertData',
520
527
  minArgs: 3,
521
528
  maxArgs: 3,
522
529
  description:
@@ -543,6 +550,7 @@ export const PLATFORM_FUNCTIONS = [
543
550
  },
544
551
  {
545
552
  name: 'InsertDE',
553
+ ampscriptEquivalent: 'InsertDE',
546
554
  minArgs: 3,
547
555
  maxArgs: 3,
548
556
  description:
@@ -569,6 +577,7 @@ export const PLATFORM_FUNCTIONS = [
569
577
  },
570
578
  {
571
579
  name: 'UpdateData',
580
+ ampscriptEquivalent: 'UpdateData',
572
581
  minArgs: 5,
573
582
  maxArgs: 5,
574
583
  description:
@@ -607,6 +616,7 @@ export const PLATFORM_FUNCTIONS = [
607
616
  },
608
617
  {
609
618
  name: 'UpdateDE',
619
+ ampscriptEquivalent: 'UpdateDE',
610
620
  minArgs: 5,
611
621
  maxArgs: 5,
612
622
  description:
@@ -645,6 +655,7 @@ export const PLATFORM_FUNCTIONS = [
645
655
  },
646
656
  {
647
657
  name: 'UpsertData',
658
+ ampscriptEquivalent: 'UpsertData',
648
659
  minArgs: 5,
649
660
  maxArgs: 5,
650
661
  description:
@@ -682,6 +693,7 @@ export const PLATFORM_FUNCTIONS = [
682
693
  },
683
694
  {
684
695
  name: 'UpsertDE',
696
+ ampscriptEquivalent: 'UpsertDE',
685
697
  minArgs: 5,
686
698
  maxArgs: 5,
687
699
  description:
@@ -719,6 +731,7 @@ export const PLATFORM_FUNCTIONS = [
719
731
  },
720
732
  {
721
733
  name: 'DeleteData',
734
+ ampscriptEquivalent: 'DeleteData',
722
735
  minArgs: 3,
723
736
  maxArgs: 3,
724
737
  description:
@@ -746,6 +759,7 @@ export const PLATFORM_FUNCTIONS = [
746
759
  },
747
760
  {
748
761
  name: 'DeleteDE',
762
+ ampscriptEquivalent: 'DeleteDE',
749
763
  minArgs: 3,
750
764
  maxArgs: 3,
751
765
  description:
@@ -772,6 +786,7 @@ export const PLATFORM_FUNCTIONS = [
772
786
  },
773
787
  {
774
788
  name: 'ContentBlockByKey',
789
+ ampscriptEquivalent: 'ContentBlockByKey',
775
790
  minArgs: 1,
776
791
  maxArgs: 4,
777
792
  description: 'Renders a Content Builder asset referenced by customer key.',
@@ -810,6 +825,7 @@ export const PLATFORM_FUNCTIONS = [
810
825
  },
811
826
  {
812
827
  name: 'ContentBlockByName',
828
+ ampscriptEquivalent: 'ContentBlockByName',
813
829
  minArgs: 1,
814
830
  maxArgs: 5,
815
831
  description:
@@ -856,6 +872,7 @@ export const PLATFORM_FUNCTIONS = [
856
872
  },
857
873
  {
858
874
  name: 'ContentBlockByID',
875
+ ampscriptEquivalent: 'ContentBlockByID',
859
876
  minArgs: 1,
860
877
  maxArgs: 4,
861
878
  description: 'Renders a Content Builder asset by its numeric identifier.',
@@ -890,6 +907,7 @@ export const PLATFORM_FUNCTIONS = [
890
907
  },
891
908
  {
892
909
  name: 'ContentImageByKey',
910
+ ampscriptEquivalent: 'ContentImageByKey',
893
911
  minArgs: 1,
894
912
  maxArgs: 2,
895
913
  description:
@@ -914,6 +932,7 @@ export const PLATFORM_FUNCTIONS = [
914
932
  },
915
933
  {
916
934
  name: 'ContentImageByID',
935
+ ampscriptEquivalent: 'ContentImageByID',
917
936
  minArgs: 1,
918
937
  maxArgs: 2,
919
938
  description:
@@ -933,6 +952,7 @@ export const PLATFORM_FUNCTIONS = [
933
952
  },
934
953
  {
935
954
  name: 'TreatAsContent',
955
+ ampscriptEquivalent: 'TreatAsContent',
936
956
  minArgs: 1,
937
957
  maxArgs: 1,
938
958
  description: 'Processes a string as AMPscript/HTML and returns rendered output.',
@@ -950,6 +970,7 @@ export const PLATFORM_FUNCTIONS = [
950
970
  },
951
971
  {
952
972
  name: 'BeginImpressionRegion',
973
+ ampscriptEquivalent: 'BeginImpressionRegion',
953
974
  minArgs: 1,
954
975
  maxArgs: 1,
955
976
  description: 'Marks the start of a named impression tracking region within content.',
@@ -963,6 +984,7 @@ export const PLATFORM_FUNCTIONS = [
963
984
  },
964
985
  {
965
986
  name: 'EndImpressionRegion',
987
+ ampscriptEquivalent: 'EndImpressionRegion',
966
988
  minArgs: 0,
967
989
  maxArgs: 1,
968
990
  description: 'Marks the end of an impression tracking region within content.',
@@ -981,6 +1003,7 @@ export const PLATFORM_FUNCTIONS = [
981
1003
  },
982
1004
  {
983
1005
  name: 'Now',
1006
+ ampscriptEquivalent: 'Now',
984
1007
  minArgs: 0,
985
1008
  maxArgs: 1,
986
1009
  description:
@@ -1001,6 +1024,7 @@ export const PLATFORM_FUNCTIONS = [
1001
1024
  },
1002
1025
  {
1003
1026
  name: 'SystemDateToLocalDate',
1027
+ ampscriptEquivalent: 'SystemDateToLocalDate',
1004
1028
  minArgs: 1,
1005
1029
  maxArgs: 1,
1006
1030
  description:
@@ -1019,6 +1043,7 @@ export const PLATFORM_FUNCTIONS = [
1019
1043
  },
1020
1044
  {
1021
1045
  name: 'LocalDateToSystemDate',
1046
+ ampscriptEquivalent: 'LocalDateToSystemDate',
1022
1047
  minArgs: 1,
1023
1048
  maxArgs: 1,
1024
1049
  description:
@@ -1037,6 +1062,7 @@ export const PLATFORM_FUNCTIONS = [
1037
1062
  },
1038
1063
  {
1039
1064
  name: 'RaiseError',
1065
+ ampscriptEquivalent: 'RaiseError',
1040
1066
  minArgs: 1,
1041
1067
  maxArgs: 4,
1042
1068
  description:
@@ -1076,6 +1102,7 @@ export const PLATFORM_FUNCTIONS = [
1076
1102
  },
1077
1103
  {
1078
1104
  name: 'GUID',
1105
+ ampscriptEquivalent: 'GUID',
1079
1106
  minArgs: 0,
1080
1107
  maxArgs: 0,
1081
1108
  description: 'Generates a new globally unique identifier string.',
@@ -1087,6 +1114,7 @@ export const PLATFORM_FUNCTIONS = [
1087
1114
  },
1088
1115
  {
1089
1116
  name: 'IsEmailAddress',
1117
+ ampscriptEquivalent: 'IsEmailAddress',
1090
1118
  minArgs: 1,
1091
1119
  maxArgs: 1,
1092
1120
  description: 'Checks whether a string is a valid email address format.',
@@ -1098,6 +1126,7 @@ export const PLATFORM_FUNCTIONS = [
1098
1126
  },
1099
1127
  {
1100
1128
  name: 'IsPhoneNumber',
1129
+ ampscriptEquivalent: 'IsPhoneNumber',
1101
1130
  minArgs: 1,
1102
1131
  maxArgs: 1,
1103
1132
  description: 'Evaluates whether a string contains a valid phone number.',
@@ -1109,6 +1138,7 @@ export const PLATFORM_FUNCTIONS = [
1109
1138
  },
1110
1139
  {
1111
1140
  name: 'CreateObject',
1141
+ ampscriptEquivalent: 'CreateObject',
1112
1142
  minArgs: 1,
1113
1143
  maxArgs: 1,
1114
1144
  description: 'Instantiates a Marketing Cloud SOAP API object.',
@@ -1120,6 +1150,7 @@ export const PLATFORM_FUNCTIONS = [
1120
1150
  },
1121
1151
  {
1122
1152
  name: 'SetObjectProperty',
1153
+ ampscriptEquivalent: 'SetObjectProperty',
1123
1154
  minArgs: 3,
1124
1155
  maxArgs: 3,
1125
1156
  description: 'Assigns a property value on a SOAP API object.',
@@ -1135,6 +1166,7 @@ export const PLATFORM_FUNCTIONS = [
1135
1166
  },
1136
1167
  {
1137
1168
  name: 'AddObjectArrayItem',
1169
+ ampscriptEquivalent: 'AddObjectArrayItem',
1138
1170
  minArgs: 3,
1139
1171
  maxArgs: 3,
1140
1172
  description: "Appends an item to a SOAP API object's array property.",
@@ -1150,6 +1182,7 @@ export const PLATFORM_FUNCTIONS = [
1150
1182
  },
1151
1183
  {
1152
1184
  name: 'InvokeCreate',
1185
+ ampscriptEquivalent: 'InvokeCreate',
1153
1186
  minArgs: 3,
1154
1187
  maxArgs: 3,
1155
1188
  description: 'Executes a SOAP API Create call on an API object.',
@@ -1178,6 +1211,7 @@ export const PLATFORM_FUNCTIONS = [
1178
1211
  },
1179
1212
  {
1180
1213
  name: 'InvokeUpdate',
1214
+ ampscriptEquivalent: 'InvokeUpdate',
1181
1215
  minArgs: 3,
1182
1216
  maxArgs: 3,
1183
1217
  description: 'Executes a SOAP API Update call on an API object.',
@@ -1206,6 +1240,7 @@ export const PLATFORM_FUNCTIONS = [
1206
1240
  },
1207
1241
  {
1208
1242
  name: 'InvokeDelete',
1243
+ ampscriptEquivalent: 'InvokeDelete',
1209
1244
  minArgs: 3,
1210
1245
  maxArgs: 3,
1211
1246
  description: 'Executes a SOAP API Delete call on an API object.',
@@ -1234,6 +1269,7 @@ export const PLATFORM_FUNCTIONS = [
1234
1269
  },
1235
1270
  {
1236
1271
  name: 'InvokeRetrieve',
1272
+ ampscriptEquivalent: 'InvokeRetrieve',
1237
1273
  minArgs: 2,
1238
1274
  maxArgs: 2,
1239
1275
  description: 'Executes a SOAP API Retrieve call.',
@@ -1261,6 +1297,7 @@ export const PLATFORM_FUNCTIONS = [
1261
1297
  },
1262
1298
  {
1263
1299
  name: 'InvokePerform',
1300
+ ampscriptEquivalent: 'InvokePerform',
1264
1301
  minArgs: 4,
1265
1302
  maxArgs: 4,
1266
1303
  description: 'Executes a SOAP API Perform action on an API object.',
@@ -1291,6 +1328,7 @@ export const PLATFORM_FUNCTIONS = [
1291
1328
  },
1292
1329
  {
1293
1330
  name: 'InvokeConfigure',
1331
+ ampscriptEquivalent: null,
1294
1332
  minArgs: 4,
1295
1333
  maxArgs: 4,
1296
1334
  description: 'Executes a SOAP API Configure call on an API object.',
@@ -1318,6 +1356,7 @@ export const PLATFORM_FUNCTIONS = [
1318
1356
  },
1319
1357
  {
1320
1358
  name: 'InvokeExecute',
1359
+ ampscriptEquivalent: 'InvokeExecute',
1321
1360
  minArgs: 3,
1322
1361
  maxArgs: 3,
1323
1362
  description: 'Executes a SOAP API Execute call on an API object.',
@@ -1346,6 +1385,7 @@ export const PLATFORM_FUNCTIONS = [
1346
1385
  },
1347
1386
  {
1348
1387
  name: 'InvokeExtract',
1388
+ ampscriptEquivalent: null,
1349
1389
  minArgs: 2,
1350
1390
  maxArgs: 3,
1351
1391
  description: 'Invokes the Extract SOAP API method on the specified object.',
@@ -1374,6 +1414,7 @@ export const PLATFORM_FUNCTIONS = [
1374
1414
  },
1375
1415
  {
1376
1416
  name: 'InvokeSchedule',
1417
+ ampscriptEquivalent: null,
1377
1418
  minArgs: 3,
1378
1419
  maxArgs: 5,
1379
1420
  description: 'Invokes the Schedule SOAP API method on the specified object.',
@@ -1405,6 +1446,7 @@ export const PLATFORM_FUNCTIONS = [
1405
1446
  },
1406
1447
  {
1407
1448
  name: 'HTTPGet',
1449
+ ampscriptEquivalent: 'HTTPGet',
1408
1450
  minArgs: 2,
1409
1451
  maxArgs: 6,
1410
1452
  description:
@@ -1463,6 +1505,7 @@ export const PLATFORM_FUNCTIONS = [
1463
1505
  },
1464
1506
  {
1465
1507
  name: 'HTTPPost',
1508
+ ampscriptEquivalent: 'HTTPPost',
1466
1509
  minArgs: 3,
1467
1510
  maxArgs: 6,
1468
1511
  description:
@@ -1510,6 +1553,7 @@ export const PLATFORM_FUNCTIONS = [
1510
1553
  },
1511
1554
  {
1512
1555
  name: 'ParseJSON',
1556
+ ampscriptEquivalent: null,
1513
1557
  minArgs: 1,
1514
1558
  maxArgs: 1,
1515
1559
  description:
@@ -1536,6 +1580,7 @@ export const PLATFORM_FUNCTIONS = [
1536
1580
  },
1537
1581
  {
1538
1582
  name: 'RedirectTo',
1583
+ ampscriptEquivalent: 'RedirectTo',
1539
1584
  minArgs: 1,
1540
1585
  maxArgs: 1,
1541
1586
  description:
@@ -1557,6 +1602,7 @@ export const PLATFORM_FUNCTIONS = [
1557
1602
  },
1558
1603
  {
1559
1604
  name: 'UrlEncode',
1605
+ ampscriptEquivalent: 'URLEncode',
1560
1606
  minArgs: 1,
1561
1607
  maxArgs: 2,
1562
1608
  description:
@@ -1586,6 +1632,7 @@ export const PLATFORM_FUNCTIONS = [
1586
1632
  },
1587
1633
  {
1588
1634
  name: 'Base64Encode',
1635
+ ampscriptEquivalent: 'Base64Encode',
1589
1636
  minArgs: 1,
1590
1637
  maxArgs: 2,
1591
1638
  description:
@@ -1609,6 +1656,7 @@ export const PLATFORM_FUNCTIONS = [
1609
1656
  },
1610
1657
  {
1611
1658
  name: 'Base64Decode',
1659
+ ampscriptEquivalent: 'Base64Decode',
1612
1660
  minArgs: 1,
1613
1661
  maxArgs: 2,
1614
1662
  description:
@@ -1636,6 +1684,7 @@ export const PLATFORM_FUNCTIONS = [
1636
1684
  },
1637
1685
  {
1638
1686
  name: 'MD5',
1687
+ ampscriptEquivalent: 'MD5',
1639
1688
  minArgs: 1,
1640
1689
  maxArgs: 2,
1641
1690
  description: 'Returns an MD5 hash for a given string value.',
@@ -1656,6 +1705,7 @@ export const PLATFORM_FUNCTIONS = [
1656
1705
  },
1657
1706
  {
1658
1707
  name: 'Stringify',
1708
+ ampscriptEquivalent: null,
1659
1709
  minArgs: 1,
1660
1710
  maxArgs: 1,
1661
1711
  description:
@@ -1679,6 +1729,7 @@ export const PLATFORM_FUNCTIONS = [
1679
1729
  },
1680
1730
  {
1681
1731
  name: 'ContentArea',
1732
+ ampscriptEquivalent: 'ContentArea',
1682
1733
  minArgs: 1,
1683
1734
  maxArgs: 4,
1684
1735
  deprecated: true,
@@ -1716,6 +1767,7 @@ export const PLATFORM_FUNCTIONS = [
1716
1767
  },
1717
1768
  {
1718
1769
  name: 'ContentAreaByName',
1770
+ ampscriptEquivalent: 'ContentAreaByName',
1719
1771
  minArgs: 1,
1720
1772
  maxArgs: 4,
1721
1773
  deprecated: true,
@@ -1752,6 +1804,7 @@ export const PLATFORM_FUNCTIONS = [
1752
1804
  },
1753
1805
  {
1754
1806
  name: 'IsCHTMLBrowser',
1807
+ ampscriptEquivalent: 'IsCHTMLBrowser',
1755
1808
  minArgs: 1,
1756
1809
  maxArgs: 1,
1757
1810
  description: