ssjs-data 0.2.2 → 0.3.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/README.md +231 -4
- package/dist/sfmc-globals.d.ts +477 -0
- package/package.json +23 -4
- package/src/index.js +5914 -1159
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
// sfmc-globals.d.ts — GENERATED by ssjs-data/scripts/generate-dts.mjs
|
|
2
|
+
// DO NOT EDIT — run `npm run generate:dts` in ssjs-data to regenerate.
|
|
3
|
+
// Ambient declarations for the complete SFMC SSJS global API surface.
|
|
4
|
+
// Designed for use with TypeScript's noLib:true (no lib.es5.d.ts).
|
|
5
|
+
|
|
6
|
+
// ── Platform ────────────────────────────────────────────────────────────────
|
|
7
|
+
declare namespace Platform {
|
|
8
|
+
function Load(libraryName: string, version: string): void;
|
|
9
|
+
namespace Function {
|
|
10
|
+
function Lookup(deName: string, returnField: string, whereFieldNames: string | string[], whereFieldValues: string | any[]): string;
|
|
11
|
+
function LookupRows(deName: string, whereFieldNames: string | string[], whereFieldValues: string | any[]): object;
|
|
12
|
+
function LookupOrderedRows(deName: string, count: number, orderBy: string, whereFieldNames: string | string[], whereFieldValues: string | any[]): object;
|
|
13
|
+
function InsertData(deName: string, fieldNames: string[], fieldValues: any[]): number;
|
|
14
|
+
function InsertDE(deName: string, fieldNames: string[], fieldValues: any[]): void;
|
|
15
|
+
function UpdateData(deName: string, whereFieldNames: string | string[], whereFieldValues: string | any[], fieldNames: string[], fieldValues: any[]): number;
|
|
16
|
+
function UpdateDE(deName: string, whereFieldNames: string | string[], whereFieldValues: string | any[], fieldNames: string[], fieldValues: any[]): number;
|
|
17
|
+
function UpsertData(deName: string, whereFieldNames: string | string[], whereFieldValues: string | any[], fieldNames: string[], fieldValues: any[]): number;
|
|
18
|
+
function UpsertDE(deName: string, whereFieldNames: string | string[], whereFieldValues: string | any[], fieldNames: string[], fieldValues: any[]): number;
|
|
19
|
+
function DeleteData(deName: string, whereFieldNames: string[], whereFieldValues: any[]): number;
|
|
20
|
+
function DeleteDE(deName: string, whereFieldNames: string[], whereFieldValues: any[]): number;
|
|
21
|
+
function ContentBlockByKey(customerKey: string, regionName?: string, stopOnError?: boolean, fallbackContent?: string): string;
|
|
22
|
+
function ContentBlockByName(name: string, regionName?: string, stopOnError?: boolean, fallbackContent?: string, statusVariable?: number): string;
|
|
23
|
+
function ContentBlockByID(id: number, regionName?: string, stopOnError?: boolean, fallbackContent?: string): string;
|
|
24
|
+
function ContentImageByKey(key: string, fallbackId?: number): string;
|
|
25
|
+
function ContentImageByID(id: number, fallbackId?: number): string;
|
|
26
|
+
function TreatAsContent(content: string): string;
|
|
27
|
+
function BeginImpressionRegion(name: string): void;
|
|
28
|
+
function EndImpressionRegion(closeAll?: boolean): void;
|
|
29
|
+
function Now(useContextTime?: boolean): string;
|
|
30
|
+
function SystemDateToLocalDate(dateValue: string): string;
|
|
31
|
+
function LocalDateToSystemDate(dateValue: string): string;
|
|
32
|
+
function RaiseError(message: string, currentRecipientOnly?: boolean, errorCode?: string, errorNumber?: number): void;
|
|
33
|
+
function GUID(): string;
|
|
34
|
+
function IsEmailAddress(value: string): boolean;
|
|
35
|
+
function IsPhoneNumber(value: string): boolean;
|
|
36
|
+
function CreateObject(objectType: string): object;
|
|
37
|
+
function SetObjectProperty(apiObject: object, propertyName: string, value: any): void;
|
|
38
|
+
function AddObjectArrayItem(apiObject: object, propertyName: string, value: any): void;
|
|
39
|
+
function InvokeCreate(apiObject: object, status: any[], options: object): object;
|
|
40
|
+
function InvokeUpdate(apiObject: object, status: any[], options: object): object;
|
|
41
|
+
function InvokeDelete(apiObject: object, status: any[], options: object): object;
|
|
42
|
+
function InvokeRetrieve(apiObject: object, status: any[]): object;
|
|
43
|
+
function InvokePerform(apiObject: object, method: string, status: any[], options: object): object;
|
|
44
|
+
function InvokeConfigure(apiObject: object, method: string, status: any[], options: object): object;
|
|
45
|
+
function InvokeExecute(apiObject: object, status: any[], options: object): object;
|
|
46
|
+
function InvokeExtract(apiObject: object, statusArray: any[], options?: object): string;
|
|
47
|
+
function InvokeSchedule(apiObject: object, action: string, schedule: object, statusArray?: any[], options?: object): string;
|
|
48
|
+
function HTTPGet(url: string, continueOnError: boolean, emptyContentHandling?: number, headerNames?: string[], headerValues?: string[], statusVariable?: number[]): string;
|
|
49
|
+
function HTTPPost(url: string, contentType: string, payload: string, headerNames?: string[], headerValues?: string[], response?: any[]): number;
|
|
50
|
+
function ParseJSON(jsonString: string | string[]): object | object[];
|
|
51
|
+
function RedirectTo(url: string): void;
|
|
52
|
+
function UrlEncode(url: string, encodeReservedKeywords?: boolean): string;
|
|
53
|
+
function Base64Encode(string: string, charset?: string): string;
|
|
54
|
+
function Base64Decode(encodedString: string, charset?: string): string;
|
|
55
|
+
function MD5(string: string, charset?: string): string;
|
|
56
|
+
function Stringify(object: object): string;
|
|
57
|
+
function ContentArea(id: number, regionName?: string, stopOnError?: boolean, fallbackContent?: string): string;
|
|
58
|
+
function ContentAreaByName(name: string, regionName?: string, stopOnError?: boolean, fallbackContent?: string): string;
|
|
59
|
+
function IsCHTMLBrowser(userAgentString: string): boolean;
|
|
60
|
+
}
|
|
61
|
+
namespace Variable {
|
|
62
|
+
function GetValue(variableName: string): string;
|
|
63
|
+
function SetValue(variableName: string, value: string): void;
|
|
64
|
+
}
|
|
65
|
+
namespace Response {
|
|
66
|
+
function SetResponseHeader(headerName: string, value: string): void;
|
|
67
|
+
function RemoveResponseHeader(headerName: string): void;
|
|
68
|
+
function Redirect(url: string, movedPermanently: boolean): void;
|
|
69
|
+
function SetCookie(name: string, value: string, expires?: string, secure?: boolean): void;
|
|
70
|
+
function RemoveCookie(name: string): void;
|
|
71
|
+
function Write(content: string): void;
|
|
72
|
+
var ContentType: string;
|
|
73
|
+
var CharacterSet: string;
|
|
74
|
+
}
|
|
75
|
+
namespace Request {
|
|
76
|
+
function GetQueryStringParameter(parameterName: string): string;
|
|
77
|
+
function GetFormField(name: string): string;
|
|
78
|
+
function GetPostData(encoding?: string): string;
|
|
79
|
+
function GetCookieValue(cookieName: string): string;
|
|
80
|
+
function GetUserLanguages(): string;
|
|
81
|
+
function GetRequestHeader(headerName: string): string;
|
|
82
|
+
const Browser: object;
|
|
83
|
+
const ClientIP: string;
|
|
84
|
+
const HasSSL: boolean;
|
|
85
|
+
const IsSSL: boolean;
|
|
86
|
+
const Method: string;
|
|
87
|
+
const QueryString: string;
|
|
88
|
+
const ReferrerURL: string;
|
|
89
|
+
const RequestURL: string;
|
|
90
|
+
const UserAgent: string;
|
|
91
|
+
}
|
|
92
|
+
namespace Recipient {
|
|
93
|
+
function GetAttributeValue(attributeName: string): string;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ── Bare-name globals (aliasOf Platform.*) ──────────────────────────────────
|
|
98
|
+
declare function ContentArea(id: number, regionName?: string, stopOnError?: boolean, fallbackContent?: string): string;
|
|
99
|
+
declare function ContentAreaByName(name: string, regionName?: string, stopOnError?: boolean, fallbackContent?: string): string;
|
|
100
|
+
declare function BeginImpressionRegion(name: string): void;
|
|
101
|
+
declare function EndImpressionRegion(closeAll?: boolean): void;
|
|
102
|
+
declare function Now(useContextTime?: boolean): string;
|
|
103
|
+
declare function SystemDateToLocalDate(dateValue: string): string;
|
|
104
|
+
declare function LocalDateToSystemDate(dateValue: string): string;
|
|
105
|
+
declare function Redirect(url: string, movedPermanently: boolean): void;
|
|
106
|
+
declare function GUID(): string;
|
|
107
|
+
declare function IsEmailAddress(value: string): boolean;
|
|
108
|
+
declare function IsPhoneNumber(value: string): boolean;
|
|
109
|
+
declare function Write(content: string): void;
|
|
110
|
+
declare function Stringify(object: object): string;
|
|
111
|
+
|
|
112
|
+
// ── DataExtension instance interfaces ───────────────────────────────────────
|
|
113
|
+
interface DataExtensionFieldsAccessor {
|
|
114
|
+
Add(properties: object): string;
|
|
115
|
+
Retrieve(): object[];
|
|
116
|
+
UpdateSendableField(deFieldName: string, subscriberField: string): string;
|
|
117
|
+
}
|
|
118
|
+
interface DataExtensionRowsAccessor {
|
|
119
|
+
Add(rowData: any[]): string;
|
|
120
|
+
Lookup(searchFieldNames: any[], searchValues: any[], limit?: number, orderByFieldName?: string): object[];
|
|
121
|
+
Remove(columnNames: any[], columnValues: any[]): number;
|
|
122
|
+
Retrieve(filter?: object): object[];
|
|
123
|
+
Update(rowData: object, whereFieldNames: any[], whereValues: any[]): string;
|
|
124
|
+
}
|
|
125
|
+
interface DataExtensionInstance {
|
|
126
|
+
Fields: DataExtensionFieldsAccessor;
|
|
127
|
+
Rows: DataExtensionRowsAccessor;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ── Core Library namespaces ──────────────────────────────────────────────────
|
|
131
|
+
declare namespace Account {
|
|
132
|
+
function Init(key: string): any;
|
|
133
|
+
function Retrieve(filter: object): object[];
|
|
134
|
+
function Update(properties: object): string;
|
|
135
|
+
}
|
|
136
|
+
declare namespace Account.Tracking {
|
|
137
|
+
function Retrieve(filter: object): object[];
|
|
138
|
+
}
|
|
139
|
+
declare namespace AccountUser {
|
|
140
|
+
function Init(targetUserKey: string, myClientID: number): any;
|
|
141
|
+
function Add(properties: object): string;
|
|
142
|
+
function Retrieve(filter: object): object[];
|
|
143
|
+
function Update(properties: object): string;
|
|
144
|
+
function Activate(): string;
|
|
145
|
+
function Deactivate(): string;
|
|
146
|
+
}
|
|
147
|
+
declare namespace Portfolio {
|
|
148
|
+
function Init(key: string): any;
|
|
149
|
+
function Add(properties: object): string;
|
|
150
|
+
function Retrieve(filter: object): object[];
|
|
151
|
+
function Update(properties: object): string;
|
|
152
|
+
function Remove(): string;
|
|
153
|
+
}
|
|
154
|
+
declare namespace ContentAreaObj {
|
|
155
|
+
function Init(key: string): any;
|
|
156
|
+
function Add(properties: object): string;
|
|
157
|
+
function Retrieve(filter: object): object[];
|
|
158
|
+
function Update(properties: object): string;
|
|
159
|
+
function Remove(): string;
|
|
160
|
+
}
|
|
161
|
+
declare namespace Folder {
|
|
162
|
+
function Init(key?: string): any;
|
|
163
|
+
function Add(properties: object): string;
|
|
164
|
+
function Retrieve(filter: object): object[];
|
|
165
|
+
function Update(properties: object): string;
|
|
166
|
+
function Remove(): string;
|
|
167
|
+
function SetID(id: number): void;
|
|
168
|
+
}
|
|
169
|
+
declare namespace Template {
|
|
170
|
+
function Init(key: string): any;
|
|
171
|
+
function Add(properties: object): string;
|
|
172
|
+
function Retrieve(filter: object): object[];
|
|
173
|
+
function Update(properties: object): string;
|
|
174
|
+
}
|
|
175
|
+
declare namespace DeliveryProfile {
|
|
176
|
+
function Init(key: string): any;
|
|
177
|
+
function Add(properties: object): string;
|
|
178
|
+
function Update(properties: object): string;
|
|
179
|
+
function Remove(): string;
|
|
180
|
+
}
|
|
181
|
+
declare namespace SenderProfile {
|
|
182
|
+
function Init(key: string): any;
|
|
183
|
+
function Add(properties: object): string;
|
|
184
|
+
function Update(properties: object): string;
|
|
185
|
+
function Remove(): string;
|
|
186
|
+
}
|
|
187
|
+
declare namespace SendClassification {
|
|
188
|
+
function Init(key: string): any;
|
|
189
|
+
function Add(properties: object): string;
|
|
190
|
+
function Retrieve(filter: object): object[];
|
|
191
|
+
function Update(properties: object): string;
|
|
192
|
+
function Remove(): string;
|
|
193
|
+
}
|
|
194
|
+
declare namespace FilterDefinition {
|
|
195
|
+
function Init(key: string): any;
|
|
196
|
+
function Add(properties: object): string;
|
|
197
|
+
function Retrieve(filter: object): object[];
|
|
198
|
+
function Update(properties: object): string;
|
|
199
|
+
function Remove(): string;
|
|
200
|
+
}
|
|
201
|
+
declare namespace QueryDefinition {
|
|
202
|
+
function Init(key: string): any;
|
|
203
|
+
function Add(properties: object): string;
|
|
204
|
+
function Retrieve(filter: object): object[];
|
|
205
|
+
function Update(properties: object): string;
|
|
206
|
+
function Remove(): string;
|
|
207
|
+
function Perform(action: string): string;
|
|
208
|
+
}
|
|
209
|
+
declare namespace List {
|
|
210
|
+
function Init(key: string): any;
|
|
211
|
+
function Add(properties: object): any;
|
|
212
|
+
function Retrieve(filter: object): object[];
|
|
213
|
+
function Remove(): string;
|
|
214
|
+
}
|
|
215
|
+
declare namespace List.Subscribers {
|
|
216
|
+
function Add(properties: object): string;
|
|
217
|
+
function Retrieve(filter?: object): object[];
|
|
218
|
+
function Unsubscribe(emailAddress: string): string;
|
|
219
|
+
function Update(emailAddress: string, status: string): string;
|
|
220
|
+
function Upsert(emailAddress: string, attributes: object): string;
|
|
221
|
+
}
|
|
222
|
+
declare namespace List.Subscribers.Tracking {
|
|
223
|
+
function Retrieve(filter: object): object[];
|
|
224
|
+
}
|
|
225
|
+
declare namespace Subscriber {
|
|
226
|
+
function Init(key: string): any;
|
|
227
|
+
function Add(properties: object): string;
|
|
228
|
+
function Retrieve(filter: object): object[];
|
|
229
|
+
function Upsert(properties: object): string;
|
|
230
|
+
function Statistics(subscriberKey: string): object;
|
|
231
|
+
function Update(properties: object): string;
|
|
232
|
+
function Remove(): string;
|
|
233
|
+
function Unsubscribe(): string;
|
|
234
|
+
}
|
|
235
|
+
declare namespace Subscriber.Attributes {
|
|
236
|
+
function Retrieve(): object[];
|
|
237
|
+
}
|
|
238
|
+
declare namespace Subscriber.Lists {
|
|
239
|
+
function Retrieve(): object[];
|
|
240
|
+
}
|
|
241
|
+
declare namespace Email {
|
|
242
|
+
function Init(key: string): any;
|
|
243
|
+
function Add(properties: object): any;
|
|
244
|
+
function Retrieve(filter: object): object[];
|
|
245
|
+
function Update(properties: object): string;
|
|
246
|
+
function Remove(): string;
|
|
247
|
+
function Validate(): object;
|
|
248
|
+
function CheckContent(): object;
|
|
249
|
+
}
|
|
250
|
+
declare namespace Send {
|
|
251
|
+
function Init(id: number): any;
|
|
252
|
+
function Add(emailKey: string, listIds: any[], options?: object): string;
|
|
253
|
+
function Retrieve(filter: object): object[];
|
|
254
|
+
function RetrieveLists(filter: object): object[];
|
|
255
|
+
function Remove(): string;
|
|
256
|
+
function CancelSend(): string;
|
|
257
|
+
}
|
|
258
|
+
declare namespace Send.Tracking {
|
|
259
|
+
function Retrieve(filter: object): object[];
|
|
260
|
+
function ClickRetrieve(filter: object): object[];
|
|
261
|
+
function TotalByIntervalRetrieve(type: string, startDate: string, endDate: string, groupBy: string): object[];
|
|
262
|
+
}
|
|
263
|
+
declare namespace Send.Definition {
|
|
264
|
+
function Init(key: string): any;
|
|
265
|
+
function Add(esdParams: object, sendClassificationKey: string, emailKey: string, listIds: any[]): string;
|
|
266
|
+
function AddWithDE(esdParams: object, sendClassificationKey: string, emailKey: string, sendableDataExtensionKey: string, publicationListKey: string): string;
|
|
267
|
+
function AddWithFilterDefinition(esdParams: object, sendClassificationKey: string, emailKey: string, filterDefinitionKey: string, listId: number): string;
|
|
268
|
+
function Retrieve(filter?: object): object[];
|
|
269
|
+
function Update(properties: object): string;
|
|
270
|
+
function Remove(): string;
|
|
271
|
+
function Send(): string;
|
|
272
|
+
}
|
|
273
|
+
declare namespace TriggeredSend {
|
|
274
|
+
function Init(key: string): any;
|
|
275
|
+
function Add(properties: object): any;
|
|
276
|
+
function Retrieve(filter: object): object[];
|
|
277
|
+
function Update(properties: object): string;
|
|
278
|
+
function Start(): string;
|
|
279
|
+
function Pause(): string;
|
|
280
|
+
function Publish(): string;
|
|
281
|
+
function Send(emailAddress: string, sendTimeAttributes?: object): string;
|
|
282
|
+
}
|
|
283
|
+
declare namespace TriggeredSend.Tracking {
|
|
284
|
+
function Retrieve(filter?: object): object[];
|
|
285
|
+
}
|
|
286
|
+
declare namespace TriggeredSend.Tracking.Clicks {
|
|
287
|
+
function Retrieve(filter: object): object[];
|
|
288
|
+
}
|
|
289
|
+
declare namespace TriggeredSend.Tracking.TotalByInterval {
|
|
290
|
+
function Retrieve(type: string, startDate: string, endDate: string, groupBy: string): object[];
|
|
291
|
+
}
|
|
292
|
+
declare namespace DataExtension {
|
|
293
|
+
function Init(key: string): DataExtensionInstance;
|
|
294
|
+
function Add(properties: object): DataExtensionInstance;
|
|
295
|
+
function Retrieve(filter: object, queryAllAccounts?: boolean): object[];
|
|
296
|
+
}
|
|
297
|
+
declare namespace DataExtension.Fields {
|
|
298
|
+
function Add(properties: object): string;
|
|
299
|
+
function Retrieve(): object[];
|
|
300
|
+
function UpdateSendableField(deFieldName: string, subscriberField: string): string;
|
|
301
|
+
}
|
|
302
|
+
declare namespace DataExtension.Rows {
|
|
303
|
+
function Add(rowData: any[]): string;
|
|
304
|
+
function Lookup(searchFieldNames: any[], searchValues: any[], limit?: number, orderByFieldName?: string): object[];
|
|
305
|
+
function Remove(columnNames: any[], columnValues: any[]): number;
|
|
306
|
+
function Retrieve(filter?: object): object[];
|
|
307
|
+
function Update(rowData: object, whereFieldNames: any[], whereValues: any[]): string;
|
|
308
|
+
}
|
|
309
|
+
declare namespace DateTime.TimeZone {
|
|
310
|
+
function Retrieve(filter: object): object[];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// ── Standalone Core Library globals ──────────────────────────────────────────
|
|
314
|
+
declare namespace Attribute {
|
|
315
|
+
function GetValue(name: string): string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
declare namespace ErrorUtil {
|
|
319
|
+
function ThrowWSProxyError(result: object): void;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// ── Event namespaces ─────────────────────────────────────────────────────────
|
|
323
|
+
declare namespace BounceEvent {
|
|
324
|
+
function Retrieve(filter: object): object[];
|
|
325
|
+
}
|
|
326
|
+
declare namespace ClickEvent {
|
|
327
|
+
function Retrieve(filter: object): object[];
|
|
328
|
+
}
|
|
329
|
+
declare namespace ForwardedEmailEvent {
|
|
330
|
+
function Retrieve(filter: object): object[];
|
|
331
|
+
}
|
|
332
|
+
declare namespace ForwardedEmailOptInEvent {
|
|
333
|
+
function Retrieve(filter: object): object[];
|
|
334
|
+
}
|
|
335
|
+
declare namespace NotSentEvent {
|
|
336
|
+
function Retrieve(filter: object): object[];
|
|
337
|
+
}
|
|
338
|
+
declare namespace OpenEvent {
|
|
339
|
+
function Retrieve(filter: object): object[];
|
|
340
|
+
}
|
|
341
|
+
declare namespace SentEvent {
|
|
342
|
+
function Retrieve(filter: object): object[];
|
|
343
|
+
}
|
|
344
|
+
declare namespace SurveyEvent {
|
|
345
|
+
function Retrieve(filter: object): object[];
|
|
346
|
+
}
|
|
347
|
+
declare namespace UnsubEvent {
|
|
348
|
+
function Retrieve(filter: object): object[];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// ── HTTP / HTTPHeader ────────────────────────────────────────────────────────
|
|
352
|
+
declare namespace HTTP {
|
|
353
|
+
function Get(url: string, headerNames?: any[], headerValues?: any[]): object;
|
|
354
|
+
function Post(url: string, contentType: string, payload: string, headerNames: string[], headerValues: any[]): object;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
declare namespace HTTPHeader {
|
|
358
|
+
function GetValue(name: string): string;
|
|
359
|
+
function SetValue(name: string, value: string): void;
|
|
360
|
+
function Remove(headerName: string): string;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// ── Script.Util ──────────────────────────────────────────────────────────────
|
|
364
|
+
declare namespace Script {
|
|
365
|
+
namespace Util {
|
|
366
|
+
class WSProxy {
|
|
367
|
+
constructor();
|
|
368
|
+
createItem(objectType: string, properties: object): object;
|
|
369
|
+
updateItem(objectType: string, properties: object): object;
|
|
370
|
+
deleteItem(objectType: string, properties: object): object;
|
|
371
|
+
retrieve(objectType: string, columns: any[], filter?: object, retrieveOptions?: object, requestProps?: object): object;
|
|
372
|
+
getNextBatch(objectType: string, requestId: string): object;
|
|
373
|
+
performItem(objectType: string, properties: object, action: string, performOptions?: object): object;
|
|
374
|
+
performBatch(objectType: string, propertiesArray: any[], action: string, performOptions?: object): object;
|
|
375
|
+
describe(objectType: string): object;
|
|
376
|
+
execute(objectType: string, requestName: string): object;
|
|
377
|
+
setBatchSize(batchSize: number): void;
|
|
378
|
+
setClientId(clientId: object): void;
|
|
379
|
+
resetClientIds(): void;
|
|
380
|
+
createBatch(objectType: string, propertiesArray: any[]): object;
|
|
381
|
+
updateBatch(objectType: string, propertiesArray: any[]): object;
|
|
382
|
+
deleteBatch(objectType: string, propertiesArray: any[]): object;
|
|
383
|
+
}
|
|
384
|
+
class HttpRequest {
|
|
385
|
+
constructor(url: string);
|
|
386
|
+
send(): object;
|
|
387
|
+
setHeader(name: string, value: string): void;
|
|
388
|
+
clearHeaders(): void;
|
|
389
|
+
removeHeader(name: string): void;
|
|
390
|
+
}
|
|
391
|
+
class HttpGet {
|
|
392
|
+
constructor(url: string);
|
|
393
|
+
send(): object;
|
|
394
|
+
setHeader(name: string, value: string): void;
|
|
395
|
+
clearHeaders(): void;
|
|
396
|
+
removeHeader(name: string): void;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// ── ECMAScript built-ins (SFMC-supported subset only) ───────────────────────
|
|
402
|
+
interface Array<T> {
|
|
403
|
+
join(separator?: string): string;
|
|
404
|
+
push(...elements: T[]): number;
|
|
405
|
+
pop(): T;
|
|
406
|
+
shift(): T;
|
|
407
|
+
unshift(...elements: T[]): number;
|
|
408
|
+
concat(...values: T[]): T[];
|
|
409
|
+
slice(start?: number, end?: number): T[];
|
|
410
|
+
sort(compareFn?: any): T[];
|
|
411
|
+
reverse(): T[];
|
|
412
|
+
splice(start: number, deleteCount?: number, ...items: T[]): T[];
|
|
413
|
+
readonly length: number;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
interface String {
|
|
417
|
+
charAt(index?: number): string;
|
|
418
|
+
charCodeAt(index?: number): number;
|
|
419
|
+
indexOf(searchValue?: string, fromIndex?: number): number;
|
|
420
|
+
lastIndexOf(searchValue?: string, fromIndex?: number): number;
|
|
421
|
+
match(regexp?: RegExp): any[];
|
|
422
|
+
replace(searchValue?: any, replaceValue?: string): string;
|
|
423
|
+
search(regexp?: RegExp): number;
|
|
424
|
+
slice(start?: number, end?: number): string;
|
|
425
|
+
split(separator?: any, limit?: number): any[];
|
|
426
|
+
substring(start?: number, end?: number): string;
|
|
427
|
+
toLowerCase(): string;
|
|
428
|
+
toUpperCase(): string;
|
|
429
|
+
concat(...strings: string[]): string;
|
|
430
|
+
substr(start?: number, length?: number): string;
|
|
431
|
+
readonly length: number;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
interface Number {
|
|
435
|
+
toFixed(fractionDigits?: number): string;
|
|
436
|
+
toExponential(fractionDigits?: number): string;
|
|
437
|
+
toPrecision(precision?: number): string;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
interface Object {
|
|
441
|
+
hasOwnProperty(v?: string): boolean;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
declare namespace Math {
|
|
445
|
+
function abs(x?: number): number;
|
|
446
|
+
function ceil(x?: number): number;
|
|
447
|
+
function floor(x?: number): number;
|
|
448
|
+
function max(...values: number[]): number;
|
|
449
|
+
function min(...values: number[]): number;
|
|
450
|
+
function pow(base?: number, exponent?: number): number;
|
|
451
|
+
function random(): number;
|
|
452
|
+
function round(x?: number): number;
|
|
453
|
+
function sqrt(x?: number): number;
|
|
454
|
+
function sin(x?: number): number;
|
|
455
|
+
function cos(x?: number): number;
|
|
456
|
+
function tan(x?: number): number;
|
|
457
|
+
function asin(x?: number): number;
|
|
458
|
+
function acos(x?: number): number;
|
|
459
|
+
function atan(x?: number): number;
|
|
460
|
+
function atan2(y?: number, x?: number): number;
|
|
461
|
+
function exp(x?: number): number;
|
|
462
|
+
function log(x?: number): number;
|
|
463
|
+
const PI: number;
|
|
464
|
+
const E: number;
|
|
465
|
+
const LN2: number;
|
|
466
|
+
const LN10: number;
|
|
467
|
+
const LOG2E: number;
|
|
468
|
+
const LOG10E: number;
|
|
469
|
+
const SQRT2: number;
|
|
470
|
+
const SQRT1_2: number;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Global ECMAScript functions
|
|
474
|
+
declare function parseInt(string?: string, radix?: number): number;
|
|
475
|
+
declare function parseFloat(string?: string): number;
|
|
476
|
+
declare function isNaN(value?: any): boolean;
|
|
477
|
+
declare function isFinite(value?: any): boolean;
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ssjs-data",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.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
|
-
".": "./src/index.js"
|
|
8
|
+
".": "./src/index.js",
|
|
9
|
+
"./sfmc-globals.d.ts": "./dist/sfmc-globals.d.ts"
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
11
|
-
"src"
|
|
12
|
+
"src",
|
|
13
|
+
"dist"
|
|
12
14
|
],
|
|
13
15
|
"repository": {
|
|
14
16
|
"type": "git",
|
|
@@ -30,9 +32,26 @@
|
|
|
30
32
|
],
|
|
31
33
|
"license": "MIT",
|
|
32
34
|
"scripts": {
|
|
33
|
-
"test": "echo No tests defined"
|
|
35
|
+
"test": "echo No tests defined",
|
|
36
|
+
"generate:dts": "node scripts/generate-dts.mjs",
|
|
37
|
+
"lint": "eslint .",
|
|
38
|
+
"lint:fix": "eslint --fix .",
|
|
39
|
+
"prepare": "husky || true",
|
|
40
|
+
"format": "prettier --write .",
|
|
41
|
+
"format:check": "prettier --check ."
|
|
34
42
|
},
|
|
35
43
|
"engines": {
|
|
36
44
|
"node": ">=18.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@eslint/js": "^10.0.1",
|
|
48
|
+
"eslint": "^10.1.0",
|
|
49
|
+
"eslint-config-prettier": "^10.1.8",
|
|
50
|
+
"eslint-plugin-jsdoc": "^62.0.0",
|
|
51
|
+
"eslint-plugin-prettier": "^5.5.0",
|
|
52
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
53
|
+
"globals": "^17.4.0",
|
|
54
|
+
"husky": "^9.1.7",
|
|
55
|
+
"prettier": "^3.8.1"
|
|
37
56
|
}
|
|
38
57
|
}
|