-
Notifications
You must be signed in to change notification settings - Fork 2
/
ScriptIncludes.d.ts
2059 lines (1788 loc) · 92.1 KB
/
ScriptIncludes.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// <reference path="./Packages.d.ts" />
/// <reference path="./$$rhino.d.ts" />
/// <reference path="./GlideTypes.d.ts" />
declare interface IAbstractAjaxProcessor {
readonly CALLABLE_PREFIX: 'ajaxFunction_';
// readonly prototype: AbstractAjaxProcessor;
readonly request?: GlideServletRequest;
readonly responseXML?: XMLDocument2;
readonly gc?: Packages.com.glide.script.GlideController;
initialize(request?: GlideServletRequest, responseXML?: XMLDocument2, gc?: Packages.com.glide.script.GlideController): void;
process(): any;
newItem(name?: string): Packages.org.w3c.dom.Element;
/**
* returns value of parameter as a Java String instance
* @param {string} name - The name of the parameter
* @return {$$rhino.String} The value of the parameter.
* @memberof IAbstractAjaxProcessor
*/
getParameter(name: string): $$rhino.Nilable<$$rhino.String>;
getDocument(): XMLDocument2 | undefined;
getRootElement(): Packages.org.w3c.dom.Element;
/**
* Returns value of "sysparm_name" as a Java String instance
* @return {$$rhino.Stringg}
* @memberof IAbstractAjaxProcessor
*/
getName(): $$rhino.String;
/**
* Returns value of "sysparm_value" as a Java String instance
* @return {$$rhino.String}
* @memberof IAbstractAjaxProcessor
*/
getValue(): $$rhino.String;
/**
* Returns value of "sysparm_type" as a Java String instance
* @return {$$rhino.String}
* @memberof IAbstractAjaxProcessor
*/
getType(): $$rhino.String;
getChars(): $$rhino.String;
setAnswer(value: any): void;
setError(error: any): void;
}
declare interface AbstractAjaxProcessorConstructor extends $$class.Constructor<AbstractAjaxProcessor, IAbstractAjaxProcessor & Readonly<{ prototype: AbstractAjaxProcessor }>> {
new(): AbstractAjaxProcessor;
(): AbstractAjaxProcessor;
}
/**
* Base ajax processor class that other ajax processors extend
*/
declare class AbstractAjaxProcessor implements IAbstractAjaxProcessor {
readonly CALLABLE_PREFIX: 'ajaxFunction_';
constructor();
readonly prototype: AbstractAjaxProcessor;
readonly request?: GlideServletRequest;
readonly responseXML?: XMLDocument2;
readonly gc?: Packages.com.glide.script.GlideController;
initialize(request?: GlideServletRequest, responseXML?: XMLDocument2, gc?: Packages.com.glide.script.GlideController): void;
process(): any;
newItem(name?: string): Packages.org.w3c.dom.Element;
/**
* returns value of parameter as a Java String instance
* @param {string} name - The name of the parameter
* @return {$$rhino.String} The value of the parameter.
* @memberof AbstractAjaxProcessor
*/
getParameter(name: string): $$rhino.Nilable<$$rhino.String>;
getDocument(): XMLDocument2 | undefined;
getRootElement(): Packages.org.w3c.dom.Element;
/**
* Returns value of "sysparm_name" as a Java String instance
* @return {$$rhino.Stringg}
* @memberof AbstractAjaxProcessor
*/
getName(): $$rhino.String;
/**
* Returns value of "sysparm_value" as a Java String instance
* @return {$$rhino.String}
* @memberof AbstractAjaxProcessor
*/
getValue(): $$rhino.String;
/**
* Returns value of "sysparm_type" as a Java String instance
* @return {$$rhino.String}
* @memberof AbstractAjaxProcessor
*/
getType(): $$rhino.String;
getChars(): $$rhino.String;
setAnswer(value: any): void;
setError(error: any): void;
}
/**
* Utility to check if Approvers can read records they are approving.
* g_approval_form_request is set in the approval_summarizer_default UI Macro.
*/
declare class ApproverUtils {
canApproversRead(): boolean;
verify(sourceTable: string, documentId: string, userId: string): boolean;
type: "ApproverUtils";
}
/**
* ArrayUtil API is a script include with useful functions for working with JavaScript arrays.
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/ArrayUtil/concept/c_ArrayUtilAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_ArrayUtilAPI}
*/
declare class ArrayUtil {
/**
* Merge two arrays.
* @template T - The element type,
* @param {T[]} parent - An array to merge.
* @param {T[]} child - An array to merge.
* @return {T[]} An array of elements from both input arrays. Duplicates are not removed.
* @memberof ArrayUtil
*/
concat<T>(parent: T[], child: T[]): T[];
/**
* Searches the array for the specified element.
* @template T - The element type,
* @param {T[]} array
* @param {T} element
* @return {boolean} True if the element exists in the array; otherwise returns false.
* @memberof ArrayUtil
*/
contains<T>(array: T[], element: T): boolean;
/**
* Converts a Java object to an array.
* @param {*} a - Object to convert.
* @return {any[]} Array created from the object.
* @memberof ArrayUtil
*/
convertArray(a: any): any[];
/**
* Finds the differences between two or more arrays.
* @template T - The element type.
* @param {T[]} a - The first array.
* @param {T[]} b - The second array.
* @param {...T[]} c - Zero or more additional arrays.
* @return {T[]} - Returns an array of items from array a that were not found in any other input array. Duplicates are removed from the result.
* @memberof ArrayUtil
*/
diff<T>(a: T[], b: T[], ...c: T[]): T[];
/**
* Returns an array from the specified object.
* @param {*} obj - Object from which to create an array.
* @return {any[]} Array created from the object.
* @memberof ArrayUtil
*/
ensureArray(object: any): any[];
/**
* Searches the array for the element.
* @template T - The element type.
* @param {T} array - Array to search.
* @param {T} element - Element to search for.
* @param {number} [startIndex] - The optional zero-based index to start searching from.
* @return {number} Zero-based position of the element in the array, or -1 if the element is not found.
* @memberof ArrayUtil
*/
indexOf<T>(array: T, element: T, startIndex?: number): number;
/**
* Finds the elements present in all arrays.
* @template T - The element type.
* @param {T[]} a - The first array.
* @param {T[]} b - The second array.
* @param {...T[]} c - Zero or more additional arrays.
* @return {T[]} An array of elements from array a that were found in all of the other input arrays. Duplicates are removed.
* @memberof ArrayUtil
*/
intersect<T>(a: T[], b: T[], ...c: T[]): T[];
/**
* Merge two or more arrays.
* @template T - The element type.
* @param {T[]} a - The first array.
* @param {T[]} b - The second array.
* @param {...T[]} c - Zero or more additional arrays.
* @return {T[]} An array of items from all the input arrays. Duplicates are removed.
* @memberof ArrayUtil
*/
union<T>(a: T[], b: T[], ...c: T[]): T[];
/**
* Removes duplicate items from an array.
* @template T - The element type.
* @param {T[]} a - The array to check for duplicate elements.
* @return {T[]} An array of unique items from the input array.
* @memberof ArrayUtil
*/
unique<T>(a: T[]): T[];
}
/**
* Attachment utilities
*/
declare class AttachmentUtils {
attInptStream: GlideScriptableInputStream;
/**
* Creates an instance of AttachmentUtils.
* @param {string} attachmentSysId - Attachment sys_id.
* @memberof AttachmentUtils
*/
constructor(attachmentSysId: string);
/**
* Gets MD5 checksum for the attachment identified by the attachmentSysId parameter in the class initialization.
* @return {$$rhino.String} MD5 checksum string.
* @memberof AttachmentUtils
*/
getMD5ChecksumFromAttachment(): $$rhino.String;
/**
* Gets SHA1 checksum for the attachment identified by the attachmentSysId parameter in the class initialization.
* @return {$$rhino.String} SHA1 checksum string
*/
getSHA1ChecksumFromAttachment(): $$rhino.String;
/**
* Gets SHA256 checksum for the attachment identified by the attachmentSysId parameter in the class initialization.
* @return {$$rhino.String} SHA256 checksum string
*/
getSHA256ChecksumFromAttachment(): $$rhino.String;
/**
* Gets MD5 Hex checksum for the attachment identified by the attachmentSysId parameter in the class initialization.
* @return {$$rhino.String} MD5 Hex checksum string
*/
getMD5HexChecksumFromAttachment(): $$rhino.String;
/**
* Gets SHA1 Hex checksum for the attachment identified by the attachmentSysId parameter in the class initialization.
* @return {$$rhino.String} SHA1 Hex checksum string
*/
getSHA1HexChecksumFromAttachment(): $$rhino.String;
/**
* Gets SHA256 Hex checksum for the attachment identified by the attachmentSysId parameter in the class initialization.
* @return {$$rhino.String} SHA256 HEx checksum string
*/
getSHA256HexChecksumFromAttachment(): $$rhino.String;
type: "AttachmentUtils";
}
/**
* This script does availability calculation given a start and an end date, it considers the availability as well as maintenance commitments
* along with the schedules attached to the offering.
*/
declare class AvailabilityCalculator {
SCHEDULES: GlideLRUCache;
cmdb_ci: string | null;
commitment: string | null;
sumCount: number;
constructor();
calculate(start: GlideDateTime, end: GlideDateTime, type: service_availabilityType): void;
setCommitment(id: string): void;
setCI(cmdb_ci: string): void;
}
declare class AvailabilityConstants {
SERVICE_OFFERING_COMMITMENT: 'service_offering_commitment';
ALERT_GROUP: 'cmdb_ci_alert_group';
DYNAMIC_CI_GROUP: 'cmdb_ci_query_based_service';
EXCLUDED_APPLICATION_TABLES(): ['cmdb_ci_alert_group', 'cmdb_ci_query_based_service'];
type: "AvailabilityConstants";
}
declare class AvailabilityRecord {
type: service_availabilityType;
constructor(cmdb_ci: $$rhino.String, start: GlideDateTime, end: GlideDateTime);
post(commitment: $$rhino.String, absolute: GlideDuration, scheduled: GlideDuration, absolute_avail: $$rhino.Number, scheduled_avail: $$rhino.Number, absolute_count: $$rhino.Number,
scheduled_count: $$rhino.Number, ast: GlideDuration, mtbf: GlideDuration, mtrs: GlideDuration, allowed: GlideDuration, met: $$rhino.Boolean): void;
setType(t: service_availabilityType): void;
}
declare class AvailabilitySummarizer {
cmdb_ci: string | null;
commitment: string | null;
start: GlideDateTime;
constructor();
summarize(start?: string | GlideDateTime): void;
setCommitment(id: string): void;
setCI(cmdb_ci: string): void;
}
declare class AvailabilityUtils {
CONSTANTS: AvailabilityConstants;
hasCommitments(recordId: string): boolean;
getAvailabilityCIQuery(): string;
getApplicationServicesQuery(): string;
getCiFromCommitment(commitmentGR: GlideRecord): string | null;
getCiClassFromCommitment(commitmentGR: GlideRecord): string;
type: "AvailabilityUtils";
}
/**
* Utility for Calendar
*/
declare class CalendarUtils {
static readonly UTC_DATE_FORMAT = "yyyy-MM-dd";
static readonly UTC_TIME_FORMAT = "HH:mm:ss";
log: GSLog;
/**
* Creates an instance of CalendarUtils.
* @memberof CalendarUtils
*/
constructor();
/**
* Get date format from user defined format or system format if not found, but converted to DHTMLX format as per spec:
* {@link http://docs.dhtmlx.com/scheduler/settings_format.html}
* @return {string} DHTMLX user date format or system date format.
* @memberof CalendarUtils
*/
getUserDateFormat(): string;
/**
* Get time format from user defined format or system format if not found, but converted to DHTMLX format as per spec:
* {@link http://docs.dhtmlx.com/scheduler/settings_format.html}
* @return {string} DHTMLX user time format or system time format.
* @memberof CalendarUtils
*/
getUserTimeFormat(): string;
type: "CalendarUtils";
}
/**
* Choice List object
*/
declare class ChoiceList {
constructor(tableName: string, fieldName: string);
getValue(label: string): $$rhino.String | null;
getLabel(value: string): $$rhino.String | null;
}
/**
* @todo Add CIData members
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/CIData/concept/c_CIDataAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_CIDataAPI}
*/
declare class CIData {
type: "CIData";
}
/**
* @todo Add CIRelatedList members
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/CIRelatedList/concept/c_CIRelatedListAPI.htmll}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_CIRelatedListAPI}
*/
declare class CIRelatedList {
type: "CIRelatedList";
}
/**
* @todo Add CIUtils members
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/CIUtils/concept/c_CIUtilsAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_CIUtilsAPI}
*/
declare class CIUtils {
type: "CIUtils";
}
/**
* For a given system property which lists out supported content types, this Script Inlcude checks to make sure the associated attachment stored (passed into class as a GlideRecord) has the correct content_type.
*/
declare class ContentTypeValidator {
defaultSupportedContentTypes: "image/svg+xml";
constructor();
isValidType(attachment: GlideRecord, userDefinedSupportedContentTypes?: string[]): boolean;
}
declare class CurrencyConversionTableList {
constructor();
process(): string[];
type: "CurrencyConversionTableList";
}
/**
* @todo Add DateTimeUtils members
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/DateTimeUtils/concept/c_DateTimeUtilsAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_DateTimeUtilsAPI}
*/
declare class DateTimeUtils {
}
/**
* @todo Add DateTimeUtils members
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/DurationCalculator/concept/c_DurationCalculatorAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_DurationCalculatorAPI}
*/
declare class DurationCalculator {
type: "DurationCalculator";
}
/**
* Core methods to get a default list of encryptable fields, meant to be leveraged by both Edge and Column Level Encryption.
*/
declare class EncryptionCommons {
constructor();
/**
* Lists all fields that can be encrypted for a given table.
* @param {string} tableName - The name of the table.
* @param {{ (ed: GlideElementDescriptor, fieldName: $$rhino.String, ec?: EncryptionCommons): boolean }} [additionalValidator] - Validator that returns true if the field can be encrypted.
* @return {$$rhino.String[]} Name sof encryptable fields for the given table.
* @memberof EncryptionCommons
*/
getEncryptableFieldsForTable(tableName: string, additionalValidator?: { (ed: GlideElementDescriptor, fieldName: $$rhino.String, ec: EncryptionCommons): boolean }): $$rhino.String[];
addToArrayTablesWithBooleanAttributeSetToTrue(array: $$rhino.String[], attributeName: $$rhino.String): $$rhino.String[];
/**
* Tests whether table is marked for auditing.
* @param {string} tableName - The name of the table.
* @return {boolean} True if the table is marked for auditing; otherwise, false.
* @memberof EncryptionCommons
*/
isTableAudited(tableName: string): boolean;
getUsableCryptoModules(): $$rhino.String[];
type: "EncryptionCommons";
}
/**
* Choice list for job type field based on user session and 'glide_encryption.cle_replatforming_with_kmf'
*/
declare class EncryptionJobTypeChoices {
constructor();
process(): GlideChoiceList;
type: "EncryptionJobTypeChoices";
}
declare class GlideCryptoModule {
static get(): GlideCryptoModule;
static getModule(cryptoModuleName: $$rhino.String): GlideCryptoModule;
CRYPTO_MODULE: sn_kmf_ns.KMFCryptoModule | null;
constructor(cryptoModule: sn_kmf_ns.KMFCryptoModule);
encryptData(data: $$rhino.String): $$rhino.String;
wrapKeyFromBytes(data: $$rhino.String): $$rhino.String;
wrapKeyFromBytesForAlgorithm(data: $$rhino.String, algorithm: $$rhino.String): $$rhino.String;
wrapKeyFromSysId(data: $$rhino.String): $$rhino.String;
decryptData(data: $$rhino.String): $$rhino.String;
unwrapKey(data: $$rhino.String): $$rhino.String;
unwrapKeyForAlgorithm(data: $$rhino.String, algorithm: $$rhino.String): $$rhino.String;
generateMac(data: $$rhino.String): $$rhino.String;
verifyMac(data: $$rhino.String, expectedMac: $$rhino.String): $$rhino.Boolean;
asymmetricEncryptData(data: $$rhino.String): $$rhino.String;
asymmetricWrapKeyFromBytes(data: $$rhino.String): $$rhino.String;
asymmetricWrapKeyFromBytesForAlgorithm(data: $$rhino.String, algorithm: $$rhino.String): $$rhino.String;
asymmetricWrapKeyFromSysId(data: $$rhino.String): $$rhino.String;
asymmetricDecryptData(data: $$rhino.String): $$rhino.String;
asymmetricUnwrapKey(data: $$rhino.String): $$rhino.String;
asymmetricUnwrapKeyForAlgorithm(data: $$rhino.String, algorithm: $$rhino.String): $$rhino.String;
sign(data: $$rhino.String): $$rhino.String;
verifySignature(data: $$rhino.String, signature: $$rhino.String): $$rhino.Boolean;
discard(): void;
type: "GlideCryptoModule";
}
/**
* The GlideQuery API is an alternative to GlideRecord to perform CRUD operations on record data from server-side scripts.
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server/no-namespace/GlideQueryAPI}
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/GlideQuery/concept/GlideQueryGlobalAPI.html}
*/
declare class GlideQuery {
/**
* Instantiates a GlideQuery object used to build and execute record queries.
* @param {$$rhino.String} table - Name of table to query.
* @memberof GlideQuery
*/
constructor(table: $$rhino.String);
/**
* Aggregates a field using a specified aggregation function.
* @param {$$rhino.String} aggregateType - The type of aggregation function to perform.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
* @description Use this method to build queries that aggregate against multiple fields or use multiple aggregate functions,
* or if you must use the {@link #groupBy()} method. If you only want to aggregate against one field with one function,
* and you don't need to use {@link #groupBy()}, then use {@link #avg()}, {@link #min()}, {@link #max()} or {@link #count()}, instead.
*/
aggregate(aggregateType: AggregateType, field: $$rhino.String): GlideQuery;
/**
* Returns the aggregate average of a given numeric field.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @return {Optional<$$rhino.Number>} Object that contains the aggregate average of the given field.
* @memberof GlideQuery
* @description You can only use this method on Integer, Long, Floating Point Number, Double and Currency fields.
*/
avg(field: $$rhino.String): Optional<$$rhino.Number>;
/**
* Returns the number of records that match the query.
* @return {$$rhino.Number} Number of records that match the query.
* @memberof GlideQuery
*/
count(): $$rhino.Number;
/**
* Deletes all records in the table specified by the preceding Where clauses.
* @memberof GlideQuery
*/
deleteMultiple(): void;
/**
* Disables updating system fields, or fields with a name that starts with the sys prefix, such as sys_created_on, sys_updated_on, and sys_mod_count.
* Only applies to the specified query.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
disableAutoSysFields(): GlideQuery;
/**
* Disables any business rules, flows, workflows, or audit records that would run or be created as the result of the query.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
disableWorkflow(): GlideQuery;
/**
* Forces a database update even when no record changes are made. For example, you can use this method to force a business rule to execute.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
forceUpdate(): GlideQuery;
/**
* Returns a single record from the query.
* @param {$$rhino.String} key - Sys_id of the record to return.
* @param {$$rhino.String[]} [selectedFields] - Optional additional fields to return in the result.
* The system always returns the sys_id.
* @return {Optional<{ [key: string]: $$rhino.String; }>} Object used to interact with a single record.
* @memberof GlideQuery
*/
get(key: $$rhino.String, selectedFields?: $$rhino.String[]): Optional<{ [key: string]: $$rhino.String; }>;
/**
* Returns an Optional object containing a single record based on a set of name-value pairs to query by.
* Assumes the '=' operator for each name-value pair.
* @param {{ [key: string]: any; }} keyValues - Object where the keys are the name of the fields, and the values are the values to query for.
* @param {$$rhino.String[]} [selectedFields] - Optional additional fields to return in the result.
* The system always returns the sys_id.
* @return {Optional<{ [key: string]: $$rhino.String; }>} Object used to interact with a single record.
* @memberof GlideQuery
*/
getBy(keyValues: { [key: string]: any; }, selectedFields?: $$rhino.String[]): Optional<{ [key: string]: $$rhino.String; }>;
/**
* Groups the query results by a designated field or fields.
* @param {($$rhino.String | $$rhino.String[])} fields - Field or fields to group the results by.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
* @description You must use this method with the {@link #aggregate} method.
*/
groupBy(fields: $$rhino.String | $$rhino.String[]): GlideQuery;
/**
* Filters aggregate groups so that you can display only groups of results that match a specified condition.
* @param {AggregateType} aggregateType - The type of aggregation function to perform.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @param {NumberQueryOperator} operator - Numeric operator to use in the operation.
* @param {$$rhino.Number} value - Number value to use in the operation.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
having(aggregateType: AggregateType, field: $$rhino.String, operator: NumberQueryOperator, value: $$rhino.Number): GlideQuery;
/**
* Inserts a record and returns an Optional object containing the record.
* @param {{ [key: string]: any; }} keyValues - Object containing name-value pairs to insert into the record. Unspecified fields will be null.
* @param {$$rhino.String[]} [selectedFields] - Optional additional fields to return in the result.
* The system always returns the sys_id.
* @return {Optional<{ [key: string]: $$rhino.String; }>} Object used to interact with a single record.
* @memberof GlideQuery
*/
insert(keyValues: { [key: string]: any; }, selectedFields?: $$rhino.String[]): Optional<{ [key: string]: $$rhino.String; }>;
/**
* Updates an existing record, or inserts a new record if one does not already exist.
* @param {{ [key: string]: any; }} changes - Object containing name-value pairs to update or insert into the record.
* @param {$$rhino.String[]} [selectedFields] - Optional additional fields to return in the result.
* The system always returns the sys_id.
* @return {Optional<{ [key: string]: $$rhino.String; }>} Object used to interact with a single record.
* @memberof GlideQuery
*/
insertOrUpdate(changes: { [key: string]: any; }, selectedFields?: $$rhino.String[]): Optional<{ [key: string]: $$rhino.String; }>;
/**
* Limits the number of records returned in a query.
* @param {$$rhino.Number} limit - Number of records to return.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
limit(limit: $$rhino.Number): GlideQuery;
/**
* Returns the aggregate maximum of a given field.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @return {Optional<$$rhino.String>} Object used to interact with a single record.
* @memberof GlideQuery
*/
max(field: $$rhino.String): Optional<$$rhino.String>;
/**
* Returns the aggregate minimum of a given field.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @return {Optional<$$rhino.String>} Object used to interact with a single record.
* @memberof GlideQuery
*/
min(field: $$rhino.String): Optional<$$rhino.String>;
/**
* Orders the returned result in ascending order by a given field.
* @param {$$rhino.String} fields - Comma-delimited fields to order the result by in ascending order.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
orderBy(fields: $$rhino.String): GlideQuery;
/**
* Orders the returned result in descending order by a given field.
* @param {$$rhino.String} fieldOrAggregate - If the query does not use the aggregate() method, pass the field to order the results by.
* If the query uses the {@link #aggregate} method, pass the type of aggregation function ({@link AggregateType}) to perform.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
orderByDesc(fieldOrAggregate: $$rhino.String, field: $$rhino.String): GlideQuery;
/**
* Adds an OR clause to a query that returns values based on a given condition.
* @param {($$rhino.String | GlideQuery)} fieldOrQuery - Field or another GlideQuery object used in the where clause.
* If passing a field, you can dot-walk to a desired value.
* @param {$$rhino.Nilable<QueryOperator>} operator - Optional operator used in the where clause.
* If you do not pass an argument, the system uses the = operator.
* @param {*} value - Value used in the where clause.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
orWhere(fieldOrQuery: $$rhino.String | GlideQuery, operator: $$rhino.Nilable<QueryOperator>, value: any): GlideQuery;
/**
* Adds an OR clause that returns records that do not contain a null value in a given field.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
orWhereNotNull(field: $$rhino.String): GlideQuery;
/**
* Adds an OR clause to a query that returns records that contain a null value in a given field.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
orWhereNull(field: $$rhino.String): GlideQuery;
/**
* Returns the results of the query as a Stream object containing the specified fields.
* @param {($$rhino.String | $$rhino.String[])} fields - Fields to display in the result.
* You can provide any number of fields as arguments, dot-walk to a desired value, or use a flag.
* @return {Stream<{ [key: string]: $$rhino.String; }>} Object used to interact with a stream of items such as records.
* @memberof GlideQuery
* @description You can append a flag to a field name to return the field's metadata instead of the field's value.
* For example, using the field name company$DISPLAY returns the display value of a company field. Possible flags include:
* DISPLAY=Returns the display value of a field;
* CURRENCY_CODE=Returns the currency code of a currency field;
* CURRENCY_DISPLAY=Returns the currency display value of a currency field;
* CURRENCY_STRING=Returns the currency string of a currency field.
*/
select(fields: $$rhino.String | $$rhino.String[]): Stream<{ [key: string]: $$rhino.String; }>;
/**
* Returns the result of the query as an Optional object containing specified fields.
* @param {$$rhino.String} [fields] - Fields to display in the result.
* You can provide any number of fields as arguments, dot-walk to a desired value, or use a flag.
* @return {Optional<{ [key: string]: $$rhino.String; }>} Object used to interact with a single record.
* @memberof GlideQuery
* @description You can append a flag to a field name to return the field's metadata instead of the field's value.
* For example, using the field name company$DISPLAY returns the display value of a company field. Possible flags include:
* DISPLAY=Returns the display value of a field;
* CURRENCY_CODE=Returns the currency code of a currency field;
* CURRENCY_DISPLAY=Returns the currency display value of a currency field;
* CURRENCY_STRING=Returns the currency string of a currency field.
*/
selectOne(fields?: $$rhino.String): Optional<{ [key: string]: $$rhino.String; }>;
/**
* Returns the aggregate sum of a given numeric field.
* @param {$$rhino.String} field - Field on which to perform the operation.
* @return {Optional<$$rhino.Number>} Object used to interact with a single record.
* @memberof GlideQuery
* @description You can only use this method on Integer, Long, Floating Point Number, Double and Currency fields.
*/
sum(field: $$rhino.String): Optional<$$rhino.Number>;
/**
* Returns a GlideRecord or GlideAggregate object that represents the current query.
* @return {(GlideRecord | GlideAggregate)} GlideRecord or GlideAggregate object that contains the query.
* @memberof GlideQuery
* @description After transforming the query, use the query() method in the GlideRecord or GlideAggregate classes to query the database.
*/
toGlideRecord(): GlideRecord | GlideAggregate;
/**
* Updates an existing record that matches the defined conditions.
* @param {{ [key: string]: any; }} changes - Object containing name-value pairs to update in the record. Names must match fields in the table.
* @param {$$rhino.String[]} [selectedFields] - Optional additional fields to return in the result.
* The system always returns the sys_id.
* @return {Optional<{ [key: string]: $$rhino.String; }>} Object used to interact with a single record.
* @memberof GlideQuery
*/
update(changes: { [key: string]: any; }, selectedFields?: $$rhino.String[]): Optional<{ [key: string]: $$rhino.String; }>;
/**
* Updates all existing records that match the defined conditions. Returns the number of records updated.
* @param {{ [key: string]: any; }} changes - Object containing name-value pairs to update in the record. Names must match fields in the table.
* @return {{ rowCount: $$rhino.Number; }} Object containing the number of records that were updated.
* @memberof GlideQuery
*/
updateMultiple(changes: { [key: string]: any; }): { rowCount: $$rhino.Number; };
/**
* Adds a Where clause to the query that returns values based on a given condition.
* @param {($$rhino.String | GlideQuery)} fieldOrQuery - Field or another GlideQuery object used in the where clause.
* @param {$$rhino.Nilable<$$rhino.String>} operator - Optional operator used in the where clause.
* If you do not pass an argument, the system uses the = operator.
* @param {*} value - Value used in the where clause.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
* @description Do not precede this method with the {@link #orWhere}, {@link #orWhereNull}, or {@link #orWhereNotNull} methods.
*/
where(fieldOrQuery: $$rhino.String | GlideQuery, operator: $$rhino.Nilable<$$rhino.String>, value: any): GlideQuery;
/**
* Returns records that do not contain a null value in a given field.
* @param {$$rhino.String} field - Field used in the query.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
* @description Do not precede this method with the {@link #orWhere}, {@link #orWhereNull}, or {@link #orWhereNotNull} methods.
*/
whereNotNull(field: $$rhino.String): GlideQuery;
/**
* Returns records that do not contain a null value in a given field.
* @param {$$rhino.String} field - Field used in the query.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
* @description Do not precede this method with the {@link #orWhere}, {@link #orWhereNull}, or {@link #orWhereNotNull} methods.
*/
whereNull(field: $$rhino.String): GlideQuery;
/**
* Executes the query using the GlideRecordSecure API to securely query the database while honoring ACLs.
* @return {GlideQuery} The query object being built.
* @memberof GlideQuery
*/
withAcls(): GlideQuery;
type: "GlideQuery";
}
/**
* @todo Document global.GlideQueryActions
* @todo Add members for global.GlideQueryActions with {@link https://usmskdev2.servicenowservices.com//nav_to.do?uri=sys_script_include.do?sys_id=89cffabe29300010fa9b76addd33871b}
*/
declare class GlideQueryActions {
type: "GlideQueryActions";
}
/**
* @todo Document global.GlideQueryEvaluator
* @todo Add members for global.GlideQueryEvaluator with {@link https://usmskdev2.servicenowservices.com//nav_to.do?uri=sys_script_include.do?sys_id=d52b3c8a08013300fa9b4300d8d67a76}
*/
declare class GlideQueryEvaluator {
type: "GlideQueryEvaluator";
}
/**
* Utility class for working with GlideRecords.
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/GlideRecordUtil/concept/c_GlideRecordUtilAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_GlideRecordUtilAPI}
*/
declare class GlideRecordUtil {
/**
* Returns the GlideRecord object for the specified configuration item (CI) using just the sys_id of the CI.
* Use this method to quickly obtain a specific CI without knowing its associated class/table.
* @param {string} sys_id - Sys_id of the desired CI.
* @return {(GlideRecord | undefined)} GlideRecord object of the specified CI.
*/
getCIGR(sys_id: string): GlideRecord | undefined;
/**
* Returns an array of all the fields in the specified GlideRecord.
* Note: If there is a field name which is the same as the table name, the getFields() method does not return the value of the field.
* @param {GlideRecord} gr - GlideRecord instance positioned to a valid record.
* @return {string[]} Field names for the specified GlideRecord.
*/
getFields(gr: GlideRecord): string[];
/**
* Returns a GlideRecord instance for the given table, positioned to the given sys_id, and of the right class (table).
* This method is useful when you need to load a GlideRecord from a sys_id, but you don't know what the actual table is (because it may be extended from the base table).
* This method always returns a GlideRecord of the correct type base_table: the name of the base table that the specified sys_id is in.
* @param {string} baseTable - The name of the base table containing the sys_id.
* @param {string} sys_id - The sys_id of the desired record.
* @return {(GlideRecord | null)} The GlideRecord for the specified sys_id or null it not found.
*/
getGR(baseTable: string, sys_id: string): GlideRecord | null;
/**
* Returns a Java ArrayList of the ancestors of the specified table name.
* @param {string} tableName - Name of the table.
* @return {Packages.java.util.ArrayList<Packages.java.lang.String>} List of ancestors of the specified table.
*/
getTables(tableName: string): Packages.java.util.ArrayList<Packages.java.lang.String>;
/**
* Sets the fields in the specified GlideRecord with the field values contained in the specified hashmap, unless that field name is in the ignore hashmap.
* @param {{ [key: string]: string; }} hashMap - An Object instance (being used as a hashmap), with properties named for fields and containing the fields' value.
* @param {GlideRecord} now_GR - The GlideRecord instance to receive the field values.
* @param {{ [key: string]: boolean; }} [ignore] - An optional hashmap of field names to ignore.
*/
mergeToGR(hashMap: { [key: string]: string; }, now_GR: GlideRecord, ignore?: { [key: string]: boolean; }): void;
/**
* Populates the given hashmap from the given GlideRecord instance. Each field in the GlideRecord becomes a property in the hashmap.
* @param {{ [key: string]: string }} hashMap - An object being used as a hashmap.
* @param {GlideRecord} now_GR - A GlideRecord instance positioned to a valid record.
* @param {{ [key: string]: boolean; }} [ignore] - An optional hashmap of file names not to populate.
*/
populateFromGR(hashMap: { [key: string]: string }, now_GR: GlideRecord, ignore?: { [key: string]: boolean; }): void;
type: "GlideRecordUtil";
}
/**
* Utility api for supporting client side Grid Canvas layouts.
* @todo Add members for global.GridCanvasLoader with {@link https://usmskdev2.servicenowservices.com//nav_to.do?uri=sys_script_include.do?sys_id=264ff6c1d7230200a8228f0b6e6103ff}
*/
declare class GridCanvasLoader extends AbstractAjaxProcessor {
type: "GridCanvasLoader";
}
/**
* Make logging and debugging from Script easier by implementing levels of log output, selectable by per-caller identified sys_properties values.
* This implements both Log4j style logging and BSD Syslog style logging. As default, the logger will use BSD style logging.
* PLEASE CHOOSE ONE AND STICK TO IT (within a class anyhow)
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/GSLogBoth/concept/GSLogBoth.html}
* @todo Add members for global.GSLog with {@link https://usmskdev2.servicenowservices.com//nav_to.do?uri=sys_script_include.do?sys_id=2e59987d0a0a2c3946f7118c070c03e3}
*/
declare class GSLog {
type: "GSLog";
}
/**
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/HostnameJS/concept/c_HostnameJSAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_HostnameJSAPI}
* @todo Add members for HostnameJS with {@link https://usmskdev2.servicenowservices.com/nav_to.do?uri=sys_script_include.do?sys_id=8998a2500ab3015300e6ebbf8bc77f26}
*/
declare class HostnameJS {
type: "HostnameJS";
}
/**
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_ICalUtilAPI}
* @todo Document global.ICalUtil
*/
declare type ICalUtil = Exclude<ICalUtilSNC, "type"> & { type: "ICalUtil"; };
/**
* Provides functions to generate iCalendar compliant events.
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/ICalUtilSNC/concept/c_ICalUtilSNCAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_ICalUtilSNCAPI}
* @todo Add members for global.ICalUtilSNC with {@link https://usmskdev2.servicenowservices.com//nav_to.do?uri=sys_script_include.do?sys_id=0944d627c3202200b6dcdfdc64d3aebb}
*/
declare class ICalUtilSNC {
type: "ICalUtilSNC";
}
/**
* Incident state constants, use these constants when determining which incident state to use.
* @todo Add members for global.IncidentState with {@link https://usmskdev2.servicenowservices.com//nav_to.do?uri=sys_script_include.do?sys_id=3d9e146f9fa302000391b89a442e7005}
*/
declare class IncidentState extends AbstractAjaxProcessor {
type: "IncidentState";
}
/**
* @todo Add members for IncidentUtils with {@link https://usmskdev2.servicenowservices.com/nav_to.do?uri=sys_script_include.do?sys_id=87e5e796531232000600e26b88dc3478}
*/
declare class IncidentUtils {
type: "IncidentUtils";
}
/**
* This function contains utility functions related to Incident . This function should not be modified by the customer.=
* @todo Add members for global.IncidentUtilsSNC with {@link https://usmskdev2.servicenowservices.com//nav_to.do?uri=sys_script_include.do?sys_id=a1b5e796531232000600e26b88dc3472}
*/
declare class IncidentUtilsSNC {
// * Public functions :
// *
// * ajaxFunction_getIncidentQueryParams
// * ajaxFunction_makeIncidentCopy
// * ajaxFunction_getKnowledgeGapMapping
// * isCopyIncidentFlagValid
// * makeRelatedTableCopy
// * copyIncidentRelatedLists
// * copyIncidentAttachments
// * getCsvValue
// * getProblemFromIncident
type: "IncidentUtilsSNC";
}
/**
* @todo Add members for IncidentUtils2 with {@link https://usmskdev2.servicenowservices.com/nav_to.do?uri=sys_script_include.do?sys_id=44ebab4fc7001010c24ae122c7c26034}
*/
declare class IncidentUtils2 {
type: "IncidentUtils2";
}
/**
* @todo Add members for IncidentUtils2SNC with {@link https://usmskdev2.servicenowservices.com/nav_to.do?uri=sys_script_include.do?sys_id=0ebbe74fc7001010c24ae122c7c26009}
*/
declare class IncidentUtils2SNC {
type: "IncidentUtils2SNC";
}
/**
* Called by processor to create a generic hierarchy diagram. May be extended to create new types of hierarchy diagrams.
* @todo Add members for global.InheritedRoleMapProcessor with {@link https://usmskdev2.servicenowservices.com//nav_to.do?uri=sys_script_include.do?sys_id=5b354e909f0002003d5c77a0942e7042}
*/
declare class InheritedRoleMapProcessor extends AbstractAjaxProcessor {
type: "InheritedRoleMapProcessor";
}
/**
*
* @param {*} javaObject
* @return {*}
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/j2js/concept/c_J2jsAPI.html}
* @see {@link https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_J2jsAPI}
*/
declare function j2js(javaObject: any): any;
/**
* Provides scoped methods to create JSON objects from a string, and to turn JSON objects into strings.
* @see {@link https://docs.servicenow.com/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/JSON/concept/c_JSONAPI.html}