ssjs-data 0.1.0 → 0.2.1

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 +7 -2
  2. package/src/index.js +200 -7
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "ssjs-data",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
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",
7
7
  "exports": {
8
8
  ".": "./src/index.js"
9
9
  },
10
- "files": ["src"],
10
+ "files": [
11
+ "src"
12
+ ],
11
13
  "repository": {
12
14
  "type": "git",
13
15
  "url": "git+https://github.com/JoernBerkefeld/ssjs-data.git"
@@ -27,6 +29,9 @@
27
29
  "platform-functions"
28
30
  ],
29
31
  "license": "MIT",
32
+ "scripts": {
33
+ "test": "echo No tests defined"
34
+ },
30
35
  "engines": {
31
36
  "node": ">=18.0.0"
32
37
  }
package/src/index.js CHANGED
@@ -60,6 +60,7 @@ export const SSJS_GLOBALS = [
60
60
  params: [{ name: 'customerKey', description: 'Customer key of the Content Builder asset', type: 'string' }],
61
61
  returnType: 'string',
62
62
  syntax: 'ContentBlockByKey(customerKey)',
63
+ example: 'var html = ContentBlockByKey("my-header-block");\nWrite(html);',
63
64
  },
64
65
  {
65
66
  name: 'ContentBlockByName',
@@ -70,6 +71,7 @@ export const SSJS_GLOBALS = [
70
71
  params: [{ name: 'name', description: 'Folder path and name of the Content Builder asset', type: 'string' }],
71
72
  returnType: 'string',
72
73
  syntax: 'ContentBlockByName(name)',
74
+ example: 'var html = ContentBlockByName("Shared Content/Footer");\nWrite(html);',
73
75
  },
74
76
  {
75
77
  name: 'ContentBlockByID',
@@ -80,6 +82,7 @@ export const SSJS_GLOBALS = [
80
82
  params: [{ name: 'id', description: 'Numeric ID of the Content Builder asset', type: 'number' }],
81
83
  returnType: 'string',
82
84
  syntax: 'ContentBlockByID(id)',
85
+ example: 'var html = ContentBlockByID(12345);\nWrite(html);',
83
86
  },
84
87
  {
85
88
  name: 'ContentAreaByKey',
@@ -90,6 +93,7 @@ export const SSJS_GLOBALS = [
90
93
  params: [{ name: 'key', description: 'External key of the classic content area', type: 'string' }],
91
94
  returnType: 'string',
92
95
  syntax: 'ContentAreaByKey(key)',
96
+ example: 'var html = ContentAreaByKey("my-content-area-key");\nWrite(html);',
93
97
  },
94
98
  {
95
99
  name: 'TreatAsContent',
@@ -101,6 +105,7 @@ export const SSJS_GLOBALS = [
101
105
  params: [{ name: 'content', description: 'String containing AMPscript or HTML to evaluate', type: 'string' }],
102
106
  returnType: 'string',
103
107
  syntax: 'TreatAsContent(content)',
108
+ example: 'var ampBlock = "%%[Set @msg = \'Dynamic content\']%% %%=v(@msg)=%%";\nWrite(TreatAsContent(ampBlock));',
104
109
  },
105
110
  {
106
111
  name: 'TreatAsContentArea',
@@ -111,6 +116,7 @@ export const SSJS_GLOBALS = [
111
116
  params: [{ name: 'content', description: 'Classic content area markup to render', type: 'string' }],
112
117
  returnType: 'string',
113
118
  syntax: 'TreatAsContentArea(content)',
119
+ example: 'var rendered = TreatAsContentArea("%%[ContentAreaByKey(\'my-key\')]%%");\nWrite(rendered);',
114
120
  },
115
121
  {
116
122
  name: 'String',
@@ -216,6 +222,7 @@ export const PLATFORM_METHODS = [
216
222
  ],
217
223
  returnType: 'void',
218
224
  syntax: 'Platform.Load(libraryName, version)',
225
+ example: 'Platform.Load("core", "1.1.5");\nvar de = DataExtension.Init("MyDE");\nvar rows = de.Rows.Retrieve();',
219
226
  },
220
227
  ];
221
228
 
@@ -270,6 +277,7 @@ export const PLATFORM_FUNCTIONS = [
270
277
  ],
271
278
  returnType: 'object',
272
279
  syntax: 'LookupOrderedRows(deName, sortCount, sortField, sortOrder, fieldName, fieldValue[, fieldName2, fieldValue2, ...])',
280
+ example: 'var rows = Platform.Function.LookupOrderedRows("MyDE", 10, "CreatedDate", "DESC", "Status", "active");\nfor (var i = 0; i < rows.length; i++) {\n Write(rows[i]["Email"] + "<br>");\n}',
273
281
  },
274
282
  {
275
283
  name: 'InsertData',
@@ -297,6 +305,7 @@ export const PLATFORM_FUNCTIONS = [
297
305
  ],
298
306
  returnType: 'number',
299
307
  syntax: 'InsertDE(deName, fieldName1, value1[, fieldName2, value2, ...])',
308
+ example: 'var count = Platform.Function.InsertDE("MyDE", "Email", "jane@example.com", "Name", "Jane");',
300
309
  },
301
310
  {
302
311
  name: 'UpdateData',
@@ -312,6 +321,7 @@ export const PLATFORM_FUNCTIONS = [
312
321
  ],
313
322
  returnType: 'number',
314
323
  syntax: 'UpdateData(deName, fieldName1, value1, filterField, filterValue[, fieldName2, value2, ...])',
324
+ example: 'var count = Platform.Function.UpdateData("MyDE", "Status", "inactive", "Email", "jane@example.com");',
315
325
  },
316
326
  {
317
327
  name: 'UpdateDE',
@@ -327,6 +337,7 @@ export const PLATFORM_FUNCTIONS = [
327
337
  ],
328
338
  returnType: 'number',
329
339
  syntax: 'UpdateDE(deName, fieldName1, value1, filterField, filterValue[, fieldName2, value2, ...])',
340
+ example: 'var count = Platform.Function.UpdateDE("MyDE", "Status", "inactive", "Email", "jane@example.com");',
330
341
  },
331
342
  {
332
343
  name: 'UpsertData',
@@ -358,6 +369,7 @@ export const PLATFORM_FUNCTIONS = [
358
369
  ],
359
370
  returnType: 'number',
360
371
  syntax: 'UpsertDE(deName, fieldName1, value1, filterField, filterValue[, fieldName2, value2, ...])',
372
+ example: 'Platform.Function.UpsertDE("MyDE", 1, "Status", "active", "Email", "jane@example.com");',
361
373
  },
362
374
  {
363
375
  name: 'DeleteData',
@@ -371,6 +383,7 @@ export const PLATFORM_FUNCTIONS = [
371
383
  ],
372
384
  returnType: 'number',
373
385
  syntax: 'DeleteData(deName, filterField, filterValue[, filterField2, filterValue2, ...])',
386
+ example: 'var count = Platform.Function.DeleteData("MyDE", "Email", "jane@example.com");',
374
387
  },
375
388
  {
376
389
  name: 'DeleteDE',
@@ -384,6 +397,7 @@ export const PLATFORM_FUNCTIONS = [
384
397
  ],
385
398
  returnType: 'number',
386
399
  syntax: 'DeleteDE(deName, filterField, filterValue[, filterField2, filterValue2, ...])',
400
+ example: 'var count = Platform.Function.DeleteDE("MyDE", "Email", "jane@example.com");',
387
401
  },
388
402
  {
389
403
  name: 'ContentBlockByKey',
@@ -395,6 +409,7 @@ export const PLATFORM_FUNCTIONS = [
395
409
  ],
396
410
  returnType: 'string',
397
411
  syntax: 'ContentBlockByKey(customerKey)',
412
+ example: 'var html = Platform.Function.ContentBlockByKey("my-header-block");\nWrite(html);',
398
413
  },
399
414
  {
400
415
  name: 'ContentBlockByName',
@@ -406,6 +421,7 @@ export const PLATFORM_FUNCTIONS = [
406
421
  ],
407
422
  returnType: 'string',
408
423
  syntax: 'ContentBlockByName(name)',
424
+ example: 'var html = Platform.Function.ContentBlockByName("Shared Content/Footer");\nWrite(html);',
409
425
  },
410
426
  {
411
427
  name: 'ContentBlockByID',
@@ -417,6 +433,7 @@ export const PLATFORM_FUNCTIONS = [
417
433
  ],
418
434
  returnType: 'string',
419
435
  syntax: 'ContentBlockByID(id)',
436
+ example: 'var html = Platform.Function.ContentBlockByID(12345);\nWrite(html);',
420
437
  },
421
438
  {
422
439
  name: 'TreatAsContent',
@@ -428,6 +445,7 @@ export const PLATFORM_FUNCTIONS = [
428
445
  ],
429
446
  returnType: 'string',
430
447
  syntax: 'TreatAsContent(content)',
448
+ example: 'var result = Platform.Function.TreatAsContent("%%[Set @x = 1]%%%%=v(@x)=%%");\nWrite(result); // "1"',
431
449
  },
432
450
  {
433
451
  name: 'Substring',
@@ -441,6 +459,7 @@ export const PLATFORM_FUNCTIONS = [
441
459
  ],
442
460
  returnType: 'string',
443
461
  syntax: 'Substring(value, start[, length])',
462
+ example: 'var str = "Hello, World!";\nvar sub = Platform.Function.Substring(str, 1, 5);\nWrite(sub); // "Hello"',
444
463
  },
445
464
  {
446
465
  name: 'Trim',
@@ -452,6 +471,7 @@ export const PLATFORM_FUNCTIONS = [
452
471
  ],
453
472
  returnType: 'string',
454
473
  syntax: 'Trim(value)',
474
+ example: 'var clean = Platform.Function.Trim(" hello ");\nWrite(clean); // "hello"',
455
475
  },
456
476
  {
457
477
  name: 'Replace',
@@ -465,6 +485,7 @@ export const PLATFORM_FUNCTIONS = [
465
485
  ],
466
486
  returnType: 'string',
467
487
  syntax: 'Replace(value, search, replacement)',
488
+ example: 'var result = Platform.Function.Replace("Hello, World!", "World", "SFMC");\nWrite(result); // "Hello, SFMC!"',
468
489
  },
469
490
  {
470
491
  name: 'IndexOf',
@@ -477,6 +498,7 @@ export const PLATFORM_FUNCTIONS = [
477
498
  ],
478
499
  returnType: 'number',
479
500
  syntax: 'IndexOf(value, search)',
501
+ example: 'var pos = Platform.Function.IndexOf("Hello, World!", "World");\nWrite(pos); // 7',
480
502
  },
481
503
  {
482
504
  name: 'Length',
@@ -488,6 +510,7 @@ export const PLATFORM_FUNCTIONS = [
488
510
  ],
489
511
  returnType: 'number',
490
512
  syntax: 'Length(value)',
513
+ example: 'var len = Platform.Function.Length("Hello");\nWrite(len); // 5',
491
514
  },
492
515
  {
493
516
  name: 'Uppercase',
@@ -499,6 +522,7 @@ export const PLATFORM_FUNCTIONS = [
499
522
  ],
500
523
  returnType: 'string',
501
524
  syntax: 'Uppercase(value)',
525
+ example: 'var upper = Platform.Function.Uppercase("hello");\nWrite(upper); // "HELLO"',
502
526
  },
503
527
  {
504
528
  name: 'Lowercase',
@@ -510,6 +534,7 @@ export const PLATFORM_FUNCTIONS = [
510
534
  ],
511
535
  returnType: 'string',
512
536
  syntax: 'Lowercase(value)',
537
+ example: 'var lower = Platform.Function.Lowercase("HELLO");\nWrite(lower); // "hello"',
513
538
  },
514
539
  {
515
540
  name: 'ProperCase',
@@ -521,6 +546,7 @@ export const PLATFORM_FUNCTIONS = [
521
546
  ],
522
547
  returnType: 'string',
523
548
  syntax: 'ProperCase(value)',
549
+ example: 'var title = Platform.Function.ProperCase("hello world");\nWrite(title); // "Hello World"',
524
550
  },
525
551
  {
526
552
  name: 'Char',
@@ -532,6 +558,7 @@ export const PLATFORM_FUNCTIONS = [
532
558
  ],
533
559
  returnType: 'string',
534
560
  syntax: 'Char(asciiCode)',
561
+ example: 'var tab = Platform.Function.Char(9); // tab character\nWrite("Col1" + tab + "Col2");',
535
562
  },
536
563
  {
537
564
  name: 'Concat',
@@ -544,6 +571,7 @@ export const PLATFORM_FUNCTIONS = [
544
571
  ],
545
572
  returnType: 'string',
546
573
  syntax: 'Concat(value1, value2[, ...])',
574
+ example: 'var full = Platform.Function.Concat("Hello", ", ", "World!");\nWrite(full); // "Hello, World!"',
547
575
  },
548
576
  {
549
577
  name: 'Format',
@@ -556,6 +584,7 @@ export const PLATFORM_FUNCTIONS = [
556
584
  ],
557
585
  returnType: 'string',
558
586
  syntax: 'Format(value, format[, ...])',
587
+ example: 'var price = Platform.Function.Format(1234.5, "C2");\nWrite(price); // "$1,234.50"',
559
588
  },
560
589
  {
561
590
  name: 'DateAdd',
@@ -569,6 +598,7 @@ export const PLATFORM_FUNCTIONS = [
569
598
  ],
570
599
  returnType: 'string',
571
600
  syntax: 'DateAdd(date, interval, datePart)',
601
+ example: 'var future = Platform.Function.DateAdd(Platform.Function.Now(), 7, "D");\nWrite(future); // date 7 days from now',
572
602
  },
573
603
  {
574
604
  name: 'DateDiff',
@@ -582,6 +612,7 @@ export const PLATFORM_FUNCTIONS = [
582
612
  ],
583
613
  returnType: 'number',
584
614
  syntax: 'DateDiff(date1, date2, datePart)',
615
+ example: 'var days = Platform.Function.DateDiff("2025-01-01", Platform.Function.Now(), "D");\nWrite(days); // days elapsed since Jan 1 2025',
585
616
  },
586
617
  {
587
618
  name: 'DateParse',
@@ -594,15 +625,26 @@ export const PLATFORM_FUNCTIONS = [
594
625
  ],
595
626
  returnType: 'object',
596
627
  syntax: 'DateParse(dateString[, format])',
628
+ example: 'var d = Platform.Function.DateParse("2025-08-05T12:00:00Z");\nWrite(Platform.Function.FormatDate(d, "MM/dd/yyyy")); // "08/05/2025"',
597
629
  },
598
630
  {
599
631
  name: 'Now',
600
632
  minArgs: 0,
601
- maxArgs: 0,
602
- description: 'Returns the current date and time of the SFMC server.',
603
- params: [],
633
+ maxArgs: 1,
634
+ description:
635
+ 'Returns the current system timestamp, or the timestamp of the triggering send when called with true.',
636
+ params: [
637
+ {
638
+ name: 'useContextTime',
639
+ description:
640
+ 'When true, returns the time the triggering send or activity was initiated. When false or omitted, returns the current system clock time.',
641
+ type: 'boolean',
642
+ optional: true,
643
+ },
644
+ ],
604
645
  returnType: 'string',
605
- syntax: 'Now()',
646
+ syntax: 'Now([useContextTime])',
647
+ example: 'var current = Platform.Function.Now();\nWrite(current); // e.g. "8/5/2025 12:00:00 PM"\n\n// Use context time during triggered sends:\nvar sendTime = Platform.Function.Now(true);',
606
648
  },
607
649
  {
608
650
  name: 'FormatDate',
@@ -616,17 +658,33 @@ export const PLATFORM_FUNCTIONS = [
616
658
  ],
617
659
  returnType: 'string',
618
660
  syntax: 'FormatDate(date, format[, locale])',
661
+ example: 'var formatted = Platform.Function.FormatDate(Platform.Function.Now(), "MMMM d, yyyy");\nWrite(formatted); // e.g. "August 5, 2025"',
619
662
  },
620
663
  {
621
664
  name: 'SystemDateToLocalDate',
622
665
  minArgs: 1,
623
666
  maxArgs: 1,
624
- description: "Converts a system date to the subscriber's local timezone.",
667
+ description:
668
+ 'Converts a date-time value from Marketing Cloud system time (CST) to the local time of the account or user.',
625
669
  params: [
626
- { name: 'date', description: 'System date to convert', type: 'string' },
670
+ { name: 'dateValue', description: 'Date-time string in system time (CST)', type: 'string' },
627
671
  ],
628
672
  returnType: 'string',
629
- syntax: 'SystemDateToLocalDate(date)',
673
+ syntax: 'SystemDateToLocalDate(dateValue)',
674
+ example: 'var systemDate = Platform.Function.Now();\nvar localDate = Platform.Function.SystemDateToLocalDate(systemDate);\nWrite(localDate);',
675
+ },
676
+ {
677
+ name: 'LocalDateToSystemDate',
678
+ minArgs: 1,
679
+ maxArgs: 1,
680
+ description:
681
+ 'Converts a date-time value from the local time of the account or user to Marketing Cloud system time (CST).',
682
+ params: [
683
+ { name: 'dateValue', description: 'Date-time string in local account/user time', type: 'string' },
684
+ ],
685
+ returnType: 'string',
686
+ syntax: 'LocalDateToSystemDate(dateValue)',
687
+ example: 'var localDate = "8/5/2025 12:00:00 PM";\nvar systemDate = Platform.Function.LocalDateToSystemDate(localDate);\nWrite(systemDate);',
630
688
  },
631
689
  {
632
690
  name: 'GetValue',
@@ -638,6 +696,7 @@ export const PLATFORM_FUNCTIONS = [
638
696
  ],
639
697
  returnType: 'string',
640
698
  syntax: 'GetValue(variableName)',
699
+ example: '// Retrieve an AMPscript variable from within SSJS:\nvar sk = Platform.Function.GetValue("SubscriberKey");\nWrite(sk);',
641
700
  },
642
701
  {
643
702
  name: 'SetValue',
@@ -650,6 +709,20 @@ export const PLATFORM_FUNCTIONS = [
650
709
  ],
651
710
  returnType: 'void',
652
711
  syntax: 'SetValue(variableName, value)',
712
+ example: 'Platform.Function.SetValue("greeting", "Hello from SSJS");\n// @greeting is now accessible in subsequent AMPscript blocks',
713
+ },
714
+ {
715
+ name: 'GetQueryStringParameter',
716
+ minArgs: 1,
717
+ maxArgs: 1,
718
+ description:
719
+ 'Retrieves the value of a named query string parameter from the URL of the current CloudPages or landing page.',
720
+ params: [
721
+ { name: 'parameterName', description: 'Name of the query string parameter to retrieve', type: 'string' },
722
+ ],
723
+ returnType: 'string',
724
+ syntax: 'GetQueryStringParameter(parameterName)',
725
+ example: '// Page URL: /mypage?email=jane@example.com\nvar email = Platform.Function.GetQueryStringParameter("email");\nWrite(email); // "jane@example.com"',
653
726
  },
654
727
  {
655
728
  name: 'RaiseError',
@@ -662,6 +735,7 @@ export const PLATFORM_FUNCTIONS = [
662
735
  ],
663
736
  returnType: 'void',
664
737
  syntax: 'RaiseError(message[, skipSend])',
738
+ example: 'var status = Platform.Function.Lookup("MyDE", "Status", "Email", emailAddress);\nif (!status) {\n Platform.Function.RaiseError("Subscriber not found", true);\n}',
665
739
  },
666
740
  {
667
741
  name: 'Redirect',
@@ -674,6 +748,7 @@ export const PLATFORM_FUNCTIONS = [
674
748
  ],
675
749
  returnType: 'void',
676
750
  syntax: 'Redirect(url[, permanent])',
751
+ example: 'Platform.Function.Redirect("https://www.example.com/thank-you");',
677
752
  },
678
753
  {
679
754
  name: 'CloudPagesURL',
@@ -702,6 +777,7 @@ export const PLATFORM_FUNCTIONS = [
702
777
  ],
703
778
  returnType: 'string',
704
779
  syntax: 'MicrositeURL(pageId[, param1, value1, ...])',
780
+ example: 'var url = Platform.Function.MicrositeURL(456, "source", "email");\nWrite(\'<a href="\' + url + \'">Visit microsite</a>\');',
705
781
  },
706
782
  {
707
783
  name: 'GUID',
@@ -724,6 +800,7 @@ export const PLATFORM_FUNCTIONS = [
724
800
  ],
725
801
  returnType: 'string',
726
802
  syntax: 'Base64Encode(value[, encoding])',
803
+ example: 'var encoded = Platform.Function.Base64Encode("username:password");\nWrite(encoded); // "dXNlcm5hbWU6cGFzc3dvcmQ="',
727
804
  },
728
805
  {
729
806
  name: 'Base64Decode',
@@ -736,6 +813,7 @@ export const PLATFORM_FUNCTIONS = [
736
813
  ],
737
814
  returnType: 'string',
738
815
  syntax: 'Base64Decode(value[, encoding])',
816
+ example: 'var decoded = Platform.Function.Base64Decode("dXNlcm5hbWU6cGFzc3dvcmQ=");\nWrite(decoded); // "username:password"',
739
817
  },
740
818
  {
741
819
  name: 'EncryptSymmetric',
@@ -754,6 +832,7 @@ export const PLATFORM_FUNCTIONS = [
754
832
  ],
755
833
  returnType: 'string',
756
834
  syntax: 'EncryptSymmetric(value, algorithm, passwordKey, password, saltKey, salt[, ivKey, iv])',
835
+ example: 'var encrypted = Platform.Function.EncryptSymmetric("sensitive data", "AES", "", "myPassword", "", "mySalt");\nWrite(encrypted);',
757
836
  },
758
837
  {
759
838
  name: 'DecryptSymmetric',
@@ -772,6 +851,7 @@ export const PLATFORM_FUNCTIONS = [
772
851
  ],
773
852
  returnType: 'string',
774
853
  syntax: 'DecryptSymmetric(value, algorithm, passwordKey, password, saltKey, salt[, ivKey, iv])',
854
+ example: 'var plain = Platform.Function.DecryptSymmetric(encryptedValue, "AES", "", "myPassword", "", "mySalt");\nWrite(plain);',
775
855
  },
776
856
  {
777
857
  name: 'SHA256',
@@ -784,6 +864,7 @@ export const PLATFORM_FUNCTIONS = [
784
864
  ],
785
865
  returnType: 'string',
786
866
  syntax: 'SHA256(value[, encoding])',
867
+ example: 'var hash = Platform.Function.SHA256(emailAddress);\nWrite(hash);',
787
868
  },
788
869
  {
789
870
  name: 'SHA512',
@@ -796,6 +877,7 @@ export const PLATFORM_FUNCTIONS = [
796
877
  ],
797
878
  returnType: 'string',
798
879
  syntax: 'SHA512(value[, encoding])',
880
+ example: 'var hash = Platform.Function.SHA512(emailAddress);\nWrite(hash);',
799
881
  },
800
882
  {
801
883
  name: 'MD5',
@@ -808,6 +890,7 @@ export const PLATFORM_FUNCTIONS = [
808
890
  ],
809
891
  returnType: 'string',
810
892
  syntax: 'MD5(value[, encoding])',
893
+ example: 'var hash = Platform.Function.MD5(emailAddress);\nWrite(hash);',
811
894
  },
812
895
  {
813
896
  name: 'IsEmailAddress',
@@ -819,6 +902,7 @@ export const PLATFORM_FUNCTIONS = [
819
902
  ],
820
903
  returnType: 'boolean',
821
904
  syntax: 'IsEmailAddress(value)',
905
+ example: 'if (Platform.Function.IsEmailAddress(emailInput)) {\n Write("Valid email");\n} else {\n Write("Invalid email format");\n}',
822
906
  },
823
907
  {
824
908
  name: 'IsNull',
@@ -830,6 +914,7 @@ export const PLATFORM_FUNCTIONS = [
830
914
  ],
831
915
  returnType: 'boolean',
832
916
  syntax: 'IsNull(value)',
917
+ example: 'var phone = Platform.Function.Lookup("MyDE", "Phone", "Email", email);\nif (Platform.Function.IsNull(phone)) {\n Write("No phone on record");\n}',
833
918
  },
834
919
  {
835
920
  name: 'Empty',
@@ -841,6 +926,7 @@ export const PLATFORM_FUNCTIONS = [
841
926
  ],
842
927
  returnType: 'boolean',
843
928
  syntax: 'Empty(value)',
929
+ example: 'var city = Platform.Function.GetQueryStringParameter("city");\nif (Platform.Function.Empty(city)) {\n city = "Unknown";\n}',
844
930
  },
845
931
  {
846
932
  name: 'IIf',
@@ -854,6 +940,7 @@ export const PLATFORM_FUNCTIONS = [
854
940
  ],
855
941
  returnType: 'any',
856
942
  syntax: 'IIf(condition, trueValue, falseValue)',
943
+ example: 'var label = Platform.Function.IIf(score > 50, "Pass", "Fail");\nWrite(label);',
857
944
  },
858
945
  {
859
946
  name: 'DataExtensionRowCount',
@@ -865,6 +952,7 @@ export const PLATFORM_FUNCTIONS = [
865
952
  ],
866
953
  returnType: 'number',
867
954
  syntax: 'DataExtensionRowCount(deName)',
955
+ example: 'var count = Platform.Function.DataExtensionRowCount("MyDE");\nWrite("Total rows: " + count);',
868
956
  },
869
957
  {
870
958
  name: 'CreateObject',
@@ -876,6 +964,7 @@ export const PLATFORM_FUNCTIONS = [
876
964
  ],
877
965
  returnType: 'object',
878
966
  syntax: 'CreateObject(objectType)',
967
+ example: 'var sub = Platform.Function.CreateObject("Subscriber");\nPlatform.Function.SetObjectProperty(sub, "EmailAddress", "jane@example.com");\nPlatform.Function.SetObjectProperty(sub, "SubscriberKey", "sk-123");',
879
968
  },
880
969
  {
881
970
  name: 'SetObjectProperty',
@@ -889,6 +978,7 @@ export const PLATFORM_FUNCTIONS = [
889
978
  ],
890
979
  returnType: 'void',
891
980
  syntax: 'SetObjectProperty(apiObject, propertyName, value)',
981
+ example: 'var sub = Platform.Function.CreateObject("Subscriber");\nPlatform.Function.SetObjectProperty(sub, "EmailAddress", "jane@example.com");',
892
982
  },
893
983
  {
894
984
  name: 'AddObjectArrayItem',
@@ -902,6 +992,7 @@ export const PLATFORM_FUNCTIONS = [
902
992
  ],
903
993
  returnType: 'void',
904
994
  syntax: 'AddObjectArrayItem(apiObject, propertyName, value)',
995
+ example: 'var ts = Platform.Function.CreateObject("TriggeredSend");\nPlatform.Function.AddObjectArrayItem(ts, "Subscribers", sub);',
905
996
  },
906
997
  {
907
998
  name: 'InvokeCreate',
@@ -916,6 +1007,7 @@ export const PLATFORM_FUNCTIONS = [
916
1007
  ],
917
1008
  returnType: 'string',
918
1009
  syntax: 'InvokeCreate(apiObject[, statusMessage, errorCode, requestId])',
1010
+ example: 'var sub = Platform.Function.CreateObject("Subscriber");\nPlatform.Function.SetObjectProperty(sub, "EmailAddress", "jane@example.com");\nvar statusMsg = "";\nvar errorCode = "";\nvar status = Platform.Function.InvokeCreate(sub, statusMsg, errorCode);\nWrite(status); // "OK" or "Error"',
919
1011
  },
920
1012
  {
921
1013
  name: 'InvokeUpdate',
@@ -930,6 +1022,7 @@ export const PLATFORM_FUNCTIONS = [
930
1022
  ],
931
1023
  returnType: 'string',
932
1024
  syntax: 'InvokeUpdate(apiObject[, statusMessage, errorCode, requestId])',
1025
+ example: 'Platform.Function.SetObjectProperty(sub, "Status", "Unsubscribed");\nvar status = Platform.Function.InvokeUpdate(sub);\nWrite(status);',
933
1026
  },
934
1027
  {
935
1028
  name: 'InvokeDelete',
@@ -944,6 +1037,7 @@ export const PLATFORM_FUNCTIONS = [
944
1037
  ],
945
1038
  returnType: 'string',
946
1039
  syntax: 'InvokeDelete(apiObject[, statusMessage, errorCode, requestId])',
1040
+ example: 'var status = Platform.Function.InvokeDelete(sub);\nWrite(status);',
947
1041
  },
948
1042
  {
949
1043
  name: 'InvokeRetrieve',
@@ -959,6 +1053,7 @@ export const PLATFORM_FUNCTIONS = [
959
1053
  ],
960
1054
  returnType: 'object',
961
1055
  syntax: 'InvokeRetrieve(apiObject, properties[, filter, statusMessage, requestId])',
1056
+ example: 'var req = Platform.Function.CreateObject("RetrieveRequest");\nPlatform.Function.SetObjectProperty(req, "ObjectType", "Subscriber");\nvar props = ["EmailAddress", "Status"];\nvar results = Platform.Function.InvokeRetrieve(req, props);',
962
1057
  },
963
1058
  {
964
1059
  name: 'InvokePerform',
@@ -973,6 +1068,7 @@ export const PLATFORM_FUNCTIONS = [
973
1068
  ],
974
1069
  returnType: 'string',
975
1070
  syntax: 'InvokePerform(apiObject, action[, statusMessage, errorCode])',
1071
+ example: 'var status = Platform.Function.InvokePerform(sendDef, "start");\nWrite(status);',
976
1072
  },
977
1073
  {
978
1074
  name: 'InvokeConfigure',
@@ -987,6 +1083,7 @@ export const PLATFORM_FUNCTIONS = [
987
1083
  ],
988
1084
  returnType: 'string',
989
1085
  syntax: 'InvokeConfigure(apiObject, action[, statusMessage, errorCode])',
1086
+ example: 'var status = Platform.Function.InvokeConfigure(configObj, "create");\nWrite(status);',
990
1087
  },
991
1088
  {
992
1089
  name: 'InvokeExecute',
@@ -1001,6 +1098,7 @@ export const PLATFORM_FUNCTIONS = [
1001
1098
  ],
1002
1099
  returnType: 'string',
1003
1100
  syntax: 'InvokeExecute(apiObject, method[, statusMessage, errorCode])',
1101
+ example: 'var status = Platform.Function.InvokeExecute(execObj, "LogUnsubEvent");\nWrite(status);',
1004
1102
  },
1005
1103
  {
1006
1104
  name: 'AttributeValue',
@@ -1012,6 +1110,7 @@ export const PLATFORM_FUNCTIONS = [
1012
1110
  ],
1013
1111
  returnType: 'string',
1014
1112
  syntax: 'AttributeValue(attributeName)',
1113
+ example: 'var phone = Platform.Function.AttributeValue("MobilePhone");\nif (phone) { Write(phone); }',
1015
1114
  },
1016
1115
  {
1017
1116
  name: 'HTTPGet',
@@ -1067,6 +1166,7 @@ export const PLATFORM_FUNCTIONS = [
1067
1166
  ],
1068
1167
  returnType: 'string',
1069
1168
  syntax: 'HTTPRequestHeader(headerName)',
1169
+ example: 'var auth = Platform.Function.HTTPRequestHeader("Authorization");\nWrite(auth); // e.g. "Bearer abc123"',
1070
1170
  },
1071
1171
  {
1072
1172
  name: 'ParseJSON',
@@ -1100,6 +1200,7 @@ export const PLATFORM_FUNCTIONS = [
1100
1200
  ],
1101
1201
  returnType: 'string',
1102
1202
  syntax: 'URLEncode(value)',
1203
+ example: 'var param = "hello world & more";\nvar encoded = Platform.Function.URLEncode(param);\nWrite("?q=" + encoded); // "?q=hello+world+%26+more"',
1103
1204
  },
1104
1205
  ];
1105
1206
 
@@ -1292,6 +1393,7 @@ export const HTTP_METHODS = [
1292
1393
  ],
1293
1394
  returnType: 'object',
1294
1395
  syntax: 'HTTP.Get(url[, headerNames, headerValues])',
1396
+ example: 'var body = HTTP.Get("https://api.example.com/data");\nvar obj = Platform.Function.ParseJSON(String(body));',
1295
1397
  },
1296
1398
  {
1297
1399
  name: 'Post',
@@ -1307,6 +1409,7 @@ export const HTTP_METHODS = [
1307
1409
  ],
1308
1410
  returnType: 'object',
1309
1411
  syntax: 'HTTP.Post(url, contentType, payload[, headerNames, headerValues])',
1412
+ example: 'var payload = Stringify({ email: "jane@example.com" });\nvar response = HTTP.Post("https://api.example.com/items", "application/json", payload);',
1310
1413
  },
1311
1414
  {
1312
1415
  name: 'GetRequest',
@@ -1316,6 +1419,7 @@ export const HTTP_METHODS = [
1316
1419
  params: [],
1317
1420
  returnType: 'object',
1318
1421
  syntax: 'HTTP.GetRequest()',
1422
+ example: 'var req = HTTP.GetRequest();\nWrite(req.Method); // "GET"',
1319
1423
  },
1320
1424
  {
1321
1425
  name: 'PostRequest',
@@ -1325,6 +1429,7 @@ export const HTTP_METHODS = [
1325
1429
  params: [],
1326
1430
  returnType: 'object',
1327
1431
  syntax: 'HTTP.PostRequest()',
1432
+ example: 'var postBody = HTTP.PostRequest();\nvar data = Platform.Function.ParseJSON(String(postBody));',
1328
1433
  },
1329
1434
  ];
1330
1435
 
@@ -1432,6 +1537,41 @@ export const WSPROXY_METHODS = [
1432
1537
  ],
1433
1538
  returnType: 'object',
1434
1539
  syntax: 'api.performItem(objectType, action, properties)',
1540
+ example: 'var api = new WSProxy();\nvar result = api.performItem("QueryDefinition", "start", { ObjectID: queryObjectId });\nWrite(result.Status);',
1541
+ },
1542
+ {
1543
+ name: 'performBatch',
1544
+ minArgs: 3,
1545
+ maxArgs: 4,
1546
+ description: 'Executes a perform action on multiple Marketing Cloud objects in a single SOAP API call.',
1547
+ params: [
1548
+ { name: 'objectType', description: 'SOAP API object type name', type: 'string' },
1549
+ { name: 'propertiesArray', description: 'Array of property objects for the action', type: 'array' },
1550
+ { name: 'verb', description: 'Action verb to execute (e.g. "start")', type: 'string' },
1551
+ { name: 'performOptions', description: 'Properties of the SOAP PerformOptions object', type: 'object', optional: true },
1552
+ ],
1553
+ returnType: 'object',
1554
+ syntax: 'api.performBatch(objectType, propertiesArray, verb[, performOptions])',
1555
+ example:
1556
+ 'var api = new Script.Util.WSProxy();\n' +
1557
+ 'var items = [{ ObjectID: id1 }, { ObjectID: id2 }];\n' +
1558
+ 'var result = api.performBatch("QueryDefinition", items, "start");\n' +
1559
+ 'Write(result.Status);',
1560
+ },
1561
+ {
1562
+ name: 'describe',
1563
+ minArgs: 1,
1564
+ maxArgs: 1,
1565
+ description: 'Returns structural metadata (ObjectDefinition) for one or more SOAP API object types.',
1566
+ params: [
1567
+ { name: 'objectType', description: 'Object type name or array of type names to describe', type: 'string' },
1568
+ ],
1569
+ returnType: 'object',
1570
+ syntax: 'api.describe(objectType)',
1571
+ example:
1572
+ 'var api = new Script.Util.WSProxy();\n' +
1573
+ 'var result = api.describe("DataExtension");\n' +
1574
+ 'Write(Stringify(result.Results));',
1435
1575
  },
1436
1576
  {
1437
1577
  name: 'execute',
@@ -1444,6 +1584,7 @@ export const WSPROXY_METHODS = [
1444
1584
  ],
1445
1585
  returnType: 'object',
1446
1586
  syntax: 'api.execute(objectType, method)',
1587
+ example: 'var api = new WSProxy();\nvar result = api.execute("DataExtensionObject", "clearData");\nWrite(result.Status);',
1447
1588
  },
1448
1589
  {
1449
1590
  name: 'setBatchSize',
@@ -1455,6 +1596,7 @@ export const WSPROXY_METHODS = [
1455
1596
  ],
1456
1597
  returnType: 'void',
1457
1598
  syntax: 'api.setBatchSize(batchSize)',
1599
+ example: 'var api = new WSProxy();\napi.setBatchSize(200); // default is 2500\nvar result = api.retrieve("DataExtension", ["Name"], {});',
1458
1600
  },
1459
1601
  {
1460
1602
  name: 'setClientId',
@@ -1482,6 +1624,7 @@ export const WSPROXY_METHODS = [
1482
1624
  ],
1483
1625
  returnType: 'object',
1484
1626
  syntax: 'api.createBatch(objectType, propertiesArray)',
1627
+ example: 'var api = new WSProxy();\nvar items = [\n { CustomerKey: "MyDE", Properties: { Property: [{ Name: "Email", Value: "a@example.com" }] } },\n { CustomerKey: "MyDE", Properties: { Property: [{ Name: "Email", Value: "b@example.com" }] } }\n];\nvar result = api.createBatch("DataExtensionObject", items);\nWrite(result.Status);',
1485
1628
  },
1486
1629
  {
1487
1630
  name: 'updateBatch',
@@ -1494,6 +1637,7 @@ export const WSPROXY_METHODS = [
1494
1637
  ],
1495
1638
  returnType: 'object',
1496
1639
  syntax: 'api.updateBatch(objectType, propertiesArray)',
1640
+ example: 'var api = new WSProxy();\nvar items = [\n { CustomerKey: "MyDE", Keys: { Key: [{ Name: "Email", Value: "a@example.com" }] }, Properties: { Property: [{ Name: "Status", Value: "active" }] } }\n];\nvar result = api.updateBatch("DataExtensionObject", items);\nWrite(result.Status);',
1497
1641
  },
1498
1642
  {
1499
1643
  name: 'deleteBatch',
@@ -1506,6 +1650,7 @@ export const WSPROXY_METHODS = [
1506
1650
  ],
1507
1651
  returnType: 'object',
1508
1652
  syntax: 'api.deleteBatch(objectType, propertiesArray)',
1653
+ example: 'var api = new WSProxy();\nvar items = [\n { CustomerKey: "MyDE", Keys: { Key: [{ Name: "Email", Value: "old@example.com" }] } }\n];\nvar result = api.deleteBatch("DataExtensionObject", items);\nWrite(result.Status);',
1509
1654
  },
1510
1655
  ];
1511
1656
 
@@ -1524,6 +1669,7 @@ export const PLATFORM_VARIABLE_METHODS = [
1524
1669
  ],
1525
1670
  returnType: 'string',
1526
1671
  syntax: 'Variable.GetValue(variableName)',
1672
+ example: 'var sk = Variable.GetValue("SubscriberKey");\nWrite(sk);',
1527
1673
  },
1528
1674
  {
1529
1675
  name: 'SetValue',
@@ -1536,6 +1682,7 @@ export const PLATFORM_VARIABLE_METHODS = [
1536
1682
  ],
1537
1683
  returnType: 'void',
1538
1684
  syntax: 'Variable.SetValue(variableName, value)',
1685
+ example: 'Variable.SetValue("greeting", "Hello from SSJS");\n// @greeting is now available in subsequent AMPscript blocks',
1539
1686
  },
1540
1687
  ];
1541
1688
 
@@ -1550,6 +1697,7 @@ export const PLATFORM_RESPONSE_METHODS = [
1550
1697
  ],
1551
1698
  returnType: 'string',
1552
1699
  syntax: 'Platform.Response.GetResponseHeader(headerName)',
1700
+ example: 'var contentType = Platform.Response.GetResponseHeader("Content-Type");\nWrite(contentType);',
1553
1701
  },
1554
1702
  {
1555
1703
  name: 'SetResponseHeader',
@@ -1562,6 +1710,7 @@ export const PLATFORM_RESPONSE_METHODS = [
1562
1710
  ],
1563
1711
  returnType: 'void',
1564
1712
  syntax: 'Platform.Response.SetResponseHeader(headerName, value)',
1713
+ example: 'Platform.Response.SetResponseHeader("Content-Type", "application/json");\nPlatform.Response.Write(Stringify({ status: "ok" }));',
1565
1714
  },
1566
1715
  {
1567
1716
  name: 'Redirect',
@@ -1576,6 +1725,7 @@ export const PLATFORM_RESPONSE_METHODS = [
1576
1725
  ],
1577
1726
  returnType: 'void',
1578
1727
  syntax: 'Platform.Response.Redirect(url[, permanent])',
1728
+ example: 'Platform.Response.Redirect("https://pub.pages.example.com/thank-you");',
1579
1729
  },
1580
1730
  {
1581
1731
  name: 'Write',
@@ -1587,6 +1737,7 @@ export const PLATFORM_RESPONSE_METHODS = [
1587
1737
  ],
1588
1738
  returnType: 'void',
1589
1739
  syntax: 'Platform.Response.Write(content)',
1740
+ example: 'var data = { name: "Jane", status: "active" };\nPlatform.Response.Write(Stringify(data));',
1590
1741
  },
1591
1742
  ];
1592
1743
 
@@ -1601,6 +1752,7 @@ export const PLATFORM_REQUEST_METHODS = [
1601
1752
  ],
1602
1753
  returnType: 'string',
1603
1754
  syntax: 'Platform.Request.GetQueryStringParameter(parameterName)',
1755
+ example: '// Page URL: /mypage?email=jane@example.com\nvar email = Platform.Request.GetQueryStringParameter("email");\nWrite(email);',
1604
1756
  },
1605
1757
  {
1606
1758
  name: 'GetFormData',
@@ -1612,6 +1764,7 @@ export const PLATFORM_REQUEST_METHODS = [
1612
1764
  ],
1613
1765
  returnType: 'string',
1614
1766
  syntax: 'Platform.Request.GetFormData(fieldName)',
1767
+ example: 'var firstName = Platform.Request.GetFormData("firstName");\nWrite("Hello, " + firstName + "!");',
1615
1768
  },
1616
1769
  {
1617
1770
  name: 'GetPostData',
@@ -1626,6 +1779,7 @@ export const PLATFORM_REQUEST_METHODS = [
1626
1779
  ],
1627
1780
  returnType: 'string',
1628
1781
  syntax: 'Platform.Request.GetPostData([encoding])',
1782
+ example: '// Read raw POST body once and store it:\nvar rawBody = Platform.Request.GetPostData();\nvar payload = Platform.Function.ParseJSON(rawBody);',
1629
1783
  },
1630
1784
  {
1631
1785
  name: 'HasSSL',
@@ -1635,6 +1789,7 @@ export const PLATFORM_REQUEST_METHODS = [
1635
1789
  params: [],
1636
1790
  returnType: 'boolean',
1637
1791
  syntax: 'Platform.Request.HasSSL()',
1792
+ example: 'if (Platform.Request.HasSSL()) {\n Write("Secure connection");\n} else {\n Platform.Response.Redirect("https://" + Platform.Request.RequestURL());\n}',
1638
1793
  },
1639
1794
  {
1640
1795
  name: 'Method',
@@ -1644,6 +1799,7 @@ export const PLATFORM_REQUEST_METHODS = [
1644
1799
  params: [],
1645
1800
  returnType: 'string',
1646
1801
  syntax: 'Platform.Request.Method()',
1802
+ example: 'var method = Platform.Request.Method();\nif (method === "POST") {\n var body = Platform.Request.GetPostData();\n // handle POST\n}',
1647
1803
  },
1648
1804
  {
1649
1805
  name: 'RequestURL',
@@ -1653,6 +1809,7 @@ export const PLATFORM_REQUEST_METHODS = [
1653
1809
  params: [],
1654
1810
  returnType: 'string',
1655
1811
  syntax: 'Platform.Request.RequestURL()',
1812
+ example: 'var url = Platform.Request.RequestURL();\nWrite("Current page: " + url);',
1656
1813
  },
1657
1814
  {
1658
1815
  name: 'GetCookieValue',
@@ -1664,6 +1821,7 @@ export const PLATFORM_REQUEST_METHODS = [
1664
1821
  ],
1665
1822
  returnType: 'string',
1666
1823
  syntax: 'Platform.Request.GetCookieValue(cookieName)',
1824
+ example: 'var sessionId = Platform.Request.GetCookieValue("sessionId");\nif (sessionId) { Write("Session: " + sessionId); }',
1667
1825
  },
1668
1826
  {
1669
1827
  name: 'GetUserLanguages',
@@ -1673,6 +1831,7 @@ export const PLATFORM_REQUEST_METHODS = [
1673
1831
  params: [],
1674
1832
  returnType: 'string',
1675
1833
  syntax: 'Platform.Request.GetUserLanguages()',
1834
+ example: 'var lang = Platform.Request.GetUserLanguages();\nWrite(lang); // e.g. "en-US,en;q=0.9"',
1676
1835
  },
1677
1836
  ];
1678
1837
 
@@ -1689,6 +1848,7 @@ export const PLATFORM_CLIENT_BROWSER_METHODS = [
1689
1848
  ],
1690
1849
  returnType: 'void',
1691
1850
  syntax: 'Platform.ClientBrowser.Redirect(url)',
1851
+ example: 'Platform.ClientBrowser.Redirect("https://www.example.com/landing");',
1692
1852
  },
1693
1853
  {
1694
1854
  name: 'Write',
@@ -1700,6 +1860,7 @@ export const PLATFORM_CLIENT_BROWSER_METHODS = [
1700
1860
  ],
1701
1861
  returnType: 'void',
1702
1862
  syntax: 'Platform.ClientBrowser.Write(content)',
1863
+ example: 'Platform.ClientBrowser.Write("<h1>Hello, World!</h1>");',
1703
1864
  },
1704
1865
  {
1705
1866
  name: 'SetCookie',
@@ -1716,6 +1877,7 @@ export const PLATFORM_CLIENT_BROWSER_METHODS = [
1716
1877
  ],
1717
1878
  returnType: 'void',
1718
1879
  syntax: 'Platform.ClientBrowser.SetCookie(name, value[, expires, path, domain, secure])',
1880
+ example: 'Platform.ClientBrowser.SetCookie("userId", subscriberKey, "12/31/2025", "/", ".example.com", true);',
1719
1881
  },
1720
1882
  {
1721
1883
  name: 'RemoveCookie',
@@ -1727,6 +1889,7 @@ export const PLATFORM_CLIENT_BROWSER_METHODS = [
1727
1889
  ],
1728
1890
  returnType: 'void',
1729
1891
  syntax: 'Platform.ClientBrowser.RemoveCookie(name)',
1892
+ example: 'Platform.ClientBrowser.RemoveCookie("userId");',
1730
1893
  },
1731
1894
  {
1732
1895
  name: 'SetResponseHeader',
@@ -1739,6 +1902,7 @@ export const PLATFORM_CLIENT_BROWSER_METHODS = [
1739
1902
  ],
1740
1903
  returnType: 'void',
1741
1904
  syntax: 'Platform.ClientBrowser.SetResponseHeader(headerName, value)',
1905
+ example: 'Platform.ClientBrowser.SetResponseHeader("Cache-Control", "no-store, no-cache");',
1742
1906
  },
1743
1907
  {
1744
1908
  name: 'RemoveResponseHeader',
@@ -1750,6 +1914,7 @@ export const PLATFORM_CLIENT_BROWSER_METHODS = [
1750
1914
  ],
1751
1915
  returnType: 'void',
1752
1916
  syntax: 'Platform.ClientBrowser.RemoveResponseHeader(headerName)',
1917
+ example: 'Platform.ClientBrowser.RemoveResponseHeader("X-Powered-By");',
1753
1918
  },
1754
1919
  ];
1755
1920
 
@@ -1757,6 +1922,34 @@ export const platformClientBrowserMethodNames = new Set(
1757
1922
  PLATFORM_CLIENT_BROWSER_METHODS.map((m) => m.name.toLowerCase()),
1758
1923
  );
1759
1924
 
1925
+ // ── Platform.Recipient methods ───────────────────────────────────────────────
1926
+ // Methods available under Platform.Recipient.* for accessing recipient/subscriber
1927
+ // attribute values and sendable data extension fields during email sends.
1928
+
1929
+ export const PLATFORM_RECIPIENT_METHODS = [
1930
+ {
1931
+ name: 'GetAttributeValue',
1932
+ minArgs: 1,
1933
+ maxArgs: 1,
1934
+ description:
1935
+ 'Returns the value of a subscriber attribute or sendable data extension field for the current recipient.',
1936
+ params: [
1937
+ {
1938
+ name: 'attributeName',
1939
+ description: 'Name of the subscriber attribute or sendable DE field to retrieve',
1940
+ type: 'string',
1941
+ },
1942
+ ],
1943
+ returnType: 'string',
1944
+ syntax: 'Platform.Recipient.GetAttributeValue(attributeName)',
1945
+ example: 'var email = Platform.Recipient.GetAttributeValue("EmailAddress");\nPlatform.Response.Write(email);',
1946
+ },
1947
+ ];
1948
+
1949
+ export const platformRecipientMethodNames = new Set(
1950
+ PLATFORM_RECIPIENT_METHODS.map((m) => m.name.toLowerCase()),
1951
+ );
1952
+
1760
1953
  // ── Script.Util HTTP constructors ────────────────────────────────────────────
1761
1954
  // Request handler constructors under the Script.Util namespace.
1762
1955
  // Instantiated with `new Script.Util.HttpRequest(url)` etc.