ssjs-data 0.4.0 → 0.4.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.
- package/dist/sfmc-globals.d.ts +90 -434
- package/package.json +1 -1
package/dist/sfmc-globals.d.ts
CHANGED
|
@@ -1551,7 +1551,7 @@ declare namespace Account {
|
|
|
1551
1551
|
* Platform.Load("core", "1.1.5");
|
|
1552
1552
|
* var myAccount = Account.Init("MyCustomerKey");
|
|
1553
1553
|
*/
|
|
1554
|
-
function Init(key: string):
|
|
1554
|
+
function Init(key: string): AccountInstance;
|
|
1555
1555
|
/**
|
|
1556
1556
|
* Retrieves accounts based on the specified filter criteria.
|
|
1557
1557
|
*
|
|
@@ -1565,6 +1565,8 @@ declare namespace Account {
|
|
|
1565
1565
|
* var getAcct = Account.Retrieve({Property:"CustomerKey",SimpleOperator:"equals",Value:"MyAccount"});
|
|
1566
1566
|
*/
|
|
1567
1567
|
function Retrieve(filter: object): object[];
|
|
1568
|
+
}
|
|
1569
|
+
interface AccountInstance {
|
|
1568
1570
|
/**
|
|
1569
1571
|
* Updates the account with the supplied attributes. If `properties` includes `TimeZoneID`, the call uses that value to update the account time zone.
|
|
1570
1572
|
*
|
|
@@ -1578,7 +1580,7 @@ declare namespace Account {
|
|
|
1578
1580
|
* var myAccount = Account.Init("MyCustomerKey");
|
|
1579
1581
|
* var status = myAccount.Update({ "FromName" : "Demo From Name" });
|
|
1580
1582
|
*/
|
|
1581
|
-
|
|
1583
|
+
Update(properties: object): string;
|
|
1582
1584
|
}
|
|
1583
1585
|
declare namespace Account.Tracking {
|
|
1584
1586
|
/**
|
|
@@ -1609,7 +1611,7 @@ declare namespace AccountUser {
|
|
|
1609
1611
|
* Platform.Load("core", "1.1.5");
|
|
1610
1612
|
* var acctUser = AccountUser.Init("myAccountUser", 123456789);
|
|
1611
1613
|
*/
|
|
1612
|
-
function Init(targetUserKey: string, myClientID: number):
|
|
1614
|
+
function Init(targetUserKey: string, myClientID: number): AccountUserInstance;
|
|
1613
1615
|
/**
|
|
1614
1616
|
* Creates a new account user from the supplied properties object.
|
|
1615
1617
|
*
|
|
@@ -1645,6 +1647,8 @@ declare namespace AccountUser {
|
|
|
1645
1647
|
* var accountUser = AccountUser.Retrieve({Property:"CustomerKey",SimpleOperator:"equals",Value:"MyAccount"});
|
|
1646
1648
|
*/
|
|
1647
1649
|
function Retrieve(filter: object): object[];
|
|
1650
|
+
}
|
|
1651
|
+
interface AccountUserInstance {
|
|
1648
1652
|
/**
|
|
1649
1653
|
* Updates the account user with the supplied attributes.
|
|
1650
1654
|
*
|
|
@@ -1658,7 +1662,7 @@ declare namespace AccountUser {
|
|
|
1658
1662
|
* var acctUser = AccountUser.Init("myAccountUser", 123456789);
|
|
1659
1663
|
* var status = acctUser.Update({ "Password": "XXXXX" });
|
|
1660
1664
|
*/
|
|
1661
|
-
|
|
1665
|
+
Update(properties: object): string;
|
|
1662
1666
|
/**
|
|
1663
1667
|
* Activates the account user.
|
|
1664
1668
|
*
|
|
@@ -1671,7 +1675,7 @@ declare namespace AccountUser {
|
|
|
1671
1675
|
* var acctUser = AccountUser.Init("myAccountUser", 123456789);
|
|
1672
1676
|
* var status = acctUser.Activate();
|
|
1673
1677
|
*/
|
|
1674
|
-
|
|
1678
|
+
Activate(): string;
|
|
1675
1679
|
/**
|
|
1676
1680
|
* Deactivates the account user. Note: account users cannot be deleted via server-side JavaScript — deactivation is the only "removal" path.
|
|
1677
1681
|
*
|
|
@@ -1684,7 +1688,7 @@ declare namespace AccountUser {
|
|
|
1684
1688
|
* var acctUser = AccountUser.Init("myAccountUser", 123456789);
|
|
1685
1689
|
* var status = acctUser.Deactivate();
|
|
1686
1690
|
*/
|
|
1687
|
-
|
|
1691
|
+
Deactivate(): string;
|
|
1688
1692
|
}
|
|
1689
1693
|
declare namespace Portfolio {
|
|
1690
1694
|
/**
|
|
@@ -1699,7 +1703,7 @@ declare namespace Portfolio {
|
|
|
1699
1703
|
* Platform.Load("core", "1.1.5");
|
|
1700
1704
|
* var portObj = Portfolio.Init("myPortfolioCK");
|
|
1701
1705
|
*/
|
|
1702
|
-
function Init(key: string):
|
|
1706
|
+
function Init(key: string): PortfolioInstance;
|
|
1703
1707
|
/**
|
|
1704
1708
|
* Creates a new portfolio (file) object from the supplied properties.
|
|
1705
1709
|
*
|
|
@@ -1733,6 +1737,8 @@ declare namespace Portfolio {
|
|
|
1733
1737
|
* var portObjArr = Portfolio.Retrieve({ Property: "CustomerKey", SimpleOperator: "equals", Value: "PortfolioObjectKey" });
|
|
1734
1738
|
*/
|
|
1735
1739
|
function Retrieve(filter: object): object[];
|
|
1740
|
+
}
|
|
1741
|
+
interface PortfolioInstance {
|
|
1736
1742
|
/**
|
|
1737
1743
|
* Updates the portfolio object with the supplied attributes.
|
|
1738
1744
|
*
|
|
@@ -1746,7 +1752,7 @@ declare namespace Portfolio {
|
|
|
1746
1752
|
* var portObj = Portfolio.Init("myPortfolioCK");
|
|
1747
1753
|
* var status = portObj.Update({ DisplayName: "Updated SSJS Image" });
|
|
1748
1754
|
*/
|
|
1749
|
-
|
|
1755
|
+
Update(properties: object): string;
|
|
1750
1756
|
/**
|
|
1751
1757
|
* Removes the previously initialized portfolio object.
|
|
1752
1758
|
*
|
|
@@ -1759,7 +1765,7 @@ declare namespace Portfolio {
|
|
|
1759
1765
|
* var portObj = Portfolio.Init("myPortfolioCK");
|
|
1760
1766
|
* var status = portObj.Remove();
|
|
1761
1767
|
*/
|
|
1762
|
-
|
|
1768
|
+
Remove(): string;
|
|
1763
1769
|
}
|
|
1764
1770
|
declare namespace ContentAreaObj {
|
|
1765
1771
|
/**
|
|
@@ -1775,7 +1781,7 @@ declare namespace ContentAreaObj {
|
|
|
1775
1781
|
* Platform.Load("core", "1.1.5");
|
|
1776
1782
|
* var area = ContentAreaObj.Init("myCA");
|
|
1777
1783
|
*/
|
|
1778
|
-
function Init(key: string):
|
|
1784
|
+
function Init(key: string): ContentAreaObjInstance;
|
|
1779
1785
|
/**
|
|
1780
1786
|
* Creates a new content area from the supplied properties. DEPRECATED — calls fail on accounts where the Content Areas feature has been retired.
|
|
1781
1787
|
*
|
|
@@ -1812,6 +1818,8 @@ declare namespace ContentAreaObj {
|
|
|
1812
1818
|
* var results = ContentAreaObj.Retrieve({ Property: "CustomerKey", SimpleOperator: "equals", Value: "myCA" });
|
|
1813
1819
|
*/
|
|
1814
1820
|
function Retrieve(filter: object): object[];
|
|
1821
|
+
}
|
|
1822
|
+
interface ContentAreaObjInstance {
|
|
1815
1823
|
/**
|
|
1816
1824
|
* Updates the content area with the supplied attributes. DEPRECATED — calls fail on accounts where the Content Areas feature has been retired.
|
|
1817
1825
|
*
|
|
@@ -1826,7 +1834,7 @@ declare namespace ContentAreaObj {
|
|
|
1826
1834
|
* var obj = ContentAreaObj.Init("myCA");
|
|
1827
1835
|
* var status = obj.Update({ Name: "Name Updated By SSJS" });
|
|
1828
1836
|
*/
|
|
1829
|
-
|
|
1837
|
+
Update(properties: object): string;
|
|
1830
1838
|
/**
|
|
1831
1839
|
* Removes the previously initialized content area. DEPRECATED — calls fail on accounts where the Content Areas feature has been retired.
|
|
1832
1840
|
*
|
|
@@ -1840,7 +1848,7 @@ declare namespace ContentAreaObj {
|
|
|
1840
1848
|
* var obj = ContentAreaObj.Init("myCA");
|
|
1841
1849
|
* var status = obj.Remove();
|
|
1842
1850
|
*/
|
|
1843
|
-
|
|
1851
|
+
Remove(): string;
|
|
1844
1852
|
}
|
|
1845
1853
|
declare namespace Folder {
|
|
1846
1854
|
/**
|
|
@@ -1858,7 +1866,7 @@ declare namespace Folder {
|
|
|
1858
1866
|
* var myIDFolder = Folder.Init();
|
|
1859
1867
|
* myIDFolder.SetID(12345);
|
|
1860
1868
|
*/
|
|
1861
|
-
function Init(key?: string):
|
|
1869
|
+
function Init(key?: string): FolderInstance;
|
|
1862
1870
|
/**
|
|
1863
1871
|
* Creates a new folder as a child of an existing folder.
|
|
1864
1872
|
*
|
|
@@ -1900,6 +1908,8 @@ declare namespace Folder {
|
|
|
1900
1908
|
* Write(Stringify(folders));
|
|
1901
1909
|
*/
|
|
1902
1910
|
function Retrieve(filter: object): object[];
|
|
1911
|
+
}
|
|
1912
|
+
interface FolderInstance {
|
|
1903
1913
|
/**
|
|
1904
1914
|
* Updates the folder with the supplied attributes.
|
|
1905
1915
|
*
|
|
@@ -1913,7 +1923,7 @@ declare namespace Folder {
|
|
|
1913
1923
|
* var myFolder = Folder.Init("myFolder");
|
|
1914
1924
|
* var status = myFolder.Update({ Name: "Updated Folder Name" });
|
|
1915
1925
|
*/
|
|
1916
|
-
|
|
1926
|
+
Update(properties: object): string;
|
|
1917
1927
|
/**
|
|
1918
1928
|
* Removes the previously initialized folder.
|
|
1919
1929
|
*
|
|
@@ -1926,7 +1936,7 @@ declare namespace Folder {
|
|
|
1926
1936
|
* var myFolder = Folder.Init("myFolder");
|
|
1927
1937
|
* myFolder.Remove();
|
|
1928
1938
|
*/
|
|
1929
|
-
|
|
1939
|
+
Remove(): string;
|
|
1930
1940
|
/**
|
|
1931
1941
|
* Binds a previously initialized Folder instance to a specific folder ID. Use this when the folder has no external key, after calling `Folder.Init()` without arguments.
|
|
1932
1942
|
*
|
|
@@ -1940,7 +1950,7 @@ declare namespace Folder {
|
|
|
1940
1950
|
* var myIDFolder = Folder.Init();
|
|
1941
1951
|
* myIDFolder.SetID(12345);
|
|
1942
1952
|
*/
|
|
1943
|
-
|
|
1953
|
+
SetID(id: number): void;
|
|
1944
1954
|
}
|
|
1945
1955
|
declare namespace Template {
|
|
1946
1956
|
/**
|
|
@@ -1955,7 +1965,7 @@ declare namespace Template {
|
|
|
1955
1965
|
* Platform.Load("core", "1");
|
|
1956
1966
|
* var t = Template.Init("myTemplate");
|
|
1957
1967
|
*/
|
|
1958
|
-
function Init(key: string):
|
|
1968
|
+
function Init(key: string): TemplateInstance;
|
|
1959
1969
|
/**
|
|
1960
1970
|
* Creates a new template from the supplied properties.
|
|
1961
1971
|
*
|
|
@@ -1987,6 +1997,8 @@ declare namespace Template {
|
|
|
1987
1997
|
* var getTemplate = Template.Retrieve({ Property: "CustomerKey", SimpleOperator: "equals", Value: "MyTemplate" });
|
|
1988
1998
|
*/
|
|
1989
1999
|
function Retrieve(filter: object): object[];
|
|
2000
|
+
}
|
|
2001
|
+
interface TemplateInstance {
|
|
1990
2002
|
/**
|
|
1991
2003
|
* Updates the template with the supplied attributes.
|
|
1992
2004
|
*
|
|
@@ -2000,7 +2012,7 @@ declare namespace Template {
|
|
|
2000
2012
|
* var myTemplate = Template.Init("myTemplateCK");
|
|
2001
2013
|
* var status = myTemplate.Update({ TemplateName: "Edited Template" });
|
|
2002
2014
|
*/
|
|
2003
|
-
|
|
2015
|
+
Update(properties: object): string;
|
|
2004
2016
|
}
|
|
2005
2017
|
declare namespace DeliveryProfile {
|
|
2006
2018
|
/**
|
|
@@ -2015,7 +2027,7 @@ declare namespace DeliveryProfile {
|
|
|
2015
2027
|
* Platform.Load("core", "1");
|
|
2016
2028
|
* var myProfile = DeliveryProfile.Init("myDeliveryProfile");
|
|
2017
2029
|
*/
|
|
2018
|
-
function Init(key: string):
|
|
2030
|
+
function Init(key: string): DeliveryProfileInstance;
|
|
2019
2031
|
/**
|
|
2020
2032
|
* Creates a new delivery profile from the supplied properties.
|
|
2021
2033
|
*
|
|
@@ -2035,6 +2047,8 @@ declare namespace DeliveryProfile {
|
|
|
2035
2047
|
* var status = DeliveryProfile.Add(newDP);
|
|
2036
2048
|
*/
|
|
2037
2049
|
function Add(properties: object): string;
|
|
2050
|
+
}
|
|
2051
|
+
interface DeliveryProfileInstance {
|
|
2038
2052
|
/**
|
|
2039
2053
|
* Updates the delivery profile with the supplied attributes.
|
|
2040
2054
|
*
|
|
@@ -2048,7 +2062,7 @@ declare namespace DeliveryProfile {
|
|
|
2048
2062
|
* var myProfile = DeliveryProfile.Init("myDeliveryProfile");
|
|
2049
2063
|
* var status = myProfile.Update({ Name: "SSJS Updated Delivery Profile" });
|
|
2050
2064
|
*/
|
|
2051
|
-
|
|
2065
|
+
Update(properties: object): string;
|
|
2052
2066
|
/**
|
|
2053
2067
|
* Removes the previously initialized delivery profile.
|
|
2054
2068
|
*
|
|
@@ -2061,7 +2075,7 @@ declare namespace DeliveryProfile {
|
|
|
2061
2075
|
* var myProfile = DeliveryProfile.Init("myDeliveryProfile");
|
|
2062
2076
|
* var status = myProfile.Remove();
|
|
2063
2077
|
*/
|
|
2064
|
-
|
|
2078
|
+
Remove(): string;
|
|
2065
2079
|
}
|
|
2066
2080
|
declare namespace SenderProfile {
|
|
2067
2081
|
/**
|
|
@@ -2076,7 +2090,7 @@ declare namespace SenderProfile {
|
|
|
2076
2090
|
* Platform.Load("core", "1");
|
|
2077
2091
|
* var myProfile = SenderProfile.Init("mySenderProfile");
|
|
2078
2092
|
*/
|
|
2079
|
-
function Init(key: string):
|
|
2093
|
+
function Init(key: string): SenderProfileInstance;
|
|
2080
2094
|
/**
|
|
2081
2095
|
* Creates a new sender profile from the supplied properties.
|
|
2082
2096
|
*
|
|
@@ -2097,6 +2111,8 @@ declare namespace SenderProfile {
|
|
|
2097
2111
|
* var status = SenderProfile.Add(newSP);
|
|
2098
2112
|
*/
|
|
2099
2113
|
function Add(properties: object): string;
|
|
2114
|
+
}
|
|
2115
|
+
interface SenderProfileInstance {
|
|
2100
2116
|
/**
|
|
2101
2117
|
* Updates the sender profile with the supplied attributes.
|
|
2102
2118
|
*
|
|
@@ -2110,7 +2126,7 @@ declare namespace SenderProfile {
|
|
|
2110
2126
|
* var myProfile = SenderProfile.Init("mySenderProfile");
|
|
2111
2127
|
* var status = myProfile.Update({ Name: "SSJS Updated Sender Profile" });
|
|
2112
2128
|
*/
|
|
2113
|
-
|
|
2129
|
+
Update(properties: object): string;
|
|
2114
2130
|
/**
|
|
2115
2131
|
* Removes the previously initialized sender profile.
|
|
2116
2132
|
*
|
|
@@ -2123,7 +2139,7 @@ declare namespace SenderProfile {
|
|
|
2123
2139
|
* var myProfile = SenderProfile.Init("mySenderProfile");
|
|
2124
2140
|
* var status = myProfile.Remove();
|
|
2125
2141
|
*/
|
|
2126
|
-
|
|
2142
|
+
Remove(): string;
|
|
2127
2143
|
}
|
|
2128
2144
|
declare namespace SendClassification {
|
|
2129
2145
|
/**
|
|
@@ -2138,7 +2154,7 @@ declare namespace SendClassification {
|
|
|
2138
2154
|
* Platform.Load("core", "1");
|
|
2139
2155
|
* var sc = SendClassification.Init("mySendClassification");
|
|
2140
2156
|
*/
|
|
2141
|
-
function Init(key: string):
|
|
2157
|
+
function Init(key: string): SendClassificationInstance;
|
|
2142
2158
|
/**
|
|
2143
2159
|
* Creates a new send classification from the supplied properties.
|
|
2144
2160
|
*
|
|
@@ -2172,6 +2188,8 @@ declare namespace SendClassification {
|
|
|
2172
2188
|
* var results = SendClassification.Retrieve({ Property: "CustomerKey", SimpleOperator: "equals", Value: "mySendClassification" });
|
|
2173
2189
|
*/
|
|
2174
2190
|
function Retrieve(filter: object): object[];
|
|
2191
|
+
}
|
|
2192
|
+
interface SendClassificationInstance {
|
|
2175
2193
|
/**
|
|
2176
2194
|
* Updates the send classification with the supplied attributes. You must include both `SenderProfileKey` and `DeliveryProfileKey` in `properties` for the update to succeed.
|
|
2177
2195
|
*
|
|
@@ -2190,7 +2208,7 @@ declare namespace SendClassification {
|
|
|
2190
2208
|
* };
|
|
2191
2209
|
* var status = sc.Update(updatedSC);
|
|
2192
2210
|
*/
|
|
2193
|
-
|
|
2211
|
+
Update(properties: object): string;
|
|
2194
2212
|
/**
|
|
2195
2213
|
* Removes the previously initialized send classification.
|
|
2196
2214
|
*
|
|
@@ -2203,7 +2221,7 @@ declare namespace SendClassification {
|
|
|
2203
2221
|
* var sc = SendClassification.Init("mySendClassification");
|
|
2204
2222
|
* var status = sc.Remove();
|
|
2205
2223
|
*/
|
|
2206
|
-
|
|
2224
|
+
Remove(): string;
|
|
2207
2225
|
}
|
|
2208
2226
|
declare namespace FilterDefinition {
|
|
2209
2227
|
/**
|
|
@@ -2218,7 +2236,7 @@ declare namespace FilterDefinition {
|
|
|
2218
2236
|
* Platform.Load("core", "1");
|
|
2219
2237
|
* var fd = FilterDefinition.Init("myFilterDef");
|
|
2220
2238
|
*/
|
|
2221
|
-
function Init(key: string):
|
|
2239
|
+
function Init(key: string): FilterDefinitionInstance;
|
|
2222
2240
|
/**
|
|
2223
2241
|
* Creates a new filter definition from the supplied properties. The `Filter` field accepts either a simple `{Property, SimpleOperator, Value}` filter or a complex filter with `LeftOperand`, `LogicalOperator`, `RightOperand`. `DataSource.Type` must be `"SubscriberList"` or `"DataExtension"`.
|
|
2224
2242
|
*
|
|
@@ -2252,6 +2270,8 @@ declare namespace FilterDefinition {
|
|
|
2252
2270
|
* var results = FilterDefinition.Retrieve({ Property: "CustomerKey", SimpleOperator: "equals", Value: "myFilterDef" });
|
|
2253
2271
|
*/
|
|
2254
2272
|
function Retrieve(filter: object): object[];
|
|
2273
|
+
}
|
|
2274
|
+
interface FilterDefinitionInstance {
|
|
2255
2275
|
/**
|
|
2256
2276
|
* Updates the filter definition with the supplied attributes.
|
|
2257
2277
|
*
|
|
@@ -2265,7 +2285,7 @@ declare namespace FilterDefinition {
|
|
|
2265
2285
|
* var fd = FilterDefinition.Init("myFilterDef");
|
|
2266
2286
|
* var status = fd.Update({ Name: "Updated Name" });
|
|
2267
2287
|
*/
|
|
2268
|
-
|
|
2288
|
+
Update(properties: object): string;
|
|
2269
2289
|
/**
|
|
2270
2290
|
* Deletes the previously initialized filter definition.
|
|
2271
2291
|
*
|
|
@@ -2278,7 +2298,7 @@ declare namespace FilterDefinition {
|
|
|
2278
2298
|
* var myFD = FilterDefinition.Init("myFilterDef");
|
|
2279
2299
|
* myFD.Remove();
|
|
2280
2300
|
*/
|
|
2281
|
-
|
|
2301
|
+
Remove(): string;
|
|
2282
2302
|
}
|
|
2283
2303
|
declare namespace QueryDefinition {
|
|
2284
2304
|
/**
|
|
@@ -2293,7 +2313,7 @@ declare namespace QueryDefinition {
|
|
|
2293
2313
|
* Platform.Load("core", "1");
|
|
2294
2314
|
* var qd = QueryDefinition.Init("myQueryDef");
|
|
2295
2315
|
*/
|
|
2296
|
-
function Init(key: string):
|
|
2316
|
+
function Init(key: string): QueryDefinitionInstance;
|
|
2297
2317
|
/**
|
|
2298
2318
|
* Creates a new query definition from the supplied properties. Pass an optional `CategoryID` to place the query inside a specific folder.
|
|
2299
2319
|
*
|
|
@@ -2333,6 +2353,8 @@ declare namespace QueryDefinition {
|
|
|
2333
2353
|
* Write(Stringify(result));
|
|
2334
2354
|
*/
|
|
2335
2355
|
function Retrieve(filter: object): object[];
|
|
2356
|
+
}
|
|
2357
|
+
interface QueryDefinitionInstance {
|
|
2336
2358
|
/**
|
|
2337
2359
|
* Updates the query definition with the supplied attributes.
|
|
2338
2360
|
*
|
|
@@ -2349,7 +2371,7 @@ declare namespace QueryDefinition {
|
|
|
2349
2371
|
* QueryText: "SELECT SubKey, Email, Name FROM [Example Target DE] where FavoriteItemID=12"
|
|
2350
2372
|
* });
|
|
2351
2373
|
*/
|
|
2352
|
-
|
|
2374
|
+
Update(properties: object): string;
|
|
2353
2375
|
/**
|
|
2354
2376
|
* Removes the previously initialized query definition.
|
|
2355
2377
|
*
|
|
@@ -2362,7 +2384,7 @@ declare namespace QueryDefinition {
|
|
|
2362
2384
|
* var qd = QueryDefinition.Init("myQueryDef");
|
|
2363
2385
|
* var status = qd.Remove();
|
|
2364
2386
|
*/
|
|
2365
|
-
|
|
2387
|
+
Remove(): string;
|
|
2366
2388
|
/**
|
|
2367
2389
|
* Executes the query definition. Runs the SQL and writes results into the configured target Data Extension.
|
|
2368
2390
|
*
|
|
@@ -2377,7 +2399,7 @@ declare namespace QueryDefinition {
|
|
|
2377
2399
|
* var result = qd.Perform("start");
|
|
2378
2400
|
* Write(Stringify(result));
|
|
2379
2401
|
*/
|
|
2380
|
-
|
|
2402
|
+
Perform(action: string): string;
|
|
2381
2403
|
}
|
|
2382
2404
|
declare namespace List {
|
|
2383
2405
|
/**
|
|
@@ -2392,7 +2414,7 @@ declare namespace List {
|
|
|
2392
2414
|
* Platform.Load("core", "1");
|
|
2393
2415
|
* var myList = List.Init("myList");
|
|
2394
2416
|
*/
|
|
2395
|
-
function Init(key: string):
|
|
2417
|
+
function Init(key: string): ListInstance;
|
|
2396
2418
|
/**
|
|
2397
2419
|
* Creates a new list from the supplied properties and returns an initialized list instance. Note: unlike most static `Add` methods, this returns a `ListInstance`, not `"OK"`.
|
|
2398
2420
|
*
|
|
@@ -2405,7 +2427,7 @@ declare namespace List {
|
|
|
2405
2427
|
* Platform.Load("core", "1.1.5");
|
|
2406
2428
|
* var myNewList = List.Add({ CustomerKey: "libList", Name: "testLib", Description: "desc" });
|
|
2407
2429
|
*/
|
|
2408
|
-
function Add(properties: object):
|
|
2430
|
+
function Add(properties: object): ListInstance;
|
|
2409
2431
|
/**
|
|
2410
2432
|
* Returns an array of lists matching the specified filter.
|
|
2411
2433
|
*
|
|
@@ -2419,6 +2441,8 @@ declare namespace List {
|
|
|
2419
2441
|
* var lists = List.Retrieve({ Property: "ListName", SimpleOperator: "equals", Value: "BirthdayList" });
|
|
2420
2442
|
*/
|
|
2421
2443
|
function Retrieve(filter: object): object[];
|
|
2444
|
+
}
|
|
2445
|
+
interface ListInstance {
|
|
2422
2446
|
/**
|
|
2423
2447
|
* Removes the previously initialized list.
|
|
2424
2448
|
*
|
|
@@ -2431,101 +2455,7 @@ declare namespace List {
|
|
|
2431
2455
|
* var myList = List.Init("myList");
|
|
2432
2456
|
* var status = myList.Remove();
|
|
2433
2457
|
*/
|
|
2434
|
-
|
|
2435
|
-
}
|
|
2436
|
-
declare namespace List.Subscribers {
|
|
2437
|
-
/**
|
|
2438
|
-
* Adds a subscriber to the previously initialized list.
|
|
2439
|
-
*
|
|
2440
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/list-subscribers/)
|
|
2441
|
-
*
|
|
2442
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2443
|
-
* @param properties - Object containing subscriber properties (EmailAddress, SubscriberKey, optionally list status).
|
|
2444
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
2445
|
-
* @example
|
|
2446
|
-
* Platform.Load("core", "1");
|
|
2447
|
-
* var list = List.Init("MY_LIST_KEY");
|
|
2448
|
-
* var result = list.Subscribers.Add({
|
|
2449
|
-
* EmailAddress: "test@example.com",
|
|
2450
|
-
* SubscriberKey: "test@example.com"
|
|
2451
|
-
* });
|
|
2452
|
-
* Write(Stringify(result));
|
|
2453
|
-
*/
|
|
2454
|
-
function Add(properties: object): string;
|
|
2455
|
-
/**
|
|
2456
|
-
* Returns the subscribers belonging to the previously initialized list. Pass an optional filter to narrow the results; omit it to return all subscribers on the list.
|
|
2457
|
-
*
|
|
2458
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/list-subscribers/)
|
|
2459
|
-
*
|
|
2460
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2461
|
-
* @param filter - Optional WSProxy-style filter object to narrow the results.
|
|
2462
|
-
* @returns List of subscriber objects on the list (filtered when a filter is supplied).
|
|
2463
|
-
* @example
|
|
2464
|
-
* Platform.Load("core", "1");
|
|
2465
|
-
* var list = List.Init("MY_LIST_KEY");
|
|
2466
|
-
* var subscribers = list.Subscribers.Retrieve();
|
|
2467
|
-
*/
|
|
2468
|
-
function Retrieve(filter?: object): object[];
|
|
2469
|
-
/**
|
|
2470
|
-
* Removes the specified subscriber from the previously initialized list.
|
|
2471
|
-
*
|
|
2472
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/list-subscribers/)
|
|
2473
|
-
*
|
|
2474
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2475
|
-
* @param emailAddress - Email address of the subscriber, or a `{EmailAddress, SubscriberKey}` object identifying the subscriber.
|
|
2476
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
2477
|
-
* @example
|
|
2478
|
-
* Platform.Load("core", "1.1.5");
|
|
2479
|
-
* var myList = List.Init("myList");
|
|
2480
|
-
* var status = myList.Subscribers.Unsubscribe("aruiz@example.com");
|
|
2481
|
-
*/
|
|
2482
|
-
function Unsubscribe(emailAddress: string): string;
|
|
2483
|
-
/**
|
|
2484
|
-
* Updates the status of the specified subscriber on the previously initialized list.
|
|
2485
|
-
*
|
|
2486
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/list-subscribers/)
|
|
2487
|
-
*
|
|
2488
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2489
|
-
* @param emailAddress - Email address of the subscriber, or a `{EmailAddress, SubscriberKey}` object identifying the subscriber.
|
|
2490
|
-
* @param status - New status of the subscriber on the list.
|
|
2491
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
2492
|
-
* @example
|
|
2493
|
-
* Platform.Load("core", "1.1.5");
|
|
2494
|
-
* var myList = List.Init("myList");
|
|
2495
|
-
* var status = myList.Subscribers.Update("aruiz@example.com", "Active");
|
|
2496
|
-
*/
|
|
2497
|
-
function Update(emailAddress: string, status: string): string;
|
|
2498
|
-
/**
|
|
2499
|
-
* Adds the subscriber if not on the list, otherwise updates the supplied attributes. If `attributes.Status` is supplied, the subscriber's list status is updated.
|
|
2500
|
-
*
|
|
2501
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/list-subscribers/)
|
|
2502
|
-
*
|
|
2503
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2504
|
-
* @param emailAddress - Email address of the subscriber, or a `{EmailAddress, SubscriberKey}` object identifying the subscriber.
|
|
2505
|
-
* @param attributes - Additional subscriber attributes to set or update.
|
|
2506
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
2507
|
-
* @example
|
|
2508
|
-
* Platform.Load("core", "1.1.5");
|
|
2509
|
-
* var myList = List.Init("myList");
|
|
2510
|
-
* var status = myList.Subscribers.Upsert("aruiz@example.com", { ZipCode: "46202" });
|
|
2511
|
-
*/
|
|
2512
|
-
function Upsert(emailAddress: string, attributes: object): string;
|
|
2513
|
-
}
|
|
2514
|
-
declare namespace List.Subscribers.Tracking {
|
|
2515
|
-
/**
|
|
2516
|
-
* Returns an array of tracking data for subscribers matching the filter.
|
|
2517
|
-
*
|
|
2518
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/list-subscribers/)
|
|
2519
|
-
*
|
|
2520
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2521
|
-
* @param filter - PascalCase WSProxy-style filter object identifying the subscribers.
|
|
2522
|
-
* @returns List of tracking records matching the filter.
|
|
2523
|
-
* @example
|
|
2524
|
-
* Platform.Load("core", "1.1.5");
|
|
2525
|
-
* var myList = List.Init("MyList");
|
|
2526
|
-
* var results = myList.Subscribers.Tracking.Retrieve({ Property: "SubscriberKey", SimpleOperator: "equals", Value: "MyKey" });
|
|
2527
|
-
*/
|
|
2528
|
-
function Retrieve(filter: object): object[];
|
|
2458
|
+
Remove(): string;
|
|
2529
2459
|
}
|
|
2530
2460
|
declare namespace Subscriber {
|
|
2531
2461
|
/**
|
|
@@ -2540,7 +2470,7 @@ declare namespace Subscriber {
|
|
|
2540
2470
|
* Platform.Load("core", "1");
|
|
2541
2471
|
* var sub = Subscriber.Init("mySubscriber");
|
|
2542
2472
|
*/
|
|
2543
|
-
function Init(key: string):
|
|
2473
|
+
function Init(key: string): SubscriberInstance;
|
|
2544
2474
|
/**
|
|
2545
2475
|
* Creates a new subscriber from the supplied properties.
|
|
2546
2476
|
*
|
|
@@ -2607,6 +2537,8 @@ declare namespace Subscriber {
|
|
|
2607
2537
|
* Write(Stringify(stats));
|
|
2608
2538
|
*/
|
|
2609
2539
|
function Statistics(subscriberKey: string): object;
|
|
2540
|
+
}
|
|
2541
|
+
interface SubscriberInstance {
|
|
2610
2542
|
/**
|
|
2611
2543
|
* Updates the previously initialized subscriber with the supplied attributes.
|
|
2612
2544
|
*
|
|
@@ -2620,7 +2552,7 @@ declare namespace Subscriber {
|
|
|
2620
2552
|
* var subObj = Subscriber.Init("SubKey");
|
|
2621
2553
|
* var status = subObj.Update({ EmailTypePreference: "HTML", Attributes: { "First Name": "Test", "Last Name": "User" } });
|
|
2622
2554
|
*/
|
|
2623
|
-
|
|
2555
|
+
Update(properties: object): string;
|
|
2624
2556
|
/**
|
|
2625
2557
|
* Deletes the previously initialized subscriber.
|
|
2626
2558
|
*
|
|
@@ -2633,7 +2565,7 @@ declare namespace Subscriber {
|
|
|
2633
2565
|
* var subObj = Subscriber.Init("SubKey");
|
|
2634
2566
|
* var status = subObj.Remove();
|
|
2635
2567
|
*/
|
|
2636
|
-
|
|
2568
|
+
Remove(): string;
|
|
2637
2569
|
/**
|
|
2638
2570
|
* Sets the previously initialized subscriber's status to `"Unsubscribed"`.
|
|
2639
2571
|
*
|
|
@@ -2646,37 +2578,7 @@ declare namespace Subscriber {
|
|
|
2646
2578
|
* var subObj = Subscriber.Init("SubKey");
|
|
2647
2579
|
* var status = subObj.Unsubscribe();
|
|
2648
2580
|
*/
|
|
2649
|
-
|
|
2650
|
-
}
|
|
2651
|
-
declare namespace Subscriber.Attributes {
|
|
2652
|
-
/**
|
|
2653
|
-
* Returns an array of attributes associated with the previously initialized subscriber.
|
|
2654
|
-
*
|
|
2655
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/subscriber/)
|
|
2656
|
-
*
|
|
2657
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2658
|
-
* @returns List of attribute objects for the subscriber.
|
|
2659
|
-
* @example
|
|
2660
|
-
* Platform.Load("core", "1.1.5");
|
|
2661
|
-
* var subObj = Subscriber.Init("SubKey");
|
|
2662
|
-
* var attributes = subObj.Attributes.Retrieve();
|
|
2663
|
-
*/
|
|
2664
|
-
function Retrieve(): object[];
|
|
2665
|
-
}
|
|
2666
|
-
declare namespace Subscriber.Lists {
|
|
2667
|
-
/**
|
|
2668
|
-
* Returns the lists the previously initialized subscriber is a member of.
|
|
2669
|
-
*
|
|
2670
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/subscriber/)
|
|
2671
|
-
*
|
|
2672
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2673
|
-
* @returns List of list objects the subscriber belongs to.
|
|
2674
|
-
* @example
|
|
2675
|
-
* Platform.Load("core", "1.1.5");
|
|
2676
|
-
* var subObj = Subscriber.Init("SubKey");
|
|
2677
|
-
* var listArray = subObj.Lists.Retrieve();
|
|
2678
|
-
*/
|
|
2679
|
-
function Retrieve(): object[];
|
|
2581
|
+
Unsubscribe(): string;
|
|
2680
2582
|
}
|
|
2681
2583
|
declare namespace Email {
|
|
2682
2584
|
/**
|
|
@@ -2691,7 +2593,7 @@ declare namespace Email {
|
|
|
2691
2593
|
* Platform.Load("core", "1");
|
|
2692
2594
|
* var myEmail = Email.Init("myEmail");
|
|
2693
2595
|
*/
|
|
2694
|
-
function Init(key: string):
|
|
2596
|
+
function Init(key: string): EmailInstance;
|
|
2695
2597
|
/**
|
|
2696
2598
|
* Creates a new email message from the supplied properties and returns an initialized email instance. Note: unlike most static `Add` methods, this returns an `EmailInstance`, not `"OK"`.
|
|
2697
2599
|
*
|
|
@@ -2713,7 +2615,7 @@ declare namespace Email {
|
|
|
2713
2615
|
* };
|
|
2714
2616
|
* var myEmail = Email.Add(newMail);
|
|
2715
2617
|
*/
|
|
2716
|
-
function Add(properties: object):
|
|
2618
|
+
function Add(properties: object): EmailInstance;
|
|
2717
2619
|
/**
|
|
2718
2620
|
* Returns an array of email messages matching the specified filter.
|
|
2719
2621
|
*
|
|
@@ -2727,6 +2629,8 @@ declare namespace Email {
|
|
|
2727
2629
|
* var results = Email.Retrieve({ Property: "CustomerKey", SimpleOperator: "equals", Value: "myEmail" });
|
|
2728
2630
|
*/
|
|
2729
2631
|
function Retrieve(filter: object): object[];
|
|
2632
|
+
}
|
|
2633
|
+
interface EmailInstance {
|
|
2730
2634
|
/**
|
|
2731
2635
|
* Updates the email message with the supplied attributes.
|
|
2732
2636
|
*
|
|
@@ -2740,7 +2644,7 @@ declare namespace Email {
|
|
|
2740
2644
|
* var myEmail = Email.Init("myEmail");
|
|
2741
2645
|
* var status = myEmail.Update({ Name: "Updated Name", Subject: "Updated Email Subject" });
|
|
2742
2646
|
*/
|
|
2743
|
-
|
|
2647
|
+
Update(properties: object): string;
|
|
2744
2648
|
/**
|
|
2745
2649
|
* Removes the previously initialized email message.
|
|
2746
2650
|
*
|
|
@@ -2753,7 +2657,7 @@ declare namespace Email {
|
|
|
2753
2657
|
* var myEmail = Email.Init("myEmail");
|
|
2754
2658
|
* myEmail.Remove();
|
|
2755
2659
|
*/
|
|
2756
|
-
|
|
2660
|
+
Remove(): string;
|
|
2757
2661
|
/**
|
|
2758
2662
|
* Runs validation checks on the previously initialized email message. Returns a `{Task: {ValidationStatus: boolean, ValidationMessages: string}}` object.
|
|
2759
2663
|
*
|
|
@@ -2768,7 +2672,7 @@ declare namespace Email {
|
|
|
2768
2672
|
* Write(results.Task.ValidationStatus);
|
|
2769
2673
|
* Write(results.Task.ValidationMessages);
|
|
2770
2674
|
*/
|
|
2771
|
-
|
|
2675
|
+
Validate(): object;
|
|
2772
2676
|
/**
|
|
2773
2677
|
* Runs content checks on the previously initialized email message. Returns a `{Task: {CheckPassed: boolean, ResultMessage: string}}` object.
|
|
2774
2678
|
*
|
|
@@ -2783,7 +2687,7 @@ declare namespace Email {
|
|
|
2783
2687
|
* Write(results.Task.CheckPassed);
|
|
2784
2688
|
* Write(results.Task.ResultMessage);
|
|
2785
2689
|
*/
|
|
2786
|
-
|
|
2690
|
+
CheckContent(): object;
|
|
2787
2691
|
}
|
|
2788
2692
|
declare namespace Send {
|
|
2789
2693
|
/**
|
|
@@ -2798,7 +2702,7 @@ declare namespace Send {
|
|
|
2798
2702
|
* Platform.Load("core", "1");
|
|
2799
2703
|
* var s = Send.Init(12345);
|
|
2800
2704
|
*/
|
|
2801
|
-
function Init(id: number):
|
|
2705
|
+
function Init(id: number): SendInstance;
|
|
2802
2706
|
/**
|
|
2803
2707
|
* Creates a new send to the specified email and list(s). Pass an `options` object to override From name, From address, subject, send time, etc.
|
|
2804
2708
|
*
|
|
@@ -2842,6 +2746,8 @@ declare namespace Send {
|
|
|
2842
2746
|
* var listsSentTo = Send.RetrieveLists({ Property: "SendID", SimpleOperator: "equals", Value: 12345 });
|
|
2843
2747
|
*/
|
|
2844
2748
|
function RetrieveLists(filter: object): object[];
|
|
2749
|
+
}
|
|
2750
|
+
interface SendInstance {
|
|
2845
2751
|
/**
|
|
2846
2752
|
* Removes the previously initialized send.
|
|
2847
2753
|
*
|
|
@@ -2854,7 +2760,7 @@ declare namespace Send {
|
|
|
2854
2760
|
* var s = Send.Init(12345);
|
|
2855
2761
|
* s.Remove();
|
|
2856
2762
|
*/
|
|
2857
|
-
|
|
2763
|
+
Remove(): string;
|
|
2858
2764
|
/**
|
|
2859
2765
|
* Attempts to cancel the previously initialized send.
|
|
2860
2766
|
*
|
|
@@ -2867,7 +2773,7 @@ declare namespace Send {
|
|
|
2867
2773
|
* var mySend = Send.Init(12345);
|
|
2868
2774
|
* var status = mySend.CancelSend();
|
|
2869
2775
|
*/
|
|
2870
|
-
|
|
2776
|
+
CancelSend(): string;
|
|
2871
2777
|
}
|
|
2872
2778
|
declare namespace Send.Tracking {
|
|
2873
2779
|
/**
|
|
@@ -2883,37 +2789,6 @@ declare namespace Send.Tracking {
|
|
|
2883
2789
|
* var sendTracking = Send.Tracking.Retrieve({ Property: "SendID", SimpleOperator: "equals", Value: 12345 });
|
|
2884
2790
|
*/
|
|
2885
2791
|
function Retrieve(filter: object): object[];
|
|
2886
|
-
/**
|
|
2887
|
-
* Returns click tracking data for the previously initialized send.
|
|
2888
|
-
*
|
|
2889
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/send/)
|
|
2890
|
-
*
|
|
2891
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2892
|
-
* @param filter - WSProxy-style filter restricting results.
|
|
2893
|
-
* @returns List of click tracking records matching the filter.
|
|
2894
|
-
* @example
|
|
2895
|
-
* Platform.Load("core", "1.1.5");
|
|
2896
|
-
* var singleSend = Send.Init(12345);
|
|
2897
|
-
* var results = singleSend.Tracking.ClickRetrieve({ Property: "ID", SimpleOperator: "equals", Value: 12345 });
|
|
2898
|
-
*/
|
|
2899
|
-
function ClickRetrieve(filter: object): object[];
|
|
2900
|
-
/**
|
|
2901
|
-
* Returns aggregated tracking data for the previously initialized send. Aggregates by `type` over the date range, grouped by `groupBy`.
|
|
2902
|
-
*
|
|
2903
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/send/)
|
|
2904
|
-
*
|
|
2905
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
2906
|
-
* @param type - Type of data to aggregate.
|
|
2907
|
-
* @param startDate - Start date of the data period (MM-DD-YYYY).
|
|
2908
|
-
* @param endDate - End date of the data period (MM-DD-YYYY).
|
|
2909
|
-
* @param groupBy - Interval used to aggregate data.
|
|
2910
|
-
* @returns List of aggregated tracking records.
|
|
2911
|
-
* @example
|
|
2912
|
-
* Platform.Load("core", "1.1.5");
|
|
2913
|
-
* var singleSend = Send.Init(12345);
|
|
2914
|
-
* var results = singleSend.Tracking.TotalByIntervalRetrieve("Click", "07-01-2010", "07-31-2010", "day");
|
|
2915
|
-
*/
|
|
2916
|
-
function TotalByIntervalRetrieve(type: string, startDate: string, endDate: string, groupBy: string): object[];
|
|
2917
2792
|
}
|
|
2918
2793
|
declare namespace Send.Definition {
|
|
2919
2794
|
/**
|
|
@@ -2928,7 +2803,7 @@ declare namespace Send.Definition {
|
|
|
2928
2803
|
* Platform.Load("core", "1.1.5");
|
|
2929
2804
|
* var esd = Send.Definition.Init("myESD");
|
|
2930
2805
|
*/
|
|
2931
|
-
function Init(key: string):
|
|
2806
|
+
function Init(key: string): SendDefinitionInstance;
|
|
2932
2807
|
/**
|
|
2933
2808
|
* Creates a new send definition.
|
|
2934
2809
|
*
|
|
@@ -2995,46 +2870,6 @@ declare namespace Send.Definition {
|
|
|
2995
2870
|
* var esd = Send.Definition.Retrieve({ Property: "CustomerKey", SimpleOperator: "equals", Value: "ssjs_test_esd" });
|
|
2996
2871
|
*/
|
|
2997
2872
|
function Retrieve(filter?: object): object[];
|
|
2998
|
-
/**
|
|
2999
|
-
* Updates the previously initialized send definition.
|
|
3000
|
-
*
|
|
3001
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/senddefinition/)
|
|
3002
|
-
*
|
|
3003
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3004
|
-
* @param properties - Properties to update.
|
|
3005
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
3006
|
-
* @example
|
|
3007
|
-
* Platform.Load("core", "1.1.5");
|
|
3008
|
-
* var sendDef = Send.Definition.Init("MY_SEND_DEF_KEY");
|
|
3009
|
-
* var result = sendDef.Update({ Name: "Updated Send Definition Name" });
|
|
3010
|
-
*/
|
|
3011
|
-
function Update(properties: object): string;
|
|
3012
|
-
/**
|
|
3013
|
-
* Deletes the previously initialized send definition.
|
|
3014
|
-
*
|
|
3015
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/senddefinition/)
|
|
3016
|
-
*
|
|
3017
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3018
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
3019
|
-
* @example
|
|
3020
|
-
* Platform.Load("core", "1.1.5");
|
|
3021
|
-
* var esd = Send.Definition.Init("myESD");
|
|
3022
|
-
* var status = esd.Remove();
|
|
3023
|
-
*/
|
|
3024
|
-
function Remove(): string;
|
|
3025
|
-
/**
|
|
3026
|
-
* Sends email messages to the lists associated with the previously initialized send definition.
|
|
3027
|
-
*
|
|
3028
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/senddefinition/)
|
|
3029
|
-
*
|
|
3030
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3031
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
3032
|
-
* @example
|
|
3033
|
-
* Platform.Load("core", "1.1.5");
|
|
3034
|
-
* var esd = Send.Definition.Init("myESD");
|
|
3035
|
-
* var status = esd.Send();
|
|
3036
|
-
*/
|
|
3037
|
-
function Send(): string;
|
|
3038
2873
|
}
|
|
3039
2874
|
declare namespace TriggeredSend {
|
|
3040
2875
|
/**
|
|
@@ -3049,7 +2884,7 @@ declare namespace TriggeredSend {
|
|
|
3049
2884
|
* Platform.Load("core", "1");
|
|
3050
2885
|
* var triggeredSend = TriggeredSend.Init("support");
|
|
3051
2886
|
*/
|
|
3052
|
-
function Init(key: string):
|
|
2887
|
+
function Init(key: string): TriggeredSendInstance;
|
|
3053
2888
|
/**
|
|
3054
2889
|
* Creates a new triggered send definition from the supplied properties and returns an initialized TriggeredSend instance. Note: unlike most static `Add` methods, this returns a `TriggeredSendInstance`, not `"OK"`.
|
|
3055
2890
|
*
|
|
@@ -3070,7 +2905,7 @@ declare namespace TriggeredSend {
|
|
|
3070
2905
|
* };
|
|
3071
2906
|
* var tsd = TriggeredSend.Add(newTSD);
|
|
3072
2907
|
*/
|
|
3073
|
-
function Add(properties: object):
|
|
2908
|
+
function Add(properties: object): TriggeredSendInstance;
|
|
3074
2909
|
/**
|
|
3075
2910
|
* Returns an array of triggered send definitions matching the specified filter.
|
|
3076
2911
|
*
|
|
@@ -3084,6 +2919,8 @@ declare namespace TriggeredSend {
|
|
|
3084
2919
|
* var results = TriggeredSend.Retrieve({ Property: "CustomerKey", SimpleOperator: "equals", Value: "ssjs_tsd_key" });
|
|
3085
2920
|
*/
|
|
3086
2921
|
function Retrieve(filter: object): object[];
|
|
2922
|
+
}
|
|
2923
|
+
interface TriggeredSendInstance {
|
|
3087
2924
|
/**
|
|
3088
2925
|
* Updates the previously initialized triggered send definition.
|
|
3089
2926
|
*
|
|
@@ -3097,7 +2934,7 @@ declare namespace TriggeredSend {
|
|
|
3097
2934
|
* var tsd = TriggeredSend.Init("triggeredSend");
|
|
3098
2935
|
* var status = tsd.Update({ Name: "Updated TSD Name" });
|
|
3099
2936
|
*/
|
|
3100
|
-
|
|
2937
|
+
Update(properties: object): string;
|
|
3101
2938
|
/**
|
|
3102
2939
|
* Starts (reactivates) a paused triggered send definition.
|
|
3103
2940
|
*
|
|
@@ -3110,7 +2947,7 @@ declare namespace TriggeredSend {
|
|
|
3110
2947
|
* var ts = TriggeredSend.Init("MY_TRIGGERED_SEND_KEY");
|
|
3111
2948
|
* var result = ts.Start();
|
|
3112
2949
|
*/
|
|
3113
|
-
|
|
2950
|
+
Start(): string;
|
|
3114
2951
|
/**
|
|
3115
2952
|
* Pauses an active triggered send definition.
|
|
3116
2953
|
*
|
|
@@ -3123,7 +2960,7 @@ declare namespace TriggeredSend {
|
|
|
3123
2960
|
* var ts = TriggeredSend.Init("MY_TRIGGERED_SEND_KEY");
|
|
3124
2961
|
* var status = ts.Pause();
|
|
3125
2962
|
*/
|
|
3126
|
-
|
|
2963
|
+
Pause(): string;
|
|
3127
2964
|
/**
|
|
3128
2965
|
* Publishes a triggered send definition, making it active and ready to accept sends. Use this to move a definition from Draft / Inactive to Active.
|
|
3129
2966
|
*
|
|
@@ -3136,7 +2973,7 @@ declare namespace TriggeredSend {
|
|
|
3136
2973
|
* var ts = TriggeredSend.Init("MY_TRIGGERED_SEND_KEY");
|
|
3137
2974
|
* var result = ts.Publish();
|
|
3138
2975
|
*/
|
|
3139
|
-
|
|
2976
|
+
Publish(): string;
|
|
3140
2977
|
/**
|
|
3141
2978
|
* Sends an email using the previously initialized triggered send definition. On failure, inspect `<TriggeredSendInstance>.LastMessage` for error details.
|
|
3142
2979
|
*
|
|
@@ -3152,58 +2989,7 @@ declare namespace TriggeredSend {
|
|
|
3152
2989
|
* var status = ts.Send("aruiz@example.com", { FirstName: "Angel", CouponCode: "AA1AF" });
|
|
3153
2990
|
* if (status != "OK") { var message = ts.LastMessage; }
|
|
3154
2991
|
*/
|
|
3155
|
-
|
|
3156
|
-
}
|
|
3157
|
-
declare namespace TriggeredSend.Tracking {
|
|
3158
|
-
/**
|
|
3159
|
-
* Returns tracking data for the previously initialized triggered send definition.
|
|
3160
|
-
*
|
|
3161
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/triggeredsend/)
|
|
3162
|
-
*
|
|
3163
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3164
|
-
* @param filter - Optional WSProxy-style filter object.
|
|
3165
|
-
* @returns List of tracking records.
|
|
3166
|
-
* @example
|
|
3167
|
-
* Platform.Load("core", "1.1.5");
|
|
3168
|
-
* var tsd = TriggeredSend.Init("MyTSDKey");
|
|
3169
|
-
* var tsdTracking = tsd.Tracking.Retrieve();
|
|
3170
|
-
*/
|
|
3171
|
-
function Retrieve(filter?: object): object[];
|
|
3172
|
-
}
|
|
3173
|
-
declare namespace TriggeredSend.Tracking.Clicks {
|
|
3174
|
-
/**
|
|
3175
|
-
* Returns click tracking information for the previously initialized triggered send definition.
|
|
3176
|
-
*
|
|
3177
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/triggeredsend/)
|
|
3178
|
-
*
|
|
3179
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3180
|
-
* @param filter - WSProxy-style filter restricting click results.
|
|
3181
|
-
* @returns List of click tracking records matching the filter.
|
|
3182
|
-
* @example
|
|
3183
|
-
* Platform.Load("core", "1.1.5");
|
|
3184
|
-
* var tsd = TriggeredSend.Init("MyTSDKey");
|
|
3185
|
-
* var results = tsd.Tracking.Clicks.Retrieve({ Property: "SendUrlID", SimpleOperator: "equals", Value: 12345 });
|
|
3186
|
-
*/
|
|
3187
|
-
function Retrieve(filter: object): object[];
|
|
3188
|
-
}
|
|
3189
|
-
declare namespace TriggeredSend.Tracking.TotalByInterval {
|
|
3190
|
-
/**
|
|
3191
|
-
* Returns aggregated tracking data for the previously initialized triggered send. Aggregates by `type` over the date range, grouped by `groupBy`.
|
|
3192
|
-
*
|
|
3193
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/triggeredsend/)
|
|
3194
|
-
*
|
|
3195
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3196
|
-
* @param type - Type of data to aggregate.
|
|
3197
|
-
* @param startDate - Start date of the data period (MM-DD-YYYY).
|
|
3198
|
-
* @param endDate - End date of the data period (MM-DD-YYYY).
|
|
3199
|
-
* @param groupBy - Interval used to aggregate data.
|
|
3200
|
-
* @returns List of aggregated tracking records.
|
|
3201
|
-
* @example
|
|
3202
|
-
* Platform.Load("core", "1.1.5");
|
|
3203
|
-
* var tsd = TriggeredSend.Init("MyTSDKey");
|
|
3204
|
-
* var results = tsd.Tracking.TotalByInterval.Retrieve("Click", "07-01-2010", "07-31-2010", "day");
|
|
3205
|
-
*/
|
|
3206
|
-
function Retrieve(type: string, startDate: string, endDate: string, groupBy: string): object[];
|
|
2992
|
+
Send(emailAddress: string, sendTimeAttributes?: object): string;
|
|
3207
2993
|
}
|
|
3208
2994
|
declare namespace DataExtension {
|
|
3209
2995
|
/**
|
|
@@ -3259,136 +3045,6 @@ declare namespace DataExtension {
|
|
|
3259
3045
|
*/
|
|
3260
3046
|
function Retrieve(filter: object, queryAllAccounts?: boolean): object[];
|
|
3261
3047
|
}
|
|
3262
|
-
declare namespace DataExtension.Fields {
|
|
3263
|
-
/**
|
|
3264
|
-
* Adds a field to the previously initialized data extension. `properties.Name` is required; the rest (`CustomerKey`, `FieldType`, `MaxLength`, `IsRequired`, `IsPrimaryKey`, `Ordinal`, `Scale`, `DefaultValue`) are optional. `FieldType` accepts: 'Boolean', 'Date', 'Decimal', 'EmailAddress', 'Locale', 'Number', 'Phone', 'Text'.
|
|
3265
|
-
*
|
|
3266
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/dataextension-fields/)
|
|
3267
|
-
*
|
|
3268
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3269
|
-
* @param properties - Object describing the new field.
|
|
3270
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
3271
|
-
* @example
|
|
3272
|
-
* Platform.Load("core", "1.1.5");
|
|
3273
|
-
* var de = DataExtension.Init("SSJSTest");
|
|
3274
|
-
* var newField = { Name: "NewFieldV2", CustomerKey: "CustomerKey", FieldType: "Number", IsRequired: true, DefaultValue: "100" };
|
|
3275
|
-
* var status = de.Fields.Add(newField);
|
|
3276
|
-
*/
|
|
3277
|
-
function Add(properties: object): string;
|
|
3278
|
-
/**
|
|
3279
|
-
* Returns an array of field definitions for the previously initialized data extension.
|
|
3280
|
-
*
|
|
3281
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/dataextension-fields/)
|
|
3282
|
-
*
|
|
3283
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3284
|
-
* @returns List of field-definition objects.
|
|
3285
|
-
* @example
|
|
3286
|
-
* Platform.Load("core", "1.1.5");
|
|
3287
|
-
* var birthdayDE = DataExtension.Init("birthdayDE");
|
|
3288
|
-
* var fields = birthdayDE.Fields.Retrieve();
|
|
3289
|
-
*/
|
|
3290
|
-
function Retrieve(): object[];
|
|
3291
|
-
/**
|
|
3292
|
-
* Updates which data extension field is used to relate the data extension to the All Subscribers list during sending. Pass the name of the data extension field, and which subscriber attribute it should map to.
|
|
3293
|
-
*
|
|
3294
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/dataextension-fields/)
|
|
3295
|
-
*
|
|
3296
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3297
|
-
* @param deFieldName - Name of the data extension field that should make the connection to the subscriber list.
|
|
3298
|
-
* @param subscriberField - Subscriber attribute to map the data extension field to.
|
|
3299
|
-
* @returns Returns "OK" on success or throws on failure (assumed; doc has no `@returns`, treated as `"OK"` for consistency with sibling `Fields.*` methods).
|
|
3300
|
-
* @example
|
|
3301
|
-
* Platform.Load("core", "1.1.5");
|
|
3302
|
-
* var updateDE = DataExtension.Init("sendableDataExtension");
|
|
3303
|
-
* var status = updateDE.Fields.UpdateSendableField("DifferentSubKey", "Subscriber Key");
|
|
3304
|
-
*/
|
|
3305
|
-
function UpdateSendableField(deFieldName: string, subscriberField: string): string;
|
|
3306
|
-
}
|
|
3307
|
-
declare namespace DataExtension.Rows {
|
|
3308
|
-
/**
|
|
3309
|
-
* Adds one or more rows to the previously initialized data extension.
|
|
3310
|
-
*
|
|
3311
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/dataextension-rows/)
|
|
3312
|
-
*
|
|
3313
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3314
|
-
* @param rowData - Array of objects, one per row to add. Each object's keys must match data extension field names.
|
|
3315
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
3316
|
-
* @example
|
|
3317
|
-
* Platform.Load("core", "1.1.5");
|
|
3318
|
-
* var arrContacts = [
|
|
3319
|
-
* { Email: "jdoe@example.com", FirstName: "John", LastName: "Doe" },
|
|
3320
|
-
* { Email: "aruiz@example.com", FirstName: "Angel", LastName: "Ruiz" }
|
|
3321
|
-
* ];
|
|
3322
|
-
* var birthdayDE = DataExtension.Init("birthdayDE");
|
|
3323
|
-
* birthdayDE.Rows.Add(arrContacts);
|
|
3324
|
-
*/
|
|
3325
|
-
function Add(rowData: any[]): string;
|
|
3326
|
-
/**
|
|
3327
|
-
* Returns rows where the specified columns equal the specified values (AND-joined). Optionally limits results and orders by a field. When initializing a data extension for `Lookup()` from an email message, you must use the data extension Name; on landing pages, either Name or external key works — make them identical to be safe.
|
|
3328
|
-
*
|
|
3329
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/dataextension-rows/)
|
|
3330
|
-
*
|
|
3331
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3332
|
-
* @param searchFieldNames - Array of column names to match against.
|
|
3333
|
-
* @param searchValues - Array of values to match (one per column, in order).
|
|
3334
|
-
* @param limit - Maximum number of rows to return.
|
|
3335
|
-
* @param orderByFieldName - Field to order results by.
|
|
3336
|
-
* @returns Rows matching the lookup criteria.
|
|
3337
|
-
* @example
|
|
3338
|
-
* Platform.Load("core", "1.1.5");
|
|
3339
|
-
* var testDE = DataExtension.Init("testDE");
|
|
3340
|
-
* var data = testDE.Rows.Lookup(["Age"], [25], 2, "LastName");
|
|
3341
|
-
*/
|
|
3342
|
-
function Lookup(searchFieldNames: any[], searchValues: any[], limit?: number, orderByFieldName?: string): object[];
|
|
3343
|
-
/**
|
|
3344
|
-
* Deletes rows from the previously initialized data extension where the specified columns equal the specified values (AND-joined). For large deletion requests, batch the work — this method times out on long-running deletes.
|
|
3345
|
-
*
|
|
3346
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/dataextension-rows/)
|
|
3347
|
-
*
|
|
3348
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3349
|
-
* @param columnNames - Array of column names to match against.
|
|
3350
|
-
* @param columnValues - Array of values to match (one per column, in order).
|
|
3351
|
-
* @returns The number of rows that were modified (deleted).
|
|
3352
|
-
* @example
|
|
3353
|
-
* Platform.Load("Core", "1.1.5");
|
|
3354
|
-
* var memberDE = DataExtension.Init("MembershipRewards");
|
|
3355
|
-
* var result = memberDE.Rows.Remove(["Area"], ["Kensington"]);
|
|
3356
|
-
*/
|
|
3357
|
-
function Remove(columnNames: any[], columnValues: any[]): number;
|
|
3358
|
-
/**
|
|
3359
|
-
* Retrieves up to 2500 rows from the previously initialized data extension. When called without a filter, returns all rows (subject to the 2500-row cap). Cannot be used in the context of an email message or email preview.
|
|
3360
|
-
*
|
|
3361
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/dataextension-rows/)
|
|
3362
|
-
*
|
|
3363
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3364
|
-
* @param filter - WSProxy-style filter object — simple `{Property, SimpleOperator, Value}` or compound with `LeftOperand`/`LogicalOperator`/`RightOperand`. Optional per the example, despite the doc table marking `Required: Yes`.
|
|
3365
|
-
* @returns Rows from the data extension matching the filter (or all rows when no filter is supplied).
|
|
3366
|
-
* @example
|
|
3367
|
-
* Platform.Load("core", "1.1.5");
|
|
3368
|
-
* var birthdayDE = DataExtension.Init("birthdayDE");
|
|
3369
|
-
* var data = birthdayDE.Rows.Retrieve();
|
|
3370
|
-
* var filter = { Property: "Age", SimpleOperator: "greaterThan", Value: 20 };
|
|
3371
|
-
* var moredata = birthdayDE.Rows.Retrieve(filter);
|
|
3372
|
-
*/
|
|
3373
|
-
function Retrieve(filter?: object): object[];
|
|
3374
|
-
/**
|
|
3375
|
-
* Updates the columns of rows where `whereFieldNames` equal `whereValues` (AND-joined). Throws if no row matches.
|
|
3376
|
-
*
|
|
3377
|
-
* [ssjs.guide reference](https://ssjs.guide/core-library/dataextension-rows/)
|
|
3378
|
-
*
|
|
3379
|
-
* @remarks Requires `Platform.Load("Core", "1")` before use.
|
|
3380
|
-
* @param rowData - Object whose keys are columns to update and values are the new values.
|
|
3381
|
-
* @param whereFieldNames - Array of column names to match against.
|
|
3382
|
-
* @param whereValues - Array of values to match (one per column, in order).
|
|
3383
|
-
* @returns Returns "OK" on success or throws on failure.
|
|
3384
|
-
* @example
|
|
3385
|
-
* Platform.Load("Core", "1");
|
|
3386
|
-
* var dataExt = DataExtension.Init("NTO Customer List");
|
|
3387
|
-
* var fieldsToUpdate = { StateProvince: "QC", PreferredActivity: "Sailing" };
|
|
3388
|
-
* var result = dataExt.Rows.Update(fieldsToUpdate, ["MemberId", "Country"], [9868600, "CA"]);
|
|
3389
|
-
*/
|
|
3390
|
-
function Update(rowData: object, whereFieldNames: any[], whereValues: any[]): string;
|
|
3391
|
-
}
|
|
3392
3048
|
declare namespace DateTime {
|
|
3393
3049
|
/**
|
|
3394
3050
|
* Converts a date-time value from Marketing Cloud system time (CST) to the local time of the account or user.
|
package/package.json
CHANGED