-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathscripts.om.d.ts
More file actions
1801 lines (1471 loc) · 40.2 KB
/
Copy pathscripts.om.d.ts
File metadata and controls
1801 lines (1471 loc) · 40.2 KB
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
/* eslint-disable */
export type ObjectOfStringArray = {
[key: string]: string[];
}
export type StringMap = {
[key: string]: string;
};
export interface Cell {
setValue(value: number | string | boolean | null): this;
/** @remarks Boolean cube values are returned as strings 'true'/'false' */
getValue(): number | string | null;
getVisualValue(): string | null;
/** @remarks Boolean cube values are returned as strings 'true'/'false' */
getNativeValue(): number | string | null;
getContextValue(): string | null;
definitions(): number[];
columns(): LabelsGroup | null;
rows(): LabelsGroup | null;
dropDown(): Labels;
getFormatType(): string;
isEditable(): boolean;
}
export interface Cells {
all(): Cell[];
first(): Cell | null;
setValue(value: number | string | boolean | null): this;
count(): number;
chunkInstance(): GridRangeChunk;
getByIndexes(indexes: number[]): Cells;
}
export interface Label {
longId(): number;
name(): string;
code(): string | null;
alias(): string;
label(): string;
parentLongId(): number;
hierarchyLongId(): number;
}
export type EntityInfo = Label;
export interface LabelsGroup {
all(): Label[];
first(): Label;
cells(): Cells;
}
export interface Labels {
start(): number;
count(): number;
all(): LabelsGroup[];
get(index: number): LabelsGroup | null;
chunkInstance(): GridRangeChunk;
findLabelByLongId(longId: number): Label | null;
}
export interface GridRangeChunk {
cells(): Cells;
rows(): Labels;
columns(): Labels;
}
export interface GridRange {
rowStart(): number;
rowCount(): number;
columnStart(): number;
columnCount(): number;
cellCount(): number;
generator(size?: number): IterableIterator<GridRangeChunk>;
}
export interface GridDimension {
getDimensionEntity(): EntityInfo;
}
export interface GridPageSelector extends GridDimension {
getSelectedEntity(): EntityInfo | null;
}
export interface GridDefinitionInfo {
getPageSelectors(): GridPageSelector[];
getRowDimensions(): GridDimension[];
getColumnDimensions(): GridDimension[];
}
export interface Grid {
range(rowStart?: number, rowCount?: number, columnStart?: number, columnCount?: number): GridRange;
rowCount(): number;
columnCount(): number;
cellCount(): number;
getDefinitionInfo(): GridDefinitionInfo;
exporter(): Exporter;
storageExporter(): StorageExporter;
}
export interface ExportResult {
mergeToExternalExcelSheet(toFile: string, toSheet: string, fromSheet?: string): this;
getHash(): string | null;
copyToLocal(path: string): this;
moveToLocal(path: string): this;
}
export interface Exporter {
setEncoding(encoding: string): this;
setFormat(extension: string): this;
setOmitSummaryRows(omitSummaryRows: boolean): this;
setOmitEmptyRows(omitEmptyRows: boolean): this;
setIncludeCodes(includeCodes: boolean): this;
setMappingForFlexibleImport(mappingForFlexibleImport: boolean): this;
setMappingForAdvancedImport(mappingForAdvancedImport: boolean): this;
setFileName(fileName: string): this;
setDelimiter(delimiter: string): this;
setEnclosure(enclosure: string): this;
setEscape(escape: string): this;
setShowAliasesWithoutNames(showAliasesWithoutNames: boolean): this;
setUseCodeLikeLabels(useCodeLikeLabels: boolean): this;
export(): ExportResult;
}
export interface Pivot {
create(): Grid;
rowsFilter(data: string | string[] | number | number[]): this;
columnsFilter(data: string | string[] | number | number[]): this;
withoutValues(): this;
addDependentContext(identifier: number): this;
}
export interface BaseElementsCreator {
setPositionAfter(relativeLongId: number): this;
setPositionBefore(relativeLongId: number): this;
setPositionStart(): this;
setPositionEnd(): this;
setPositionChildOf(parentLongId: number): this;
create(): number[];
}
export interface NumericElementsCreator extends BaseElementsCreator {
setCount(count: number): this;
}
export interface NamedElementsCreator extends BaseElementsCreator {
setElementNames(names: string[]): this;
}
export interface ElementsCreator {
numeric(): NumericElementsCreator;
named(): NamedElementsCreator;
}
export interface ElementsDeleter {
appendIdentifier(identifier: number): this;
delete(): this;
}
export interface ElementsReorder {
append(longId: number, relativeLongId?: number, position?: string): this;
reorder(): this;
count(): number;
reverse(): this;
}
export interface Tab {
pivot(viewName?: string | null): Pivot;
}
export interface Environment {
load(name: string): this;
loadFromMulticube(name: string, view?: string | null): this;
get(key: string, def?: any): any;
set(name: string, value: number | string | boolean | null): this;
}
export interface CubeCell {
definitions(): number[];
getDimensionIds(): number[];
getDimensionItems(): EntityInfo[];
getValue(): number | string | boolean | null;
}
export interface CubeCellSelector {
getCubeInfo(): CubeInfo;
getCubeIdentifier(): number;
getCubeDimensions(): EntityInfo[];
generator(): IterableIterator<CubeCell>;
}
export interface CubeCellSelectorBuilder {
setFormula(formula: string): this;
setStartCell(longIds: number[]): this;
setMaxCount(count: number): this;
load(): CubeCellSelector;
}
export interface CubeCellUpdater {
getCount(): number;
}
export interface CubeCellUpdaterBuilder {
setConditionFormula(formula: string): this;
setFormula(formula: string): this;
load(): CubeCellUpdater;
}
export interface CubeFormatInfo {
getFormatTypeEntity(): EntityInfo;
getDimensionEntity(): EntityInfo | null;
}
export interface CubeInfo extends EntityInfo {
getFormula(): string | null;
getFormatInfo(): CubeFormatInfo;
getDimensions(): EntityInfo[];
}
export interface StorageExporter extends Exporter {
setLineDelimiter(lineDelimiter: string): this;
setFilterFormula(filterFormula: string): this;
setDecimalSeparator(decimalSeparator: string): this;
setDateFormat(dateFormat: string): this;
setBooleanCubeIdentifier(booleanCubeIdentifier: number): this;
}
export interface SyncResult {
getReportPath(): string;
}
export interface SyncBuilder {
/**
* @param modelId Source model string identifier or name
*/
setSrcModelId(modelId: string): this;
/**
* @param modelId Destination model string identifier or name
*/
setDestModelId(modelId: string): this;
/**
* @param entityId Source entity identifier
*/
setSrcEntityId(entityId: number): this;
/**
* @param entityId Destination entity identifier
*/
setDestEntityId(entityId: number): this;
setFilters(filters: Record<string, string[]>): this;
setMappings(mappings: ImportMappings): this;
sync(): SyncResult;
}
export interface SimpleMapping {
from: string;
to: string;
}
export interface AdditionalDimensionMapping {
dimensionName: string;
dimensionItemName: string;
}
export interface DimensionItemMapping {
dimensionName: string;
dimensionItemMap: StringMap;
}
export interface ImportMappings {
dimensionMapping?: SimpleMapping[];
cubeMapping?: SimpleMapping[];
namespaceMapping?: SimpleMapping[];
additionalDimensionMapping?: AdditionalDimensionMapping[];
dimensionItemMapping?: DimensionItemMapping[];
}
export interface SyncMulticubeBuilder extends SyncBuilder {
setOmitEmptyRows(status: boolean): this;
setOmitSummaryRows(status: boolean): this;
setUseCodeInsteadLabel(status: boolean): this;
}
export interface SyncListBuilder extends SyncBuilder {
setViewId(viewId: number): this;
setSrcToDesListMap(map: {
sourceListLongId: number,
destinationListLongId: number,
}[]): this;
setProxySrcColumnDataMap(map: {
fromName: string;
toName: string;
}[]): this;
/**
* @param format Values: XLSX|CSV, Default: CSV
*/
setReportFileFormat(format: string): this;
}
export interface CubesTab extends Tab {
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
}
export interface MulticubeTab extends Tab {
cleanCellsData(cubesIdentifiers?: number[]): this;
cubeCellSelector(identifier: string | number): CubeCellSelectorBuilder;
cubeCellUpdater(identifier: string | number): CubeCellUpdaterBuilder;
getCubeInfo(identifier: string | number): CubeInfo;
cubesTab(): CubesTab;
importer(): MulticubeImporter;
storageImporter(): StorageImporter;
}
export interface MulticubesTab extends Tab {
open(name: string): MulticubeTab;
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
}
export interface Multicubes {
multicubesTab(): MulticubesTab;
syncMulticube(): SyncMulticubeBuilder;
}
export interface TimePeriodSubsetTab extends Tab {
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
}
export interface TimePeriodTab extends Tab {
subsetsTab(): TimePeriodSubsetTab;
importer(): TimePeriodImporter;
}
export interface Times {
optionsTab(): TimeOptionsTab;
timePeriodTab(identifier: string | number): TimePeriodTab;
}
export interface TimeOptionsTab extends Tab {
resetForm(): Object;
applyForm(): Object;
}
export interface VersionsTab extends Tab {
copyVersion(from: string, to: string): Object;
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
importer(): VersionsImporter;
}
export interface VersionSubsetsTab extends Tab {
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
}
export interface VersionAccessTab extends Tab {
}
export interface Versions {
versionsTab(): VersionsTab;
versionSubsetsTab(): VersionSubsetsTab;
versionAccessTab(): VersionAccessTab;
}
export interface CSVParams {
setDelimiter(delimiter: string): this;
getDelimiter(): string;
setEnclosure(enclosure: string): this;
getEnclosure(): string;
setEscape(escape: string): this;
getEscape(): string;
setLineDelimiter(lineDelimiter: string): this;
getLineDelimiter(): string;
}
export interface Importer {
csv(): CSVParams;
setFilePath(path: string): this;
getFilePath(): string;
getReportFilePath(): string;
setEncoding(encoding: string): this;
getEncoding(): string;
import(): this;
}
export interface StorageImporter extends Importer {
setMaxFailures(maxFailures: number): this;
setIsCompressed(isCompressed: boolean): this;
setDateFormat(dateFormat: string): this;
setMappings(mappings: Object): this;
}
export interface ListImporter extends Importer {
setFilePath(path: string): this;
setObligatoryListCodes(obligatoryListCodes: boolean): this;
getObligatoryListCodes(): boolean;
setImportToChildListOnly(importToChildListOnly: boolean): this;
getImportToChildListOnly(): boolean;
setUpdatedPropertiesOnParentLevels(updatedPropertiesOnParentLevels: boolean): this;
getUpdatedPropertiesOnParentLevels(): boolean;
}
export interface MulticubeImporter extends Importer {
}
export interface VersionsImporter extends Importer {
}
export interface TimePeriodImporter extends Importer {
}
export interface ListUserAccessTab extends Tab {
}
export interface ListSubsetsTab extends Tab {
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
}
export interface CustomPropertiesTab extends Tab {
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
}
export interface ListTab extends Tab {
listSubsetTab(): ListSubsetsTab;
customPropertiesTab(): CustomPropertiesTab;
uamTab(): ListUserAccessTab;
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
importer(): ListImporter;
}
export interface ListsTab extends Tab {
open(name: string): ListTab;
elementsCreator(): ElementsCreator;
elementsDeleter(): ElementsDeleter;
elementsReorder(): ElementsReorder;
}
export interface Lists {
listsTab(): ListsTab;
syncList(): SyncListBuilder;
}
export interface CellBuffer {
set(cell: Cell | CubeCell, value: number | string | boolean | null): this;
apply(): this;
count(): number;
canLoadCellsValues(value: boolean): this;
lastApplyErrors(): CellApplyError[];
}
export interface CellApplyError {
definitions(): number[];
error(): string;
}
export namespace ApiService {
export interface RequestFileInfo {
getName(): string;
getFileName(): string;
getFileSize(): number;
copyToLocal(path: string): this;
}
export interface RequestFileInfos {
get(key: string): RequestFileInfo | null;
getAll(): RequestFileInfo[];
}
export interface ParamInfo {
getName(): string;
getValue(): string | null;
}
export interface ParamInfos {
get(key: string): ParamInfo | null;
getAll(): ParamInfo[];
}
export interface ResponseCookieInfos {
append(name: string, value: string, ttl: number): this;
}
// Awaiting for implementation
// export interface ResponseHeaderInfos {
// append(name: string, value: string): this;
// }
export interface ResponseFileInfos {
append(fileId: string): this;
}
export interface ResponseBodyParamInfos {
append(name: string, value: number | string | boolean | Object): this;
}
export interface ResponseInfo {
getCookieInfos(): ResponseCookieInfos;
getFileInfos(): ResponseFileInfos;
getBodyParamInfos(): ResponseBodyParamInfos;
}
export interface ClientInfo {
getAgent(): string;
getIp(): string;
}
export interface RequestInfo {
getMethod(): string;
getClientInfo(): ClientInfo;
getCookieInfos(): ParamInfos;
getHeaderInfos(): ParamInfos;
getUrlParamInfos(): ParamInfos;
getFileInfos(): RequestFileInfos;
getBodyParamInfos(): ParamInfos;
getResponseInfo(): ResponseInfo;
}
}
export interface RequestManager {
log(message: string, print?: boolean): this;
logStatusMessage(message: string, print?: boolean): this;
setStatusMessage(message: string): this;
}
export interface UserInfo {
getEntity(): EntityInfo;
getEmail(): string;
getFirstName(): string;
getLastName(): string;
getRole(): EntityInfo;
}
export type ContractInfo = {
contractJson(): string;
errors(): string[];
}
export interface EnterpriseContractManager {
doesWorkspaceRequireContract(): boolean;
getWorkspaceContractInfo(): ContractInfo;
generateSalt(): string;
validateContractJson(jsonStr: string): boolean;
calculateContractHash(contractData: string, salt: string): string;
validateContract(contractData: string, hash: string, salt: string): string;
}
export type MetricData = {
name(): string;
value(): number;
tags(): string;
};
export interface MetricsManager {
getAllMetrics(): MetricData[];
setMetricValue(name: string, value: number, tags?: StringMap[]): this;
getMetricValue(name: string, tags?: StringMap[]): number | null;
}
export interface ExportObfuscationState {
setPath(path: string): this;
setEmailWhiteList(emailWhiteList: string[]): this;
/**
* Default: BIN
* @param type TXT|BIN
*/
setDataArchiveType(type: string): this;
export(): boolean;
}
export type UpdateInputCellsViaFormulaRequest = {
cubeLongId: number;
valueFormula: string;
conditionFormula?: string;
}
export interface ModelInfo {
id(): string;
name(): string;
lastSyncDate(): number;
autoCalcStatus(): boolean;
setModelCalculationMode(status: boolean): boolean;
repair(): boolean;
recalculate(): boolean;
backup(path?: string): EntityInfo | boolean;
export(path: string): boolean;
exportObfuscationState(): ExportObfuscationState;
useUniqueLock(): this;
useSharedLock(): this;
hasUniqueLock(): boolean;
hasSharedLock(): boolean;
unlock(): this;
recalculateIfManualCalculable(identifiers: number[]): boolean;
/**
* @param requests
* @param sortByDependenciesValueFormula Default is true
* @param sortByDependenciesConditionFormula Default is true
*/
batchUpdateInputCellsViaFormula(requests: UpdateInputCellsViaFormulaRequest[], sortByDependenciesValueFormula?: boolean, sortByDependenciesConditionFormula?: boolean): boolean;
getStorageInstancePriority(): number;
setStorageInstancePriority(priority: number): number;
/**
* Default: CONSISTENT_READ
* @param type CONSISTENT_READ|FAST_READ|FAST_READ_METADATA
*/
setModelStorageReadMode(type: string): boolean;
/**
* Default: CONSISTENT_WRITE
* @param type CONSISTENT_WRITE|FAST_WRITE
*/
setModelStorageWriteMode(type: string): boolean;
getStorageReadMode(): string;
getStorageWriteMode(): string;
/**
* @param type CONSISTENT_READ|FAST_READ|FAST_READ_METADATA
*/
setMacrosStorageReadMode(type: string): boolean;
getMacrosStorageReadMode(): string;
recalculateCubes(identifiers: number[]): boolean;
recalculateCubesWithTheirSources(identifiers: number[]): boolean;
recalculateCubesWithTheirDestinations(identifiers: number[]): boolean;
recalculateCubesWithLinkedCubes(identifiers: number[]): boolean;
}
export interface ButtonInfoOptions {
setLabel(label: string): this;
/**
* PRIMARY|SECONDARY
* @param style
*/
setStyle(style: string): this;
}
export interface ButtonInfo {
/**
* GENERAL|CLOSE
* @param type
*/
setType(type: string): this;
options(): ButtonInfoOptions;
}
export interface ResultBaseAction {
appendAfter(): this;
/**
* @param modelId Model string identifier or name
*/
setModelId(modelId: string): this;
}
export interface EnvironmentInfo {
set(key: string, value: any): this;
get(key: string): any;
}
export interface BaseCodeExecutionAction extends ResultBaseAction {
/**
* @param value CUSTOM|SHARED|UNIQUE
* Default is UNIQUE
*/
setLockMode(value: string): this;
setAutoRunTimeout(seconds: number): this;
buttonInfo(): ButtonInfo;
environmentInfo(): EnvironmentInfo;
withPromise(withPromise: boolean): this;
setTaskDescription(description: string): this;
run(): TaskPromise | null;
}
export interface ResultMacrosAction extends BaseCodeExecutionAction {
}
export interface TaskPromise {
getStatus(): string | null;
wait(wait: number): TaskPromiseResult | null;
}
export interface TaskPromiseResult {
getOutput(): string;
getDescription(): string;
getEnvironmentInfo(): EnvironmentInfo;
}
export interface CodeExecutionAction extends BaseCodeExecutionAction {
setMemoryLimit(value: number): this;
setTimeLimit(value: number): this;
}
export interface ResultOpenAction extends ResultBaseAction {
buttonInfo(): ButtonInfo;
}
export interface ResultActionsInfo {
makeMacrosAction(identifier: string | number): ResultMacrosAction;
makeCodeExecutionAction(code: string): CodeExecutionAction;
makeDashboardOpenAction(identifier: string | number): ResultOpenAction;
makeContextTableOpenAction(identifier: string | number): ResultOpenAction;
makeMulticubeViewOpenAction(multicube: string | number, view?: string | number | null): ResultOpenAction;
makeListViewOpenAction(list: string | number, view?: string | number | null): ResultOpenAction;
}
export interface ResultInfo {
addFileHash(hash: string): this;
actionsInfo(): ResultActionsInfo;
setProperty(name: string, value: any): this;
}
export interface EntitiesInfo {
get(longId: number): EntityInfo | null;
getCollection(longId: number[]): EntityInfo[];
}
export interface CopyData {
setSourceLongId(longId: number): this;
setDestLongId(longId: number): this;
enableCopyAllCubes(): this;
enableCustomProperties(): this;
setMulticubeLongIds(longIds: number[]): this;
setMulticubeByNames(names: string[]): this;
copy(): this;
}
export interface BinaryData {
getAsRawString(): string;
}
export interface Crypto {
sha1(data: string): string;
/**
*
* @param algo available values can be retrieved by getHashAlgorithms()
* @param binary defaults to false
*/
hash(algo: string, data: string, binary?: boolean): string | BinaryData;
/**
*
* @param algo available values can be retrieved by getHmacHashAlgorithms()
* @param binary defaults to false
*/
hmac(algo: string, data: string, key: string | BinaryData, binary?: boolean): string | BinaryData;
getHashAlgorithms(): string[];
getHmacAlgorithms(): string[];
}
export interface Common {
createCellBuffer(): CellBuffer;
requestInfo(): RequestManager;
modelInfo(): ModelInfo;
userInfo(): UserInfo;
resultInfo(): ResultInfo;
entitiesInfo(): EntitiesInfo;
copyData(): CopyData;
apiServiceRequestInfo(): ApiService.RequestInfo | null;
enterpriseContractManager(): EnterpriseContractManager;
metricsManager(): MetricsManager;
/**
* @param type CONSISTENT_READ|FAST_READ|FAST_READ_METADATA
*/
setCurrentMacrosStorageReadMode(type: string): boolean;
getCurrentMacrosStorageReadMode(): string;
sleep(sec: number): void;
}
export interface FileMeta {
type: string;
path: string;
visibility: string;
size: number;
dirname: string;
basename: string;
extension: string;
filename: string;
timestamp: number;
}
export interface Filesystem {
has(path: string): boolean;
read(path: string): string;
readAndDelete(path: string): string;
write(path: string, contents: string): null;
delete(path: string): null;
rename(from: string, to: string): null;
copy(from: string, to: string): null;
getTimestamp(path: string): number;
getSize(path: string): number | false;
createDir(path: string): null;
deleteDir(path: string): null;
listContents(path: string, recursive: boolean): FileMeta[];
getMetadata(path: string): Object;
upload(from: string, to: string): boolean;
download(from: string, to: string): boolean;
makeGlobalFile(name: string, extension: string, path: string, copy?: boolean): string;
getPathObj(path: string): PathObj;
changeTextFileCharset(path: string, fromCharset: string, toCharset: string): boolean;
}
export interface PathObj {
getSystem(): Filesystem;
getPath(): string;
}
export interface BaseAdapter {
load(): Filesystem;
}
export interface FTPAdapter extends BaseAdapter {
setHost(host: string): this;
getHost(): string;
setPort(port: number): this;
getPort(): number;
setUsername(username: string): this;
getUsername(): string | null;
setPassword(password: string): this;
getPassword(): string | null;
setRoot(root: string): this;
getRoot(): string;
setPassive(passive: boolean): this;
getPassive(): boolean;
setIgnorePassiveAddress(ignore: boolean): this;
getIgnorePassiveAddress(): boolean;
setSsl(ssl: boolean): this;
getSsl(): boolean;
setTimeout(timeout: number): this;
getTimeout(): number;
setUseListOptions(useListOptions: boolean): this;
getUseListOptions(): boolean;
}
export interface CsvReader {
params(): CSVParams;
/**
* UTF-8, WINDOWS-1251
* @param charset
*/
changeFileCharset(charset: string): this;
generator(): IterableIterator<string[]>;
}
export interface CsvWriter {
params(): CSVParams;
writeRow(row: (number | string | boolean | null)[]): this;
writeRows(rows: (number | string | boolean | null)[][]): this;
/**
*
* @param name
* @param charset UTF-8, WINDOWS-1251
*/
save(name: string, charset?: string): string;
}
export interface BaseConverter {
setSource(path: string): this;
convert(): string;
}
export interface ExcelToCsvConverter extends BaseConverter {
setSheetIdentifier(identifier: string | number): this;
}
export interface ConverterManager {
excelToCsv(): ExcelToCsvConverter;
}
export interface FilesDataManager {
csvWriter(): CsvWriter;
csvReader(path: PathObj): CsvReader;
converterManager(): ConverterManager;
}
export interface Filesystems {
ftp(): FTPAdapter;
local(): Filesystem;
sharedFolder(id: string): Filesystem;
filesDataManager(): FilesDataManager;
}
export interface OptimizationRequestTab extends Tab {
run(name: string): { success: boolean, error?: string };
}
export interface Optimization {
optimizationRequestsTab(): OptimizationRequestTab;
}
export interface SqlQueryResult {
count(): number;
generator(likeArray?: boolean): Object[] | string[][];
all(): Object[];
first(): Object | null;
column(columnName: string): (number | string | boolean | null)[];
cell(columnName: string, rowIndex?: number): number | string | boolean | null;
updated(): number;
lastId(): number;
}
export interface SqlQueryBuilder {
execute(sql: string, bindings?: (string | number | boolean | null)[] | Object): SqlQueryResult;
}
export interface SqlConnection {
qb(): SqlQueryBuilder;
}
export interface SqlConnectorBuilder {
setHost(value: string): this;
setPort(value: number): this;
setUsername(value: string): this;
setPassword(value: string): this;
setDatabase(value: string): this;
load(): SqlConnection;
}
export interface SqlBulkCopyResult {
hasErrors(): boolean;
getErrorOutput(): string;
getOutput(): string;
getCommand(): string;