-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtableau-extensions-0.latest.js
6046 lines (5717 loc) · 666 KB
/
tableau-extensions-0.latest.js
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
window["tableau"] =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/dist-extensions/";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 22);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// This file re-exports everything which is part of the shared embedding api public interface
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(24));
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* This is your main. This is where you re-export everything you want to be publicly available.
*
* The build enforces that the file has the same name as the global variable that is exported.
*/
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(25));
__export(__webpack_require__(26));
__export(__webpack_require__(27));
__export(__webpack_require__(28));
__export(__webpack_require__(29));
__export(__webpack_require__(30));
// These are the exports from the messaging stuff
__export(__webpack_require__(33));
__export(__webpack_require__(9));
// Export a hardcoded version of the internal contract. This should match what's in package.json.
// Normally, we'd use some sort of webpack replacement to inject this into code, but that doesn't
// work with the module-dev-scripts and this isn't too much work.
// If you forget to keep this in sync with package.json, a test will fail so we should be ok.
exports.INTERNAL_CONTRACT_VERSION = {
major: 1,
minor: 0,
fix: 0
};
// Export the version number of messaging for consumers to use.
// Be very careful making any updates to this contract which break version compatibility.
exports.MESSAGING_VERSION = {
major: 1,
minor: 0,
fix: 0
};
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Custom error class that extends the default JavaScript Error object.
* This allows us to provide a field with a specific error code
* so that developers can more easily programmatically respond
* to error scenarios.
*/
var TableauError = /** @class */ (function (_super) {
__extends(TableauError, _super);
function TableauError(_errorCode, message) {
var _this = _super.call(this, _errorCode + ": " + message) || this;
_this._errorCode = _errorCode;
/*tslint:disable-next-line */
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
// Error inheritance does not work propertly when compiling to ES5, this is a workaround to force
// the proto chain to be built correctly. See the github link above for details.
Object.setPrototypeOf(_this, TableauError.prototype);
return _this;
}
Object.defineProperty(TableauError.prototype, "errorCode", {
get: function () {
return this._errorCode;
},
enumerable: true,
configurable: true
});
return TableauError;
}(Error));
exports.TableauError = TableauError;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Export everything which had been previously in the api-shared module
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var Dashboard_1 = __webpack_require__(36);
exports.Dashboard = Dashboard_1.Dashboard;
var EventListenerManager_1 = __webpack_require__(10);
exports.EventListenerManager = EventListenerManager_1.EventListenerManager;
var TableauError_1 = __webpack_require__(2);
exports.TableauError = TableauError_1.TableauError;
var VersionNumber_1 = __webpack_require__(37);
exports.VersionNumber = VersionNumber_1.VersionNumber;
var InternalToExternalEnumMappings_1 = __webpack_require__(7);
exports.InternalToExternalEnumMappings = InternalToExternalEnumMappings_1.InternalToExternalEnumMappings;
var TableauEvent_1 = __webpack_require__(17);
exports.TableauEvent = TableauEvent_1.TableauEvent;
var SingleEventManagerImpl_1 = __webpack_require__(11);
exports.SingleEventManagerImpl = SingleEventManagerImpl_1.SingleEventManagerImpl;
var DashboardImpl_1 = __webpack_require__(38);
exports.DashboardImpl = DashboardImpl_1.DashboardImpl;
var ServiceImplBase_1 = __webpack_require__(8);
exports.ServiceImplBase = ServiceImplBase_1.ServiceImplBase;
var ErrorHelpers_1 = __webpack_require__(5);
exports.ErrorHelpers = ErrorHelpers_1.ErrorHelpers;
__export(__webpack_require__(53));
__export(__webpack_require__(55));
__export(__webpack_require__(4));
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SharedApiExternalContract_1 = __webpack_require__(0);
var TableauError_1 = __webpack_require__(2);
var ServiceRegistryImpl = /** @class */ (function () {
function ServiceRegistryImpl() {
this._services = {};
}
ServiceRegistryImpl.prototype.registerService = function (service) {
this._services[service.serviceName] = service;
};
ServiceRegistryImpl.prototype.getService = function (serviceName) {
if (!this._services.hasOwnProperty(serviceName)) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InternalError, "Service not registered: " + serviceName);
}
return this._services[serviceName];
};
return ServiceRegistryImpl;
}());
/**
* static class used for getting access to the single instance
* of the ApiServiceRegistry
*/
var ApiServiceRegistry = /** @class */ (function () {
// Private to avoid anyone constructing this
function ApiServiceRegistry() {
}
Object.defineProperty(ApiServiceRegistry, "instance", {
/**
* Gets the singleton instance of the ServiceRegistry
*/
get: function () {
if (!window.__tableauApiServiceRegistry) {
ApiServiceRegistry.setInstance(new ServiceRegistryImpl());
}
if (!window.__tableauApiServiceRegistry) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InternalError, 'Service registry failed');
}
return window.__tableauApiServiceRegistry;
},
enumerable: true,
configurable: true
});
/**
* Helper method to override the registry instance. Can be used by unit tests
*
* @param {ServiceRegistry} serviceRegistry The new registry
*/
ApiServiceRegistry.setInstance = function (serviceRegistry) {
window.__tableauApiServiceRegistry = serviceRegistry;
};
return ApiServiceRegistry;
}());
exports.ApiServiceRegistry = ApiServiceRegistry;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SharedApiExternalContract_1 = __webpack_require__(0);
var Param_1 = __webpack_require__(12);
var TableauError_1 = __webpack_require__(2);
/**
* This class is used to construct common errors throughout the external
* projects (api-shared, extensions-api, etc.). It has some duplication with
* the ErrorHelpers class in api-core, but is separate due to the need to throw
* an external TableauError vs. an InternalTableauError.
*/
var ErrorHelpers = /** @class */ (function () {
function ErrorHelpers() {
}
/**
* Throws with code InternalError.
*
* @param apiName name of api that was called.
*/
ErrorHelpers.apiNotImplemented = function (apiName) {
return new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InternalError, apiName + " API not yet implemented.");
};
/**
* Throws an internal error if argument is null or undefined.
*
* @param argumentValue value to verify
* @param argumentName name of argument to verify
*/
/*tslint:disable-next-line */
ErrorHelpers.verifyInternalValue = function (argumentValue, argumentName) {
if (argumentValue === null || argumentValue === undefined) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InternalError, argumentValue + " is invalid value for: " + argumentName);
}
};
/**
* Throws an InvalidParameter error if argument is null or undefined.
*
* @param argumentValue value to verify
* @param argumentName name of argument to verify
*/
/*tslint:disable-next-line */
ErrorHelpers.verifyParameter = function (argumentValue, argumentName) {
if (argumentValue === null || argumentValue === undefined) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InvalidParameter, argumentValue + " is invalid value for paramter: " + argumentName);
}
};
/**
* Throws an InvalidParameter error if argument is empty string, null or undefined.
*
* @param argumentValue value to verify
* @param argumentName name of argument to verify
*/
/*tslint:disable-next-line */
ErrorHelpers.verifyStringParameter = function (argumentValue, argumentName) {
if (argumentValue === null || argumentValue === undefined || argumentValue === '') {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InvalidParameter, argumentValue + " is invalid value for paramter: " + argumentName);
}
};
/**
* Verifies passed value is a valid value for that enum.
* Throws an InvalidParameter error if the enum value is not valid.
*
* String enums are {string : string} dictionaries which are not reverse mappable
* This is an ugly workaround
*
* @param enumValue value to verify
* @param enumType enum to verify against
*/
/*tslint:disable-next-line */
ErrorHelpers.verifyEnumValue = function (enumValue, enumType) {
var isValid = false;
Object.keys(enumType).forEach(function (enumKey) {
if (enumType[enumKey] === enumValue.toString()) {
isValid = true;
}
});
if (!isValid) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InvalidParameter, enumValue + " is invalid value for enum: " + enumType);
}
};
/**
* Verifies the params min and max for applying range filter.
* Throws with error code InvalidParameter if range is invalid.
*
* @param min range min
* @param max range max
*/
/*tslint:disable-next-line */
ErrorHelpers.verifyRangeParamType = function (min, max) {
if (!min && !max) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InvalidParameter, 'Unexpected invalid param value, at least one of min or max is required.');
}
if (min && !Param_1.Param.isTypeNumber(min) && !Param_1.Param.isTypeDate(min)) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InvalidParameter, 'Unexpected invalid param value, only Date and number are allowed for parameter min.');
}
if (max && !Param_1.Param.isTypeNumber(max) && !Param_1.Param.isTypeDate(max)) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InvalidParameter, 'Unexpected invalid param value, only Date and number are allowed for parameter max.');
}
if (min && max && typeof (min) !== typeof (max)) {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InvalidParameter, 'Unexpected invalid param value, parameters min and max should be of the same type.');
}
};
return ErrorHelpers;
}());
exports.ErrorHelpers = ErrorHelpers;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// This file re-exports everything which is part of the extensions api public interface
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
// Export everything from the shared file
__export(__webpack_require__(0));
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SharedApiExternalContract_1 = __webpack_require__(0);
var api_internal_contract_js_1 = __webpack_require__(1);
var EnumConverter_1 = __webpack_require__(16);
/* tslint:disable:typedef - Disable this to make declaring these classes a bit easier */
/**
* Maps enums used by the internal-api-contract to the enums used
* in the external-api-contract, which developers code against.
*/
var InternalToExternalEnumMappings = /** @class */ (function () {
function InternalToExternalEnumMappings() {
}
InternalToExternalEnumMappings.extensionContext = new EnumConverter_1.EnumConverter((_a = {},
_a[api_internal_contract_js_1.ExtensionContext.Desktop] = SharedApiExternalContract_1.ExtensionContext.Desktop,
_a[api_internal_contract_js_1.ExtensionContext.Server] = SharedApiExternalContract_1.ExtensionContext.Server,
_a));
InternalToExternalEnumMappings.extensionMode = new EnumConverter_1.EnumConverter((_b = {},
_b[api_internal_contract_js_1.ExtensionMode.Authoring] = SharedApiExternalContract_1.ExtensionMode.Authoring,
_b[api_internal_contract_js_1.ExtensionMode.Viewing] = SharedApiExternalContract_1.ExtensionMode.Viewing,
_b));
InternalToExternalEnumMappings.columnType = new EnumConverter_1.EnumConverter((_c = {},
_c[api_internal_contract_js_1.ColumnType.Continuous] = SharedApiExternalContract_1.ColumnType.Continuous,
_c[api_internal_contract_js_1.ColumnType.Discrete] = SharedApiExternalContract_1.ColumnType.Discrete,
_c));
InternalToExternalEnumMappings.fieldAggregationType = new EnumConverter_1.EnumConverter((_d = {},
_d[api_internal_contract_js_1.FieldAggregationType.Attr] = SharedApiExternalContract_1.FieldAggregationType.Attr,
_d[api_internal_contract_js_1.FieldAggregationType.Avg] = SharedApiExternalContract_1.FieldAggregationType.Avg,
_d[api_internal_contract_js_1.FieldAggregationType.Count] = SharedApiExternalContract_1.FieldAggregationType.Count,
_d[api_internal_contract_js_1.FieldAggregationType.Countd] = SharedApiExternalContract_1.FieldAggregationType.Countd,
_d[api_internal_contract_js_1.FieldAggregationType.Day] = SharedApiExternalContract_1.FieldAggregationType.Day,
_d[api_internal_contract_js_1.FieldAggregationType.End] = SharedApiExternalContract_1.FieldAggregationType.End,
_d[api_internal_contract_js_1.FieldAggregationType.Hour] = SharedApiExternalContract_1.FieldAggregationType.Hour,
_d[api_internal_contract_js_1.FieldAggregationType.InOut] = SharedApiExternalContract_1.FieldAggregationType.InOut,
_d[api_internal_contract_js_1.FieldAggregationType.Kurtosis] = SharedApiExternalContract_1.FieldAggregationType.Kurtosis,
_d[api_internal_contract_js_1.FieldAggregationType.Max] = SharedApiExternalContract_1.FieldAggregationType.Max,
_d[api_internal_contract_js_1.FieldAggregationType.Mdy] = SharedApiExternalContract_1.FieldAggregationType.Mdy,
_d[api_internal_contract_js_1.FieldAggregationType.Median] = SharedApiExternalContract_1.FieldAggregationType.Median,
_d[api_internal_contract_js_1.FieldAggregationType.Min] = SharedApiExternalContract_1.FieldAggregationType.Min,
_d[api_internal_contract_js_1.FieldAggregationType.Minute] = SharedApiExternalContract_1.FieldAggregationType.Minute,
_d[api_internal_contract_js_1.FieldAggregationType.MonthYear] = SharedApiExternalContract_1.FieldAggregationType.MonthYear,
_d[api_internal_contract_js_1.FieldAggregationType.None] = SharedApiExternalContract_1.FieldAggregationType.None,
_d[api_internal_contract_js_1.FieldAggregationType.Qtr] = SharedApiExternalContract_1.FieldAggregationType.Qtr,
_d[api_internal_contract_js_1.FieldAggregationType.Quart1] = SharedApiExternalContract_1.FieldAggregationType.Quart1,
_d[api_internal_contract_js_1.FieldAggregationType.Quart3] = SharedApiExternalContract_1.FieldAggregationType.Quart3,
_d[api_internal_contract_js_1.FieldAggregationType.Second] = SharedApiExternalContract_1.FieldAggregationType.Second,
_d[api_internal_contract_js_1.FieldAggregationType.Skewness] = SharedApiExternalContract_1.FieldAggregationType.Skewness,
_d[api_internal_contract_js_1.FieldAggregationType.Stdev] = SharedApiExternalContract_1.FieldAggregationType.Stdev,
_d[api_internal_contract_js_1.FieldAggregationType.Stdevp] = SharedApiExternalContract_1.FieldAggregationType.Stdevp,
_d[api_internal_contract_js_1.FieldAggregationType.Sum] = SharedApiExternalContract_1.FieldAggregationType.Sum,
_d[api_internal_contract_js_1.FieldAggregationType.TruncDay] = SharedApiExternalContract_1.FieldAggregationType.TruncDay,
_d[api_internal_contract_js_1.FieldAggregationType.TruncHour] = SharedApiExternalContract_1.FieldAggregationType.TruncHour,
_d[api_internal_contract_js_1.FieldAggregationType.TruncMinute] = SharedApiExternalContract_1.FieldAggregationType.TruncMinute,
_d[api_internal_contract_js_1.FieldAggregationType.TruncMonth] = SharedApiExternalContract_1.FieldAggregationType.TruncMonth,
_d[api_internal_contract_js_1.FieldAggregationType.TruncQtr] = SharedApiExternalContract_1.FieldAggregationType.TruncQtr,
_d[api_internal_contract_js_1.FieldAggregationType.TruncSecond] = SharedApiExternalContract_1.FieldAggregationType.TruncSecond,
_d[api_internal_contract_js_1.FieldAggregationType.TruncWeek] = SharedApiExternalContract_1.FieldAggregationType.TruncWeek,
_d[api_internal_contract_js_1.FieldAggregationType.TruncYear] = SharedApiExternalContract_1.FieldAggregationType.TruncYear,
_d[api_internal_contract_js_1.FieldAggregationType.User] = SharedApiExternalContract_1.FieldAggregationType.User,
_d[api_internal_contract_js_1.FieldAggregationType.Var] = SharedApiExternalContract_1.FieldAggregationType.Var,
_d[api_internal_contract_js_1.FieldAggregationType.Varp] = SharedApiExternalContract_1.FieldAggregationType.Varp,
_d[api_internal_contract_js_1.FieldAggregationType.Week] = SharedApiExternalContract_1.FieldAggregationType.Week,
_d[api_internal_contract_js_1.FieldAggregationType.Weekday] = SharedApiExternalContract_1.FieldAggregationType.Weekday,
_d[api_internal_contract_js_1.FieldAggregationType.Year] = SharedApiExternalContract_1.FieldAggregationType.Year,
_d));
InternalToExternalEnumMappings.fieldRoleType = new EnumConverter_1.EnumConverter((_e = {},
_e[api_internal_contract_js_1.FieldRoleType.Dimension] = SharedApiExternalContract_1.FieldRoleType.Dimension,
_e[api_internal_contract_js_1.FieldRoleType.Measure] = SharedApiExternalContract_1.FieldRoleType.Measure,
_e[api_internal_contract_js_1.FieldRoleType.Unknown] = SharedApiExternalContract_1.FieldRoleType.Unknown,
_e));
InternalToExternalEnumMappings.sheetType = new EnumConverter_1.EnumConverter((_f = {},
_f[api_internal_contract_js_1.SheetType.Dashboard] = SharedApiExternalContract_1.SheetType.Dashboard,
_f[api_internal_contract_js_1.SheetType.Story] = SharedApiExternalContract_1.SheetType.Story,
_f[api_internal_contract_js_1.SheetType.Worksheet] = SharedApiExternalContract_1.SheetType.Worksheet,
_f));
InternalToExternalEnumMappings.dashboardObjectType = new EnumConverter_1.EnumConverter((_g = {},
_g[api_internal_contract_js_1.DashboardObjectType.Extension] = SharedApiExternalContract_1.DashboardObjectType.Extension,
_g[api_internal_contract_js_1.DashboardObjectType.Blank] = SharedApiExternalContract_1.DashboardObjectType.Blank,
_g[api_internal_contract_js_1.DashboardObjectType.Image] = SharedApiExternalContract_1.DashboardObjectType.Image,
_g[api_internal_contract_js_1.DashboardObjectType.Legend] = SharedApiExternalContract_1.DashboardObjectType.Legend,
_g[api_internal_contract_js_1.DashboardObjectType.PageFilter] = SharedApiExternalContract_1.DashboardObjectType.PageFilter,
_g[api_internal_contract_js_1.DashboardObjectType.ParameterControl] = SharedApiExternalContract_1.DashboardObjectType.ParameterControl,
_g[api_internal_contract_js_1.DashboardObjectType.QuickFilter] = SharedApiExternalContract_1.DashboardObjectType.QuickFilter,
_g[api_internal_contract_js_1.DashboardObjectType.Text] = SharedApiExternalContract_1.DashboardObjectType.Text,
_g[api_internal_contract_js_1.DashboardObjectType.Title] = SharedApiExternalContract_1.DashboardObjectType.Title,
_g[api_internal_contract_js_1.DashboardObjectType.WebPage] = SharedApiExternalContract_1.DashboardObjectType.WebPage,
_g[api_internal_contract_js_1.DashboardObjectType.Worksheet] = SharedApiExternalContract_1.DashboardObjectType.Worksheet,
_g));
InternalToExternalEnumMappings.dataType = new EnumConverter_1.EnumConverter((_h = {},
_h[api_internal_contract_js_1.DataType.Bool] = SharedApiExternalContract_1.DataType.Bool,
_h[api_internal_contract_js_1.DataType.Date] = SharedApiExternalContract_1.DataType.Date,
_h[api_internal_contract_js_1.DataType.DateTime] = SharedApiExternalContract_1.DataType.DateTime,
_h[api_internal_contract_js_1.DataType.Float] = SharedApiExternalContract_1.DataType.Float,
_h[api_internal_contract_js_1.DataType.Int] = SharedApiExternalContract_1.DataType.Int,
_h[api_internal_contract_js_1.DataType.String] = SharedApiExternalContract_1.DataType.String,
_h));
InternalToExternalEnumMappings.filterUpdateType = new EnumConverter_1.EnumConverter((_j = {},
_j[api_internal_contract_js_1.FilterUpdateType.Add] = SharedApiExternalContract_1.FilterUpdateType.Add,
_j[api_internal_contract_js_1.FilterUpdateType.All] = SharedApiExternalContract_1.FilterUpdateType.All,
_j[api_internal_contract_js_1.FilterUpdateType.Remove] = SharedApiExternalContract_1.FilterUpdateType.Remove,
_j[api_internal_contract_js_1.FilterUpdateType.Replace] = SharedApiExternalContract_1.FilterUpdateType.Replace,
_j));
InternalToExternalEnumMappings.allowableValues = new EnumConverter_1.EnumConverter((_k = {},
_k[api_internal_contract_js_1.DomainRestrictionType.All] = SharedApiExternalContract_1.ParameterValueType.All,
_k[api_internal_contract_js_1.DomainRestrictionType.List] = SharedApiExternalContract_1.ParameterValueType.List,
_k[api_internal_contract_js_1.DomainRestrictionType.Range] = SharedApiExternalContract_1.ParameterValueType.Range,
_k));
InternalToExternalEnumMappings.dateStepPeriod = new EnumConverter_1.EnumConverter((_l = {},
_l[api_internal_contract_js_1.DateStepPeriod.Years] = SharedApiExternalContract_1.PeriodType.Years,
_l[api_internal_contract_js_1.DateStepPeriod.Quarters] = SharedApiExternalContract_1.PeriodType.Quarters,
_l[api_internal_contract_js_1.DateStepPeriod.Months] = SharedApiExternalContract_1.PeriodType.Months,
_l[api_internal_contract_js_1.DateStepPeriod.Weeks] = SharedApiExternalContract_1.PeriodType.Weeks,
_l[api_internal_contract_js_1.DateStepPeriod.Days] = SharedApiExternalContract_1.PeriodType.Days,
_l[api_internal_contract_js_1.DateStepPeriod.Hours] = SharedApiExternalContract_1.PeriodType.Hours,
_l[api_internal_contract_js_1.DateStepPeriod.Minutes] = SharedApiExternalContract_1.PeriodType.Minutes,
_l[api_internal_contract_js_1.DateStepPeriod.Seconds] = SharedApiExternalContract_1.PeriodType.Seconds,
_l));
InternalToExternalEnumMappings.dateRangeType = new EnumConverter_1.EnumConverter((_m = {},
_m[api_internal_contract_js_1.DateRangeType.Current] = SharedApiExternalContract_1.DateRangeType.Current,
_m[api_internal_contract_js_1.DateRangeType.Last] = SharedApiExternalContract_1.DateRangeType.Last,
_m[api_internal_contract_js_1.DateRangeType.LastN] = SharedApiExternalContract_1.DateRangeType.LastN,
_m[api_internal_contract_js_1.DateRangeType.Next] = SharedApiExternalContract_1.DateRangeType.Next,
_m[api_internal_contract_js_1.DateRangeType.NextN] = SharedApiExternalContract_1.DateRangeType.NextN,
_m[api_internal_contract_js_1.DateRangeType.ToDate] = SharedApiExternalContract_1.DateRangeType.ToDate,
_m));
InternalToExternalEnumMappings.errorCode = new EnumConverter_1.EnumConverter((_o = {},
_o[api_internal_contract_js_1.ErrorCodes.INITIALIZATION_ERROR] = SharedApiExternalContract_1.ErrorCodes.InternalError,
_o[api_internal_contract_js_1.ErrorCodes.INTERNAL_ERROR] = SharedApiExternalContract_1.ErrorCodes.InternalError,
_o[api_internal_contract_js_1.ErrorCodes.MISSING_ENUM_MAPPING] = SharedApiExternalContract_1.ErrorCodes.InternalError,
_o[api_internal_contract_js_1.ErrorCodes.MISSING_PARAMETER] = SharedApiExternalContract_1.ErrorCodes.InternalError,
_o[api_internal_contract_js_1.ErrorCodes.PERMISSION_DENIED] = SharedApiExternalContract_1.ErrorCodes.InternalError,
_o[api_internal_contract_js_1.ErrorCodes.PRES_MODEL_PARSING_ERROR] = SharedApiExternalContract_1.ErrorCodes.InternalError,
_o[api_internal_contract_js_1.ErrorCodes.UNKNOWN_VERB_ID] = SharedApiExternalContract_1.ErrorCodes.InternalError,
_o[api_internal_contract_js_1.ErrorCodes.VERSION_NOT_CONFIGURED] = SharedApiExternalContract_1.ErrorCodes.APINotInitialized,
_o));
InternalToExternalEnumMappings.filterType = new EnumConverter_1.EnumConverter((_p = {},
_p[api_internal_contract_js_1.FilterType.Categorical] = SharedApiExternalContract_1.FilterType.Categorical,
_p[api_internal_contract_js_1.FilterType.Range] = SharedApiExternalContract_1.FilterType.Range,
_p[api_internal_contract_js_1.FilterType.RelativeDate] = SharedApiExternalContract_1.FilterType.RelativeDate,
_p[api_internal_contract_js_1.FilterType.Hierarchical] = SharedApiExternalContract_1.FilterType.Hierarchical,
_p));
return InternalToExternalEnumMappings;
}());
exports.InternalToExternalEnumMappings = InternalToExternalEnumMappings;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
/* tslint:enable:typedef */
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var InternalToExternalEnumMappings_1 = __webpack_require__(7);
var TableauError_1 = __webpack_require__(2);
/**
* Each ServceImpl should extend this base class for the sake of
* proper error handling. This base handles the conversion
* from internal errors to external errors that we throw to developers
*/
var ServiceImplBase = /** @class */ (function () {
function ServiceImplBase(_dispatcher) {
this._dispatcher = _dispatcher;
}
ServiceImplBase.prototype.execute = function (verb, params) {
return this._dispatcher.execute(verb, params).catch(function (error) {
// Any internal error that comes from the dispatcher should be converted
// to an external error using the enum mapper for error codes.
var internalError = error;
var externalErrorCode = InternalToExternalEnumMappings_1.InternalToExternalEnumMappings.errorCode.convert(internalError.errorCode);
throw new TableauError_1.TableauError(externalErrorCode, internalError.message);
});
};
return ServiceImplBase;
}());
exports.ServiceImplBase = ServiceImplBase;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Enum defining the 4 different types of messages we have defined
*/
var MessageType;
(function (MessageType) {
MessageType["Initialize"] = "initialize";
MessageType["Notification"] = "notification";
MessageType["Command"] = "command";
MessageType["CommandResponse"] = "command-response";
})(MessageType = exports.MessageType || (exports.MessageType = {}));
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Contract = __webpack_require__(0);
var TableauError_1 = __webpack_require__(2);
/**
* Class designed to register and unregister handlers from a user. Only those events
* which are added via AddNewEventType will be supported by this instance
*/
var EventListenerManager = /** @class */ (function () {
function EventListenerManager() {
this._eventListenerManagers = {};
}
EventListenerManager.prototype.addEventListener = function (eventType, handler) {
if (!this._eventListenerManagers.hasOwnProperty(eventType)) {
throw new TableauError_1.TableauError(Contract.ErrorCodes.UnsupportedEventName, "Cannot add event, unsupported event type: " + eventType);
}
return this._eventListenerManagers[eventType].addEventListener(handler);
};
EventListenerManager.prototype.removeEventListener = function (eventType, handler) {
if (!this._eventListenerManagers.hasOwnProperty(eventType)) {
throw new TableauError_1.TableauError(Contract.ErrorCodes.UnsupportedEventName, "Cannot remove event, unsupported event type: " + eventType);
}
return this._eventListenerManagers[eventType].removeEventListener(handler);
};
EventListenerManager.prototype.addNewEventType = function (eventManager) {
this._eventListenerManagers[eventManager.eventType] = eventManager;
};
return EventListenerManager;
}());
exports.EventListenerManager = EventListenerManager;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* This class implements the SingleEventManager interface for a single type of Tableau event
*
* @template TEventType The Tableau event type this class specializes
*/
var SingleEventManagerImpl = /** @class */ (function () {
function SingleEventManagerImpl(eventType) {
this._eventType = eventType;
this._handlers = [];
}
Object.defineProperty(SingleEventManagerImpl.prototype, "eventType", {
get: function () {
return this._eventType;
},
enumerable: true,
configurable: true
});
SingleEventManagerImpl.prototype.addEventListener = function (handler) {
var _this = this;
this._handlers.push(handler);
return function () { return _this.removeEventListener(handler); };
};
SingleEventManagerImpl.prototype.removeEventListener = function (handler) {
var beforeCount = this._handlers.length;
this._handlers = this._handlers.filter(function (h) { return h !== handler; });
return beforeCount > this._handlers.length;
};
SingleEventManagerImpl.prototype.triggerEvent = function (eventGenerator) {
for (var _i = 0, _a = this._handlers; _i < _a.length; _i++) {
var handler = _a[_i];
try {
var eventModel = eventGenerator();
handler(eventModel);
}
catch (e) {
// Since this handler could be outside our control, just catch anything it throws and continue on
continue;
}
}
};
return SingleEventManagerImpl;
}());
exports.SingleEventManagerImpl = SingleEventManagerImpl;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var SharedApiExternalContract_1 = __webpack_require__(0);
var TableauError_1 = __webpack_require__(2);
var Param = /** @class */ (function () {
function Param() {
}
/**
* serializes the date into the format that the server expects.
* @param date the date to serialize
*/
Param.serializeDateForPlatform = function (date) {
var year = date.getUTCFullYear();
var month = date.getUTCMonth() + 1;
var day = date.getUTCDate();
var hh = date.getUTCHours();
var mm = date.getUTCMinutes();
var sec = date.getUTCSeconds();
return year + "-" + month + "-" + day + " " + hh + ":" + mm + ":" + sec;
};
Param.serializeBooleanForPlatform = function (bool) {
return bool ? 'true' : 'false';
};
Param.serializeNumberForPlatform = function (num) {
return num.toString(10);
};
/**
* Verifies the input is a number
*/
/* tslint:disable:no-any */
Param.isTypeNumber = function (input) {
return typeof (input) === 'number' || input instanceof Number;
};
/* tslint:enable:no-any */
/**
* Verifies the input is a Date
*/
/* tslint:disable:no-any */
Param.isTypeDate = function (input) {
return input instanceof Date;
};
/* tslint:enable:no-any */
/* tslint:disable-next-line:no-any */
Param.isTypeString = function (input) {
return typeof (input) === 'string' || input instanceof String;
};
/* tslint:disable-next-line:no-any */
Param.isTypeBool = function (input) {
return typeof (input) === 'boolean' || input instanceof Boolean;
};
/* tslint:disable-next-line:no-any */
Param.serializeParamterValue = function (value) {
if (Param.isTypeNumber(value)) {
return Param.serializeNumberForPlatform(value);
}
else if (Param.isTypeDate(value)) {
return Param.serializeDateForPlatform(value);
}
else if (Param.isTypeBool(value)) {
return Param.serializeBooleanForPlatform(value);
}
else if (Param.isTypeString(value)) {
return value;
}
else {
throw new TableauError_1.TableauError(SharedApiExternalContract_1.ErrorCodes.InternalError, "Unexpected invalid value for: " + value);
}
};
return Param;
}());
exports.Param = Param;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var DataTable = /** @class */ (function () {
function DataTable(_data, _columns, _totalRowCount, _isSummaryData, _marksInfo) {
this._data = _data;
this._columns = _columns;
this._totalRowCount = _totalRowCount;
this._isSummaryData = _isSummaryData;
this._marksInfo = _marksInfo;
// TODO: get rid of this in redesign.
this._name = _isSummaryData ? 'Summary Data Table' : 'Underlying Data Table';
}
Object.defineProperty(DataTable.prototype, "name", {
get: function () {
return this._name;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DataTable.prototype, "data", {
get: function () {
return this._data;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DataTable.prototype, "columns", {
get: function () {
return this._columns;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DataTable.prototype, "marksInfo", {
get: function () {
return this._marksInfo;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DataTable.prototype, "totalRowCount", {
get: function () {
return this._totalRowCount;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DataTable.prototype, "isSummaryData", {
get: function () {
return this._isSummaryData;
},
enumerable: true,
configurable: true
});
return DataTable;
}());
exports.DataTable = DataTable;
var MarkInfo = /** @class */ (function () {
function MarkInfo(_type, _color, _tupleId) {
this._type = _type;
this._color = _color;
this._tupleId = _tupleId;
}
Object.defineProperty(MarkInfo.prototype, "type", {
get: function () {
return this._type;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MarkInfo.prototype, "color", {
get: function () {
return this._color;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MarkInfo.prototype, "tupleId", {
get: function () {
return this._tupleId;
},
enumerable: true,
configurable: true
});
return MarkInfo;
}());
exports.MarkInfo = MarkInfo;
var Column = /** @class */ (function () {
function Column(_fieldName, _dataType, // TODO: this shoudl be an enum type
_isReferenced, _index) {
this._fieldName = _fieldName;
this._dataType = _dataType;
this._isReferenced = _isReferenced;
this._index = _index;
}
Object.defineProperty(Column.prototype, "fieldName", {
get: function () {
return this._fieldName;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Column.prototype, "dataType", {
get: function () {
return this._dataType;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Column.prototype, "isReferenced", {
get: function () {
return this._isReferenced;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Column.prototype, "index", {
get: function () {
return this._index;
},
enumerable: true,
configurable: true
});
return Column;
}());
exports.Column = Column;
var DataValue = /** @class */ (function () {
/* tslint:disable:no-any */
function DataValue(_value, _formattedValue) {
this._value = _value;
this._formattedValue = _formattedValue;
}
Object.defineProperty(DataValue.prototype, "value", {
get: function () {
return this._value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(DataValue.prototype, "formattedValue", {
get: function () {
return this._formattedValue;
},
enumerable: true,
configurable: true
});
return DataValue;
}());
exports.DataValue = DataValue;
/***/ }),
/* 14 */
/***/ (function(module, exports) {
(function () {
var validator = new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$", "i");
function gen(count) {
var out = "";
for (var i=0; i<count; i++) {
out += (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
return out;
}
function Guid(guid) {
if (!guid) throw new TypeError("Invalid argument; `value` has no value.");
this.value = Guid.EMPTY;
if (guid && guid instanceof Guid) {
this.value = guid.toString();
} else if (guid && Object.prototype.toString.call(guid) === "[object String]" && Guid.isGuid(guid)) {
this.value = guid;
}
this.equals = function(other) {
// Comparing string `value` against provided `guid` will auto-call
// toString on `guid` for comparison
return Guid.isGuid(other) && this.value == other;
};
this.isEmpty = function() {
return this.value === Guid.EMPTY;
};
this.toString = function() {
return this.value;
};
this.toJSON = function() {
return this.value;
};
};
Guid.EMPTY = "00000000-0000-0000-0000-000000000000";
Guid.isGuid = function(value) {
return value && (value instanceof Guid || validator.test(value.toString()));
};
Guid.create = function() {
return new Guid([gen(2), gen(1), gen(1), gen(1), gen(3)].join("-"));
};
Guid.raw = function() {
return [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
};
if(typeof module != 'undefined' && module.exports) {
module.exports = Guid;
}
else if (typeof window != 'undefined') {
window.Guid = Guid;
}
})();
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {