@microsoft/teams-js 2.0.0-beta.3-dev.31 → 2.0.0-beta.3-dev.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/MicrosoftTeams.js
CHANGED
|
@@ -250,6 +250,732 @@ function v4(options, buf, offset) {
|
|
|
250
250
|
module.exports = v4;
|
|
251
251
|
|
|
252
252
|
|
|
253
|
+
/***/ }),
|
|
254
|
+
|
|
255
|
+
/***/ 227:
|
|
256
|
+
/***/ ((module, exports, __webpack_require__) => {
|
|
257
|
+
|
|
258
|
+
/* eslint-env browser */
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* This is the web browser implementation of `debug()`.
|
|
262
|
+
*/
|
|
263
|
+
|
|
264
|
+
exports.formatArgs = formatArgs;
|
|
265
|
+
exports.save = save;
|
|
266
|
+
exports.load = load;
|
|
267
|
+
exports.useColors = useColors;
|
|
268
|
+
exports.storage = localstorage();
|
|
269
|
+
exports.destroy = (() => {
|
|
270
|
+
let warned = false;
|
|
271
|
+
|
|
272
|
+
return () => {
|
|
273
|
+
if (!warned) {
|
|
274
|
+
warned = true;
|
|
275
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
})();
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Colors.
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
exports.colors = [
|
|
285
|
+
'#0000CC',
|
|
286
|
+
'#0000FF',
|
|
287
|
+
'#0033CC',
|
|
288
|
+
'#0033FF',
|
|
289
|
+
'#0066CC',
|
|
290
|
+
'#0066FF',
|
|
291
|
+
'#0099CC',
|
|
292
|
+
'#0099FF',
|
|
293
|
+
'#00CC00',
|
|
294
|
+
'#00CC33',
|
|
295
|
+
'#00CC66',
|
|
296
|
+
'#00CC99',
|
|
297
|
+
'#00CCCC',
|
|
298
|
+
'#00CCFF',
|
|
299
|
+
'#3300CC',
|
|
300
|
+
'#3300FF',
|
|
301
|
+
'#3333CC',
|
|
302
|
+
'#3333FF',
|
|
303
|
+
'#3366CC',
|
|
304
|
+
'#3366FF',
|
|
305
|
+
'#3399CC',
|
|
306
|
+
'#3399FF',
|
|
307
|
+
'#33CC00',
|
|
308
|
+
'#33CC33',
|
|
309
|
+
'#33CC66',
|
|
310
|
+
'#33CC99',
|
|
311
|
+
'#33CCCC',
|
|
312
|
+
'#33CCFF',
|
|
313
|
+
'#6600CC',
|
|
314
|
+
'#6600FF',
|
|
315
|
+
'#6633CC',
|
|
316
|
+
'#6633FF',
|
|
317
|
+
'#66CC00',
|
|
318
|
+
'#66CC33',
|
|
319
|
+
'#9900CC',
|
|
320
|
+
'#9900FF',
|
|
321
|
+
'#9933CC',
|
|
322
|
+
'#9933FF',
|
|
323
|
+
'#99CC00',
|
|
324
|
+
'#99CC33',
|
|
325
|
+
'#CC0000',
|
|
326
|
+
'#CC0033',
|
|
327
|
+
'#CC0066',
|
|
328
|
+
'#CC0099',
|
|
329
|
+
'#CC00CC',
|
|
330
|
+
'#CC00FF',
|
|
331
|
+
'#CC3300',
|
|
332
|
+
'#CC3333',
|
|
333
|
+
'#CC3366',
|
|
334
|
+
'#CC3399',
|
|
335
|
+
'#CC33CC',
|
|
336
|
+
'#CC33FF',
|
|
337
|
+
'#CC6600',
|
|
338
|
+
'#CC6633',
|
|
339
|
+
'#CC9900',
|
|
340
|
+
'#CC9933',
|
|
341
|
+
'#CCCC00',
|
|
342
|
+
'#CCCC33',
|
|
343
|
+
'#FF0000',
|
|
344
|
+
'#FF0033',
|
|
345
|
+
'#FF0066',
|
|
346
|
+
'#FF0099',
|
|
347
|
+
'#FF00CC',
|
|
348
|
+
'#FF00FF',
|
|
349
|
+
'#FF3300',
|
|
350
|
+
'#FF3333',
|
|
351
|
+
'#FF3366',
|
|
352
|
+
'#FF3399',
|
|
353
|
+
'#FF33CC',
|
|
354
|
+
'#FF33FF',
|
|
355
|
+
'#FF6600',
|
|
356
|
+
'#FF6633',
|
|
357
|
+
'#FF9900',
|
|
358
|
+
'#FF9933',
|
|
359
|
+
'#FFCC00',
|
|
360
|
+
'#FFCC33'
|
|
361
|
+
];
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
365
|
+
* and the Firebug extension (any Firefox version) are known
|
|
366
|
+
* to support "%c" CSS customizations.
|
|
367
|
+
*
|
|
368
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
369
|
+
*/
|
|
370
|
+
|
|
371
|
+
// eslint-disable-next-line complexity
|
|
372
|
+
function useColors() {
|
|
373
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
|
374
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
375
|
+
// explicitly
|
|
376
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
377
|
+
return true;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// Internet Explorer and Edge do not support colors.
|
|
381
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
386
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
387
|
+
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
388
|
+
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
389
|
+
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
390
|
+
// Is firefox >= v31?
|
|
391
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
392
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
393
|
+
// Double check webkit in userAgent just in case we are in a worker
|
|
394
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Colorize log arguments if enabled.
|
|
399
|
+
*
|
|
400
|
+
* @api public
|
|
401
|
+
*/
|
|
402
|
+
|
|
403
|
+
function formatArgs(args) {
|
|
404
|
+
args[0] = (this.useColors ? '%c' : '') +
|
|
405
|
+
this.namespace +
|
|
406
|
+
(this.useColors ? ' %c' : ' ') +
|
|
407
|
+
args[0] +
|
|
408
|
+
(this.useColors ? '%c ' : ' ') +
|
|
409
|
+
'+' + module.exports.humanize(this.diff);
|
|
410
|
+
|
|
411
|
+
if (!this.useColors) {
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
const c = 'color: ' + this.color;
|
|
416
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
417
|
+
|
|
418
|
+
// The final "%c" is somewhat tricky, because there could be other
|
|
419
|
+
// arguments passed either before or after the %c, so we need to
|
|
420
|
+
// figure out the correct index to insert the CSS into
|
|
421
|
+
let index = 0;
|
|
422
|
+
let lastC = 0;
|
|
423
|
+
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
424
|
+
if (match === '%%') {
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
index++;
|
|
428
|
+
if (match === '%c') {
|
|
429
|
+
// We only are interested in the *last* %c
|
|
430
|
+
// (the user may have provided their own)
|
|
431
|
+
lastC = index;
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
args.splice(lastC, 0, c);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Invokes `console.debug()` when available.
|
|
440
|
+
* No-op when `console.debug` is not a "function".
|
|
441
|
+
* If `console.debug` is not available, falls back
|
|
442
|
+
* to `console.log`.
|
|
443
|
+
*
|
|
444
|
+
* @api public
|
|
445
|
+
*/
|
|
446
|
+
exports.log = console.debug || console.log || (() => {});
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Save `namespaces`.
|
|
450
|
+
*
|
|
451
|
+
* @param {String} namespaces
|
|
452
|
+
* @api private
|
|
453
|
+
*/
|
|
454
|
+
function save(namespaces) {
|
|
455
|
+
try {
|
|
456
|
+
if (namespaces) {
|
|
457
|
+
exports.storage.setItem('debug', namespaces);
|
|
458
|
+
} else {
|
|
459
|
+
exports.storage.removeItem('debug');
|
|
460
|
+
}
|
|
461
|
+
} catch (error) {
|
|
462
|
+
// Swallow
|
|
463
|
+
// XXX (@Qix-) should we be logging these?
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Load `namespaces`.
|
|
469
|
+
*
|
|
470
|
+
* @return {String} returns the previously persisted debug modes
|
|
471
|
+
* @api private
|
|
472
|
+
*/
|
|
473
|
+
function load() {
|
|
474
|
+
let r;
|
|
475
|
+
try {
|
|
476
|
+
r = exports.storage.getItem('debug');
|
|
477
|
+
} catch (error) {
|
|
478
|
+
// Swallow
|
|
479
|
+
// XXX (@Qix-) should we be logging these?
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
483
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
484
|
+
r = process.env.DEBUG;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return r;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Localstorage attempts to return the localstorage.
|
|
492
|
+
*
|
|
493
|
+
* This is necessary because safari throws
|
|
494
|
+
* when a user disables cookies/localstorage
|
|
495
|
+
* and you attempt to access it.
|
|
496
|
+
*
|
|
497
|
+
* @return {LocalStorage}
|
|
498
|
+
* @api private
|
|
499
|
+
*/
|
|
500
|
+
|
|
501
|
+
function localstorage() {
|
|
502
|
+
try {
|
|
503
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
504
|
+
// The Browser also has localStorage in the global context.
|
|
505
|
+
return localStorage;
|
|
506
|
+
} catch (error) {
|
|
507
|
+
// Swallow
|
|
508
|
+
// XXX (@Qix-) should we be logging these?
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
module.exports = __webpack_require__(447)(exports);
|
|
513
|
+
|
|
514
|
+
const {formatters} = module.exports;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
518
|
+
*/
|
|
519
|
+
|
|
520
|
+
formatters.j = function (v) {
|
|
521
|
+
try {
|
|
522
|
+
return JSON.stringify(v);
|
|
523
|
+
} catch (error) {
|
|
524
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
/***/ }),
|
|
530
|
+
|
|
531
|
+
/***/ 447:
|
|
532
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* This is the common logic for both the Node.js and web browser
|
|
537
|
+
* implementations of `debug()`.
|
|
538
|
+
*/
|
|
539
|
+
|
|
540
|
+
function setup(env) {
|
|
541
|
+
createDebug.debug = createDebug;
|
|
542
|
+
createDebug.default = createDebug;
|
|
543
|
+
createDebug.coerce = coerce;
|
|
544
|
+
createDebug.disable = disable;
|
|
545
|
+
createDebug.enable = enable;
|
|
546
|
+
createDebug.enabled = enabled;
|
|
547
|
+
createDebug.humanize = __webpack_require__(824);
|
|
548
|
+
createDebug.destroy = destroy;
|
|
549
|
+
|
|
550
|
+
Object.keys(env).forEach(key => {
|
|
551
|
+
createDebug[key] = env[key];
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* The currently active debug mode names, and names to skip.
|
|
556
|
+
*/
|
|
557
|
+
|
|
558
|
+
createDebug.names = [];
|
|
559
|
+
createDebug.skips = [];
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Map of special "%n" handling functions, for the debug "format" argument.
|
|
563
|
+
*
|
|
564
|
+
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|
565
|
+
*/
|
|
566
|
+
createDebug.formatters = {};
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Selects a color for a debug namespace
|
|
570
|
+
* @param {String} namespace The namespace string for the debug instance to be colored
|
|
571
|
+
* @return {Number|String} An ANSI color code for the given namespace
|
|
572
|
+
* @api private
|
|
573
|
+
*/
|
|
574
|
+
function selectColor(namespace) {
|
|
575
|
+
let hash = 0;
|
|
576
|
+
|
|
577
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
578
|
+
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
|
579
|
+
hash |= 0; // Convert to 32bit integer
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
583
|
+
}
|
|
584
|
+
createDebug.selectColor = selectColor;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Create a debugger with the given `namespace`.
|
|
588
|
+
*
|
|
589
|
+
* @param {String} namespace
|
|
590
|
+
* @return {Function}
|
|
591
|
+
* @api public
|
|
592
|
+
*/
|
|
593
|
+
function createDebug(namespace) {
|
|
594
|
+
let prevTime;
|
|
595
|
+
let enableOverride = null;
|
|
596
|
+
let namespacesCache;
|
|
597
|
+
let enabledCache;
|
|
598
|
+
|
|
599
|
+
function debug(...args) {
|
|
600
|
+
// Disabled?
|
|
601
|
+
if (!debug.enabled) {
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
const self = debug;
|
|
606
|
+
|
|
607
|
+
// Set `diff` timestamp
|
|
608
|
+
const curr = Number(new Date());
|
|
609
|
+
const ms = curr - (prevTime || curr);
|
|
610
|
+
self.diff = ms;
|
|
611
|
+
self.prev = prevTime;
|
|
612
|
+
self.curr = curr;
|
|
613
|
+
prevTime = curr;
|
|
614
|
+
|
|
615
|
+
args[0] = createDebug.coerce(args[0]);
|
|
616
|
+
|
|
617
|
+
if (typeof args[0] !== 'string') {
|
|
618
|
+
// Anything else let's inspect with %O
|
|
619
|
+
args.unshift('%O');
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// Apply any `formatters` transformations
|
|
623
|
+
let index = 0;
|
|
624
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
625
|
+
// If we encounter an escaped % then don't increase the array index
|
|
626
|
+
if (match === '%%') {
|
|
627
|
+
return '%';
|
|
628
|
+
}
|
|
629
|
+
index++;
|
|
630
|
+
const formatter = createDebug.formatters[format];
|
|
631
|
+
if (typeof formatter === 'function') {
|
|
632
|
+
const val = args[index];
|
|
633
|
+
match = formatter.call(self, val);
|
|
634
|
+
|
|
635
|
+
// Now we need to remove `args[index]` since it's inlined in the `format`
|
|
636
|
+
args.splice(index, 1);
|
|
637
|
+
index--;
|
|
638
|
+
}
|
|
639
|
+
return match;
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
// Apply env-specific formatting (colors, etc.)
|
|
643
|
+
createDebug.formatArgs.call(self, args);
|
|
644
|
+
|
|
645
|
+
const logFn = self.log || createDebug.log;
|
|
646
|
+
logFn.apply(self, args);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
debug.namespace = namespace;
|
|
650
|
+
debug.useColors = createDebug.useColors();
|
|
651
|
+
debug.color = createDebug.selectColor(namespace);
|
|
652
|
+
debug.extend = extend;
|
|
653
|
+
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
|
654
|
+
|
|
655
|
+
Object.defineProperty(debug, 'enabled', {
|
|
656
|
+
enumerable: true,
|
|
657
|
+
configurable: false,
|
|
658
|
+
get: () => {
|
|
659
|
+
if (enableOverride !== null) {
|
|
660
|
+
return enableOverride;
|
|
661
|
+
}
|
|
662
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
663
|
+
namespacesCache = createDebug.namespaces;
|
|
664
|
+
enabledCache = createDebug.enabled(namespace);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
return enabledCache;
|
|
668
|
+
},
|
|
669
|
+
set: v => {
|
|
670
|
+
enableOverride = v;
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
// Env-specific initialization logic for debug instances
|
|
675
|
+
if (typeof createDebug.init === 'function') {
|
|
676
|
+
createDebug.init(debug);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
return debug;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function extend(namespace, delimiter) {
|
|
683
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
684
|
+
newDebug.log = this.log;
|
|
685
|
+
return newDebug;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Enables a debug mode by namespaces. This can include modes
|
|
690
|
+
* separated by a colon and wildcards.
|
|
691
|
+
*
|
|
692
|
+
* @param {String} namespaces
|
|
693
|
+
* @api public
|
|
694
|
+
*/
|
|
695
|
+
function enable(namespaces) {
|
|
696
|
+
createDebug.save(namespaces);
|
|
697
|
+
createDebug.namespaces = namespaces;
|
|
698
|
+
|
|
699
|
+
createDebug.names = [];
|
|
700
|
+
createDebug.skips = [];
|
|
701
|
+
|
|
702
|
+
let i;
|
|
703
|
+
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
704
|
+
const len = split.length;
|
|
705
|
+
|
|
706
|
+
for (i = 0; i < len; i++) {
|
|
707
|
+
if (!split[i]) {
|
|
708
|
+
// ignore empty strings
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
namespaces = split[i].replace(/\*/g, '.*?');
|
|
713
|
+
|
|
714
|
+
if (namespaces[0] === '-') {
|
|
715
|
+
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
|
716
|
+
} else {
|
|
717
|
+
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Disable debug output.
|
|
724
|
+
*
|
|
725
|
+
* @return {String} namespaces
|
|
726
|
+
* @api public
|
|
727
|
+
*/
|
|
728
|
+
function disable() {
|
|
729
|
+
const namespaces = [
|
|
730
|
+
...createDebug.names.map(toNamespace),
|
|
731
|
+
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
|
732
|
+
].join(',');
|
|
733
|
+
createDebug.enable('');
|
|
734
|
+
return namespaces;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* Returns true if the given mode name is enabled, false otherwise.
|
|
739
|
+
*
|
|
740
|
+
* @param {String} name
|
|
741
|
+
* @return {Boolean}
|
|
742
|
+
* @api public
|
|
743
|
+
*/
|
|
744
|
+
function enabled(name) {
|
|
745
|
+
if (name[name.length - 1] === '*') {
|
|
746
|
+
return true;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
let i;
|
|
750
|
+
let len;
|
|
751
|
+
|
|
752
|
+
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
753
|
+
if (createDebug.skips[i].test(name)) {
|
|
754
|
+
return false;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
759
|
+
if (createDebug.names[i].test(name)) {
|
|
760
|
+
return true;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
return false;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Convert regexp to namespace
|
|
769
|
+
*
|
|
770
|
+
* @param {RegExp} regxep
|
|
771
|
+
* @return {String} namespace
|
|
772
|
+
* @api private
|
|
773
|
+
*/
|
|
774
|
+
function toNamespace(regexp) {
|
|
775
|
+
return regexp.toString()
|
|
776
|
+
.substring(2, regexp.toString().length - 2)
|
|
777
|
+
.replace(/\.\*\?$/, '*');
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Coerce `val`.
|
|
782
|
+
*
|
|
783
|
+
* @param {Mixed} val
|
|
784
|
+
* @return {Mixed}
|
|
785
|
+
* @api private
|
|
786
|
+
*/
|
|
787
|
+
function coerce(val) {
|
|
788
|
+
if (val instanceof Error) {
|
|
789
|
+
return val.stack || val.message;
|
|
790
|
+
}
|
|
791
|
+
return val;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* XXX DO NOT USE. This is a temporary stub function.
|
|
796
|
+
* XXX It WILL be removed in the next major release.
|
|
797
|
+
*/
|
|
798
|
+
function destroy() {
|
|
799
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
createDebug.enable(createDebug.load());
|
|
803
|
+
|
|
804
|
+
return createDebug;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
module.exports = setup;
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
/***/ }),
|
|
811
|
+
|
|
812
|
+
/***/ 824:
|
|
813
|
+
/***/ ((module) => {
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* Helpers.
|
|
817
|
+
*/
|
|
818
|
+
|
|
819
|
+
var s = 1000;
|
|
820
|
+
var m = s * 60;
|
|
821
|
+
var h = m * 60;
|
|
822
|
+
var d = h * 24;
|
|
823
|
+
var w = d * 7;
|
|
824
|
+
var y = d * 365.25;
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Parse or format the given `val`.
|
|
828
|
+
*
|
|
829
|
+
* Options:
|
|
830
|
+
*
|
|
831
|
+
* - `long` verbose formatting [false]
|
|
832
|
+
*
|
|
833
|
+
* @param {String|Number} val
|
|
834
|
+
* @param {Object} [options]
|
|
835
|
+
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
836
|
+
* @return {String|Number}
|
|
837
|
+
* @api public
|
|
838
|
+
*/
|
|
839
|
+
|
|
840
|
+
module.exports = function(val, options) {
|
|
841
|
+
options = options || {};
|
|
842
|
+
var type = typeof val;
|
|
843
|
+
if (type === 'string' && val.length > 0) {
|
|
844
|
+
return parse(val);
|
|
845
|
+
} else if (type === 'number' && isFinite(val)) {
|
|
846
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
847
|
+
}
|
|
848
|
+
throw new Error(
|
|
849
|
+
'val is not a non-empty string or a valid number. val=' +
|
|
850
|
+
JSON.stringify(val)
|
|
851
|
+
);
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Parse the given `str` and return milliseconds.
|
|
856
|
+
*
|
|
857
|
+
* @param {String} str
|
|
858
|
+
* @return {Number}
|
|
859
|
+
* @api private
|
|
860
|
+
*/
|
|
861
|
+
|
|
862
|
+
function parse(str) {
|
|
863
|
+
str = String(str);
|
|
864
|
+
if (str.length > 100) {
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
868
|
+
str
|
|
869
|
+
);
|
|
870
|
+
if (!match) {
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
var n = parseFloat(match[1]);
|
|
874
|
+
var type = (match[2] || 'ms').toLowerCase();
|
|
875
|
+
switch (type) {
|
|
876
|
+
case 'years':
|
|
877
|
+
case 'year':
|
|
878
|
+
case 'yrs':
|
|
879
|
+
case 'yr':
|
|
880
|
+
case 'y':
|
|
881
|
+
return n * y;
|
|
882
|
+
case 'weeks':
|
|
883
|
+
case 'week':
|
|
884
|
+
case 'w':
|
|
885
|
+
return n * w;
|
|
886
|
+
case 'days':
|
|
887
|
+
case 'day':
|
|
888
|
+
case 'd':
|
|
889
|
+
return n * d;
|
|
890
|
+
case 'hours':
|
|
891
|
+
case 'hour':
|
|
892
|
+
case 'hrs':
|
|
893
|
+
case 'hr':
|
|
894
|
+
case 'h':
|
|
895
|
+
return n * h;
|
|
896
|
+
case 'minutes':
|
|
897
|
+
case 'minute':
|
|
898
|
+
case 'mins':
|
|
899
|
+
case 'min':
|
|
900
|
+
case 'm':
|
|
901
|
+
return n * m;
|
|
902
|
+
case 'seconds':
|
|
903
|
+
case 'second':
|
|
904
|
+
case 'secs':
|
|
905
|
+
case 'sec':
|
|
906
|
+
case 's':
|
|
907
|
+
return n * s;
|
|
908
|
+
case 'milliseconds':
|
|
909
|
+
case 'millisecond':
|
|
910
|
+
case 'msecs':
|
|
911
|
+
case 'msec':
|
|
912
|
+
case 'ms':
|
|
913
|
+
return n;
|
|
914
|
+
default:
|
|
915
|
+
return undefined;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Short format for `ms`.
|
|
921
|
+
*
|
|
922
|
+
* @param {Number} ms
|
|
923
|
+
* @return {String}
|
|
924
|
+
* @api private
|
|
925
|
+
*/
|
|
926
|
+
|
|
927
|
+
function fmtShort(ms) {
|
|
928
|
+
var msAbs = Math.abs(ms);
|
|
929
|
+
if (msAbs >= d) {
|
|
930
|
+
return Math.round(ms / d) + 'd';
|
|
931
|
+
}
|
|
932
|
+
if (msAbs >= h) {
|
|
933
|
+
return Math.round(ms / h) + 'h';
|
|
934
|
+
}
|
|
935
|
+
if (msAbs >= m) {
|
|
936
|
+
return Math.round(ms / m) + 'm';
|
|
937
|
+
}
|
|
938
|
+
if (msAbs >= s) {
|
|
939
|
+
return Math.round(ms / s) + 's';
|
|
940
|
+
}
|
|
941
|
+
return ms + 'ms';
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Long format for `ms`.
|
|
946
|
+
*
|
|
947
|
+
* @param {Number} ms
|
|
948
|
+
* @return {String}
|
|
949
|
+
* @api private
|
|
950
|
+
*/
|
|
951
|
+
|
|
952
|
+
function fmtLong(ms) {
|
|
953
|
+
var msAbs = Math.abs(ms);
|
|
954
|
+
if (msAbs >= d) {
|
|
955
|
+
return plural(ms, msAbs, d, 'day');
|
|
956
|
+
}
|
|
957
|
+
if (msAbs >= h) {
|
|
958
|
+
return plural(ms, msAbs, h, 'hour');
|
|
959
|
+
}
|
|
960
|
+
if (msAbs >= m) {
|
|
961
|
+
return plural(ms, msAbs, m, 'minute');
|
|
962
|
+
}
|
|
963
|
+
if (msAbs >= s) {
|
|
964
|
+
return plural(ms, msAbs, s, 'second');
|
|
965
|
+
}
|
|
966
|
+
return ms + ' ms';
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Pluralization helper.
|
|
971
|
+
*/
|
|
972
|
+
|
|
973
|
+
function plural(ms, msAbs, n, name) {
|
|
974
|
+
var isPlural = msAbs >= n * 1.5;
|
|
975
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
|
|
253
979
|
/***/ })
|
|
254
980
|
|
|
255
981
|
/******/ });
|
|
@@ -394,7 +1120,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
394
1120
|
});
|
|
395
1121
|
|
|
396
1122
|
;// CONCATENATED MODULE: ./src/internal/constants.ts
|
|
397
|
-
var version = "2.0.0-beta.3-dev.
|
|
1123
|
+
var version = "2.0.0-beta.3-dev.35";
|
|
398
1124
|
/**
|
|
399
1125
|
* @hidden
|
|
400
1126
|
* The SDK version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
|
|
@@ -2167,6 +2893,17 @@ var pages;
|
|
|
2167
2893
|
setCurrentFrame(frameInfo);
|
|
2168
2894
|
}
|
|
2169
2895
|
pages.initializeWithFrameContext = initializeWithFrameContext;
|
|
2896
|
+
/**
|
|
2897
|
+
* Gets the config for the current instance.
|
|
2898
|
+
* @returns Promise that resolves with the {@link InstanceConfig} object.
|
|
2899
|
+
*/
|
|
2900
|
+
function getConfig() {
|
|
2901
|
+
return new Promise(function (resolve) {
|
|
2902
|
+
ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
|
|
2903
|
+
resolve(sendAndUnwrap('settings.getSettings'));
|
|
2904
|
+
});
|
|
2905
|
+
}
|
|
2906
|
+
pages.getConfig = getConfig;
|
|
2170
2907
|
/**
|
|
2171
2908
|
* Navigates the frame to a new cross-domain URL. The domain of this URL must match at least one of the
|
|
2172
2909
|
* valid domains specified in the validDomains block of the manifest; otherwise, an exception will be
|
|
@@ -2310,27 +3047,16 @@ var pages;
|
|
|
2310
3047
|
sendMessageToParent('settings.setValidityState', [validityState]);
|
|
2311
3048
|
}
|
|
2312
3049
|
config.setValidityState = setValidityState;
|
|
2313
|
-
/**
|
|
2314
|
-
* Gets the config for the current instance.
|
|
2315
|
-
* @returns Promise that resolves with the {@link Config} object.
|
|
2316
|
-
*/
|
|
2317
|
-
function getConfig() {
|
|
2318
|
-
return new Promise(function (resolve) {
|
|
2319
|
-
ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
|
|
2320
|
-
resolve(sendAndUnwrap('settings.getSettings'));
|
|
2321
|
-
});
|
|
2322
|
-
}
|
|
2323
|
-
config.getConfig = getConfig;
|
|
2324
3050
|
/**
|
|
2325
3051
|
* Sets the config for the current instance.
|
|
2326
3052
|
* This is an asynchronous operation; calls to getConfig are not guaranteed to reflect the changed state.
|
|
2327
|
-
* @param
|
|
3053
|
+
* @param instanceConfig The desired config for this instance.
|
|
2328
3054
|
* @returns Promise that resolves when the operation has completed.
|
|
2329
3055
|
*/
|
|
2330
|
-
function setConfig(
|
|
3056
|
+
function setConfig(instanceConfig) {
|
|
2331
3057
|
return new Promise(function (resolve) {
|
|
2332
3058
|
ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
|
|
2333
|
-
resolve(sendAndHandleStatusAndReason('settings.setSettings',
|
|
3059
|
+
resolve(sendAndHandleStatusAndReason('settings.setSettings', instanceConfig));
|
|
2334
3060
|
});
|
|
2335
3061
|
}
|
|
2336
3062
|
config.setConfig = setConfig;
|
|
@@ -2573,9 +3299,22 @@ var pages;
|
|
|
2573
3299
|
})(appButton = pages.appButton || (pages.appButton = {}));
|
|
2574
3300
|
})(pages || (pages = {}));
|
|
2575
3301
|
|
|
3302
|
+
// EXTERNAL MODULE: ./node_modules/debug/src/browser.js
|
|
3303
|
+
var browser = __webpack_require__(227);
|
|
3304
|
+
;// CONCATENATED MODULE: ./src/internal/telemetry.ts
|
|
3305
|
+
|
|
3306
|
+
var topLevelLogger = (0,browser.debug)('teamsJs');
|
|
3307
|
+
/**
|
|
3308
|
+
* @internal
|
|
3309
|
+
*
|
|
3310
|
+
* Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
|
|
3311
|
+
*/
|
|
3312
|
+
function getLogger(namespace) {
|
|
3313
|
+
return topLevelLogger.extend(namespace);
|
|
3314
|
+
}
|
|
3315
|
+
|
|
2576
3316
|
;// CONCATENATED MODULE: ./src/internal/handlers.ts
|
|
2577
3317
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
2578
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2579
3318
|
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
2580
3319
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2581
3320
|
if (ar || !(i in from)) {
|
|
@@ -2587,6 +3326,8 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
|
|
|
2587
3326
|
};
|
|
2588
3327
|
|
|
2589
3328
|
|
|
3329
|
+
|
|
3330
|
+
var handlersLogger = getLogger('handlers');
|
|
2590
3331
|
/** @internal */
|
|
2591
3332
|
var HandlersPrivate = /** @class */ (function () {
|
|
2592
3333
|
function HandlersPrivate() {
|
|
@@ -2602,14 +3343,17 @@ function initializeHandlers() {
|
|
|
2602
3343
|
HandlersPrivate.handlers['beforeUnload'] = handleBeforeUnload;
|
|
2603
3344
|
pages.backStack._initialize();
|
|
2604
3345
|
}
|
|
3346
|
+
var callHandlerLogger = handlersLogger.extend('callHandler');
|
|
2605
3347
|
/** @internal */
|
|
2606
3348
|
function callHandler(name, args) {
|
|
2607
3349
|
var handler = HandlersPrivate.handlers[name];
|
|
2608
3350
|
if (handler) {
|
|
3351
|
+
callHandlerLogger('Invoking the registered handler for message %s with arguments %o', name, args);
|
|
2609
3352
|
var result = handler.apply(this, args);
|
|
2610
3353
|
return [true, result];
|
|
2611
3354
|
}
|
|
2612
3355
|
else {
|
|
3356
|
+
callHandlerLogger('Handler for action message %s not found.', name);
|
|
2613
3357
|
return [false, undefined];
|
|
2614
3358
|
}
|
|
2615
3359
|
}
|
|
@@ -2688,6 +3432,8 @@ var communication_spreadArray = (undefined && undefined.__spreadArray) || functi
|
|
|
2688
3432
|
|
|
2689
3433
|
|
|
2690
3434
|
|
|
3435
|
+
|
|
3436
|
+
var communicationLogger = getLogger('communication');
|
|
2691
3437
|
/**@internal */
|
|
2692
3438
|
var Communication = /** @class */ (function () {
|
|
2693
3439
|
function Communication() {
|
|
@@ -2841,12 +3587,16 @@ function sendMessageToParent(actionName, argsOrCallback, callback) {
|
|
|
2841
3587
|
CommunicationPrivate.callbacks[request.id] = callback;
|
|
2842
3588
|
}
|
|
2843
3589
|
}
|
|
3590
|
+
var sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToParentHelper');
|
|
2844
3591
|
/**@internal */
|
|
2845
3592
|
function sendMessageToParentHelper(actionName, args) {
|
|
3593
|
+
var logger = sendMessageToParentHelperLogger;
|
|
2846
3594
|
var targetWindow = Communication.parentWindow;
|
|
2847
3595
|
var request = createMessageRequest(actionName, args);
|
|
3596
|
+
logger('Message %i information: %o', request.id, { actionName: actionName, args: args });
|
|
2848
3597
|
if (GlobalVars.isFramelessWindow) {
|
|
2849
3598
|
if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {
|
|
3599
|
+
logger('Sending message %i to parent via framelessPostMessage interface', request.id);
|
|
2850
3600
|
Communication.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(request));
|
|
2851
3601
|
}
|
|
2852
3602
|
}
|
|
@@ -2855,9 +3605,11 @@ function sendMessageToParentHelper(actionName, args) {
|
|
|
2855
3605
|
// If the target window isn't closed and we already know its origin, send the message right away; otherwise,
|
|
2856
3606
|
// queue the message and send it after the origin is established
|
|
2857
3607
|
if (targetWindow && targetOrigin) {
|
|
3608
|
+
logger('Sending message %i to parent via postMessage', request.id);
|
|
2858
3609
|
targetWindow.postMessage(request, targetOrigin);
|
|
2859
3610
|
}
|
|
2860
3611
|
else {
|
|
3612
|
+
logger('Adding message %i to parent message queue', request.id);
|
|
2861
3613
|
getTargetMessageQueue(targetWindow).push(request);
|
|
2862
3614
|
}
|
|
2863
3615
|
}
|
|
@@ -2937,30 +3689,41 @@ function updateRelationships(messageSource, messageOrigin) {
|
|
|
2937
3689
|
flushMessageQueue(Communication.parentWindow);
|
|
2938
3690
|
flushMessageQueue(Communication.childWindow);
|
|
2939
3691
|
}
|
|
3692
|
+
var handleParentMessageLogger = communicationLogger.extend('handleParentMessage');
|
|
2940
3693
|
/**@internal */
|
|
2941
3694
|
function handleParentMessage(evt) {
|
|
3695
|
+
var logger = handleParentMessageLogger;
|
|
2942
3696
|
if ('id' in evt.data && typeof evt.data.id === 'number') {
|
|
2943
3697
|
// Call any associated Communication.callbacks
|
|
2944
3698
|
var message = evt.data;
|
|
2945
3699
|
var callback = CommunicationPrivate.callbacks[message.id];
|
|
3700
|
+
logger('Received a response from parent for message %i', message.id);
|
|
2946
3701
|
if (callback) {
|
|
3702
|
+
logger('Invoking the registered callback for message %i with arguments %o', message.id, message.args);
|
|
2947
3703
|
callback.apply(null, communication_spreadArray(communication_spreadArray([], message.args, true), [message.isPartialResponse], false));
|
|
2948
3704
|
// Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response
|
|
2949
3705
|
if (!isPartialResponse(evt)) {
|
|
3706
|
+
logger('Removing registered callback for message %i', message.id);
|
|
2950
3707
|
delete CommunicationPrivate.callbacks[message.id];
|
|
2951
3708
|
}
|
|
2952
3709
|
}
|
|
2953
3710
|
var promiseCallback = CommunicationPrivate.promiseCallbacks[message.id];
|
|
2954
3711
|
if (promiseCallback) {
|
|
3712
|
+
logger('Invoking the registered promise callback for message %i with arguments %o', message.id, message.args);
|
|
2955
3713
|
promiseCallback(message.args);
|
|
3714
|
+
logger('Removing registered promise callback for message %i', message.id);
|
|
2956
3715
|
delete CommunicationPrivate.promiseCallbacks[message.id];
|
|
2957
3716
|
}
|
|
2958
3717
|
}
|
|
2959
3718
|
else if ('func' in evt.data && typeof evt.data.func === 'string') {
|
|
2960
3719
|
// Delegate the request to the proper handler
|
|
2961
3720
|
var message = evt.data;
|
|
3721
|
+
logger('Received an action message %s from parent', message.func);
|
|
2962
3722
|
callHandler(message.func, message.args);
|
|
2963
3723
|
}
|
|
3724
|
+
else {
|
|
3725
|
+
logger('Received an unknown message: %O', evt);
|
|
3726
|
+
}
|
|
2964
3727
|
}
|
|
2965
3728
|
/**@internal */
|
|
2966
3729
|
function isPartialResponse(evt) {
|
|
@@ -3007,12 +3770,16 @@ function getTargetOrigin(targetWindow) {
|
|
|
3007
3770
|
? Communication.childOrigin
|
|
3008
3771
|
: null;
|
|
3009
3772
|
}
|
|
3773
|
+
var flushMessageQueueLogger = communicationLogger.extend('flushMessageQueue');
|
|
3010
3774
|
/**@internal */
|
|
3011
3775
|
function flushMessageQueue(targetWindow) {
|
|
3012
3776
|
var targetOrigin = getTargetOrigin(targetWindow);
|
|
3013
3777
|
var targetMessageQueue = getTargetMessageQueue(targetWindow);
|
|
3778
|
+
var target = targetWindow == Communication.parentWindow ? 'parent' : 'child';
|
|
3014
3779
|
while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {
|
|
3015
|
-
|
|
3780
|
+
var request = targetMessageQueue.shift();
|
|
3781
|
+
flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request.id);
|
|
3782
|
+
targetWindow.postMessage(request, targetOrigin);
|
|
3016
3783
|
}
|
|
3017
3784
|
}
|
|
3018
3785
|
/**@internal */
|
|
@@ -5241,7 +6008,7 @@ var settings;
|
|
|
5241
6008
|
*/
|
|
5242
6009
|
function getSettings(callback) {
|
|
5243
6010
|
ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
|
|
5244
|
-
pages.
|
|
6011
|
+
pages.getConfig().then(function (config) {
|
|
5245
6012
|
callback(config);
|
|
5246
6013
|
});
|
|
5247
6014
|
}
|