@interopio/fdc3 2.7.1-beta.0 → 2.7.2

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.
@@ -232,10 +232,10 @@
232
232
  var type = TypeError;
233
233
 
234
234
  /** @type {import('./gOPD')} */
235
- var gOPD$6 = Object.getOwnPropertyDescriptor;
235
+ var gOPD$5 = Object.getOwnPropertyDescriptor;
236
236
 
237
237
  /** @type {import('.')} */
238
- var $gOPD$2 = gOPD$6;
238
+ var $gOPD$2 = gOPD$5;
239
239
 
240
240
  if ($gOPD$2) {
241
241
  try {
@@ -325,7 +325,7 @@
325
325
  var hasPropertyDescriptors_1 = hasPropertyDescriptors;
326
326
 
327
327
  var keys = objectKeys$2;
328
- var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
328
+ var hasSymbols$4 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
329
329
 
330
330
  var toStr$4 = Object.prototype.toString;
331
331
  var concat = Array.prototype.concat;
@@ -358,7 +358,7 @@
358
358
  var defineProperties$1 = function (object, map) {
359
359
  var predicates = arguments.length > 2 ? arguments[2] : {};
360
360
  var props = keys(map);
361
- if (hasSymbols$5) {
361
+ if (hasSymbols$4) {
362
362
  props = concat.call(props, Object.getOwnPropertySymbols(map));
363
363
  }
364
364
  for (var i = 0; i < props.length; i += 1) {
@@ -370,7 +370,7 @@
370
370
 
371
371
  var defineProperties_1 = defineProperties$1;
372
372
 
373
- var callBind$7 = {exports: {}};
373
+ var callBind$6 = {exports: {}};
374
374
 
375
375
  /** @type {import('.')} */
376
376
  var esObjectAtoms = Object;
@@ -424,11 +424,11 @@
424
424
  };
425
425
 
426
426
  var shams$1;
427
- var hasRequiredShams;
427
+ var hasRequiredShams$1;
428
428
 
429
- function requireShams () {
430
- if (hasRequiredShams) return shams$1;
431
- hasRequiredShams = 1;
429
+ function requireShams$1 () {
430
+ if (hasRequiredShams$1) return shams$1;
431
+ hasRequiredShams$1 = 1;
432
432
 
433
433
  /** @type {import('./shams')} */
434
434
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
@@ -477,10 +477,10 @@
477
477
  }
478
478
 
479
479
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
480
- var hasSymbolSham = requireShams();
480
+ var hasSymbolSham = requireShams$1();
481
481
 
482
482
  /** @type {import('.')} */
483
- var hasSymbols$4 = function hasNativeSymbols() {
483
+ var hasSymbols$3 = function hasNativeSymbols() {
484
484
  if (typeof origSymbol !== 'function') { return false; }
485
485
  if (typeof Symbol !== 'function') { return false; }
486
486
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -647,16 +647,16 @@
647
647
  /** @type {import('./reflectApply')} */
648
648
  var reflectApply$1 = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
649
649
 
650
- var bind$4 = requireFunctionBind();
650
+ var bind$3 = requireFunctionBind();
651
651
 
652
652
  var $apply$2 = requireFunctionApply();
653
653
  var $call$2 = requireFunctionCall();
654
654
  var $reflectApply = reflectApply$1;
655
655
 
656
656
  /** @type {import('./actualApply')} */
657
- var actualApply$1 = $reflectApply || bind$4.call($call$2, $apply$2);
657
+ var actualApply$1 = $reflectApply || bind$3.call($call$2, $apply$2);
658
658
 
659
- var bind$3 = requireFunctionBind();
659
+ var bind$2 = requireFunctionBind();
660
660
  var $TypeError$a = type;
661
661
 
662
662
  var $call$1 = requireFunctionCall();
@@ -667,70 +667,97 @@
667
667
  if (args.length < 1 || typeof args[0] !== 'function') {
668
668
  throw new $TypeError$a('a function is required');
669
669
  }
670
- return $actualApply(bind$3, $call$1, args);
670
+ return $actualApply(bind$2, $call$1, args);
671
671
  };
672
672
 
673
- var callBind$6 = callBindApplyHelpers;
674
- var gOPD$5 = gopd$1;
673
+ var get;
674
+ var hasRequiredGet;
675
+
676
+ function requireGet () {
677
+ if (hasRequiredGet) return get;
678
+ hasRequiredGet = 1;
675
679
 
676
- var hasProtoAccessor;
677
- try {
678
- // eslint-disable-next-line no-extra-parens, no-proto
679
- hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
680
- } catch (e) {
681
- if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
682
- throw e;
680
+ var callBind = callBindApplyHelpers;
681
+ var gOPD = gopd$1;
682
+
683
+ var hasProtoAccessor;
684
+ try {
685
+ // eslint-disable-next-line no-extra-parens, no-proto
686
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
687
+ } catch (e) {
688
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
689
+ throw e;
690
+ }
683
691
  }
684
- }
685
692
 
686
- // eslint-disable-next-line no-extra-parens
687
- var desc = !!hasProtoAccessor && gOPD$5 && gOPD$5(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
693
+ // eslint-disable-next-line no-extra-parens
694
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
688
695
 
689
- var $Object$3 = Object;
690
- var $getPrototypeOf = $Object$3.getPrototypeOf;
696
+ var $Object = Object;
697
+ var $getPrototypeOf = $Object.getPrototypeOf;
691
698
 
692
- /** @type {import('./get')} */
693
- var get = desc && typeof desc.get === 'function'
694
- ? callBind$6([desc.get])
695
- : typeof $getPrototypeOf === 'function'
696
- ? /** @type {import('./get')} */ function getDunder(value) {
697
- // eslint-disable-next-line eqeqeq
698
- return $getPrototypeOf(value == null ? value : $Object$3(value));
699
- }
700
- : false;
699
+ /** @type {import('./get')} */
700
+ get = desc && typeof desc.get === 'function'
701
+ ? callBind([desc.get])
702
+ : typeof $getPrototypeOf === 'function'
703
+ ? /** @type {import('./get')} */ function getDunder(value) {
704
+ // eslint-disable-next-line eqeqeq
705
+ return $getPrototypeOf(value == null ? value : $Object(value));
706
+ }
707
+ : false;
708
+ return get;
709
+ }
701
710
 
702
- var reflectGetProto = requireReflect_getPrototypeOf();
703
- var originalGetProto = requireObject_getPrototypeOf();
711
+ var getProto$3;
712
+ var hasRequiredGetProto;
704
713
 
705
- var getDunderProto = get;
714
+ function requireGetProto () {
715
+ if (hasRequiredGetProto) return getProto$3;
716
+ hasRequiredGetProto = 1;
706
717
 
707
- /** @type {import('.')} */
708
- var getProto$3 = reflectGetProto
709
- ? function getProto(O) {
710
- // @ts-expect-error TS can't narrow inside a closure, for some reason
711
- return reflectGetProto(O);
712
- }
713
- : originalGetProto
718
+ var reflectGetProto = requireReflect_getPrototypeOf();
719
+ var originalGetProto = requireObject_getPrototypeOf();
720
+
721
+ var getDunderProto = requireGet();
722
+
723
+ /** @type {import('.')} */
724
+ getProto$3 = reflectGetProto
714
725
  ? function getProto(O) {
715
- if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
716
- throw new TypeError('getProto: not an object');
717
- }
718
726
  // @ts-expect-error TS can't narrow inside a closure, for some reason
719
- return originalGetProto(O);
727
+ return reflectGetProto(O);
720
728
  }
721
- : getDunderProto
729
+ : originalGetProto
722
730
  ? function getProto(O) {
731
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
732
+ throw new TypeError('getProto: not an object');
733
+ }
723
734
  // @ts-expect-error TS can't narrow inside a closure, for some reason
724
- return getDunderProto(O);
735
+ return originalGetProto(O);
725
736
  }
726
- : null;
737
+ : getDunderProto
738
+ ? function getProto(O) {
739
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
740
+ return getDunderProto(O);
741
+ }
742
+ : null;
743
+ return getProto$3;
744
+ }
727
745
 
728
- var call = Function.prototype.call;
729
- var $hasOwn = Object.prototype.hasOwnProperty;
730
- var bind$2 = requireFunctionBind();
746
+ var hasown;
747
+ var hasRequiredHasown;
731
748
 
732
- /** @type {import('.')} */
733
- var hasown = bind$2.call(call, $hasOwn);
749
+ function requireHasown () {
750
+ if (hasRequiredHasown) return hasown;
751
+ hasRequiredHasown = 1;
752
+
753
+ var call = Function.prototype.call;
754
+ var $hasOwn = Object.prototype.hasOwnProperty;
755
+ var bind = requireFunctionBind();
756
+
757
+ /** @type {import('.')} */
758
+ hasown = bind.call(call, $hasOwn);
759
+ return hasown;
760
+ }
734
761
 
735
762
  var undefined$1;
736
763
 
@@ -784,9 +811,9 @@
784
811
  }())
785
812
  : throwTypeError;
786
813
 
787
- var hasSymbols$3 = hasSymbols$4();
814
+ var hasSymbols$2 = hasSymbols$3();
788
815
 
789
- var getProto$2 = getProto$3;
816
+ var getProto$2 = requireGetProto();
790
817
  var $ObjectGPO = requireObject_getPrototypeOf();
791
818
  var $ReflectGPO = requireReflect_getPrototypeOf();
792
819
 
@@ -802,7 +829,7 @@
802
829
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
803
830
  '%Array%': Array,
804
831
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
805
- '%ArrayIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
832
+ '%ArrayIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
806
833
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
807
834
  '%AsyncFunction%': needsEval,
808
835
  '%AsyncGenerator%': needsEval,
@@ -833,10 +860,10 @@
833
860
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
834
861
  '%isFinite%': isFinite,
835
862
  '%isNaN%': isNaN,
836
- '%IteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
863
+ '%IteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
837
864
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
838
865
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
839
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
866
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
840
867
  '%Math%': Math,
841
868
  '%Number%': Number,
842
869
  '%Object%': $Object$2,
@@ -850,11 +877,11 @@
850
877
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
851
878
  '%RegExp%': RegExp,
852
879
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
853
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
880
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
854
881
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
855
882
  '%String%': String,
856
- '%StringIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
857
- '%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
883
+ '%StringIteratorPrototype%': hasSymbols$2 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
884
+ '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
858
885
  '%SyntaxError%': $SyntaxError$1,
859
886
  '%ThrowTypeError%': ThrowTypeError,
860
887
  '%TypedArray%': TypedArray,
@@ -973,7 +1000,7 @@
973
1000
  };
974
1001
 
975
1002
  var bind$1 = requireFunctionBind();
976
- var hasOwn$3 = hasown;
1003
+ var hasOwn$3 = requireHasown();
977
1004
  var $concat$1 = bind$1.call($call, Array.prototype.concat);
978
1005
  var $spliceApply = bind$1.call($apply$1, Array.prototype.splice);
979
1006
  var $replace$1 = bind$1.call($call, String.prototype.replace);
@@ -1183,9 +1210,9 @@
1183
1210
  } else {
1184
1211
  module.exports.apply = applyBind$1;
1185
1212
  }
1186
- } (callBind$7));
1213
+ } (callBind$6));
1187
1214
 
1188
- var callBindExports = callBind$7.exports;
1215
+ var callBindExports = callBind$6.exports;
1189
1216
 
1190
1217
  var GetIntrinsic$7 = getIntrinsic;
1191
1218
 
@@ -1195,7 +1222,7 @@
1195
1222
  var $indexOf$2 = callBindBasic([GetIntrinsic$7('%String.prototype.indexOf%')]);
1196
1223
 
1197
1224
  /** @type {import('.')} */
1198
- var callBound$i = function callBoundIntrinsic(name, allowMissing) {
1225
+ var callBound$h = function callBoundIntrinsic(name, allowMissing) {
1199
1226
  /* eslint no-extra-parens: 0 */
1200
1227
 
1201
1228
  var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic$7(name, !!allowMissing));
@@ -1207,12 +1234,12 @@
1207
1234
 
1208
1235
  // modified from https://github.com/es-shims/es6-shim
1209
1236
  var objectKeys$1 = objectKeys$2;
1210
- var hasSymbols$2 = requireShams()();
1211
- var callBound$h = callBound$i;
1237
+ var hasSymbols$1 = requireShams$1()();
1238
+ var callBound$g = callBound$h;
1212
1239
  var $Object$1 = esObjectAtoms;
1213
- var $push = callBound$h('Array.prototype.push');
1214
- var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
1215
- var originalGetSymbols = hasSymbols$2 ? $Object$1.getOwnPropertySymbols : null;
1240
+ var $push = callBound$g('Array.prototype.push');
1241
+ var $propIsEnumerable = callBound$g('Object.prototype.propertyIsEnumerable');
1242
+ var originalGetSymbols = hasSymbols$1 ? $Object$1.getOwnPropertySymbols : null;
1216
1243
 
1217
1244
  // eslint-disable-next-line no-unused-vars
1218
1245
  var implementation$8 = function assign(target, source1) {
@@ -1226,7 +1253,7 @@
1226
1253
 
1227
1254
  // step 3.a.ii:
1228
1255
  var keys = objectKeys$1(from);
1229
- var getSymbols = hasSymbols$2 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
1256
+ var getSymbols = hasSymbols$1 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
1230
1257
  if (getSymbols) {
1231
1258
  var syms = getSymbols(from);
1232
1259
  for (var j = 0; j < syms.length; ++j) {
@@ -1344,7 +1371,7 @@
1344
1371
 
1345
1372
  var $indexOf$1 = callBind$4(GetIntrinsic$6('String.prototype.indexOf'));
1346
1373
 
1347
- var callBound$g = function callBoundIntrinsic(name, allowMissing) {
1374
+ var callBound$f = function callBoundIntrinsic(name, allowMissing) {
1348
1375
  var intrinsic = GetIntrinsic$6(name, !!allowMissing);
1349
1376
  if (typeof intrinsic === 'function' && $indexOf$1(name, '.prototype.') > -1) {
1350
1377
  return callBind$4(intrinsic);
@@ -1484,7 +1511,7 @@
1484
1511
  var gOPD$2 = gopd$1;
1485
1512
  var defineProperty = Object.defineProperty;
1486
1513
  var $TypeError$5 = esErrors;
1487
- var getProto$1 = getProto$3;
1514
+ var getProto$1 = requireGetProto();
1488
1515
  var regex = /a/;
1489
1516
 
1490
1517
  var shim$3 = function shimFlags() {
@@ -1523,29 +1550,38 @@
1523
1550
 
1524
1551
  var esGetIterator = {exports: {}};
1525
1552
 
1526
- var hasSymbols$1 = requireShams();
1553
+ var shams;
1554
+ var hasRequiredShams;
1527
1555
 
1528
- /** @type {import('.')} */
1529
- var shams = function hasToStringTagShams() {
1530
- return hasSymbols$1() && !!Symbol.toStringTag;
1531
- };
1556
+ function requireShams () {
1557
+ if (hasRequiredShams) return shams;
1558
+ hasRequiredShams = 1;
1559
+
1560
+ var hasSymbols = requireShams$1();
1561
+
1562
+ /** @type {import('.')} */
1563
+ shams = function hasToStringTagShams() {
1564
+ return hasSymbols() && !!Symbol.toStringTag;
1565
+ };
1566
+ return shams;
1567
+ }
1532
1568
 
1533
- var hasToStringTag$7 = shams();
1534
- var callBound$f = callBound$i;
1569
+ var hasToStringTag$6 = requireShams()();
1570
+ var callBound$e = callBound$h;
1535
1571
 
1536
- var $toString$7 = callBound$f('Object.prototype.toString');
1572
+ var $toString$6 = callBound$e('Object.prototype.toString');
1537
1573
 
1538
1574
  /** @type {import('.')} */
1539
1575
  var isStandardArguments = function isArguments(value) {
1540
1576
  if (
1541
- hasToStringTag$7
1577
+ hasToStringTag$6
1542
1578
  && value
1543
1579
  && typeof value === 'object'
1544
1580
  && Symbol.toStringTag in value
1545
1581
  ) {
1546
1582
  return false;
1547
1583
  }
1548
- return $toString$7(value) === '[object Arguments]';
1584
+ return $toString$6(value) === '[object Arguments]';
1549
1585
  };
1550
1586
 
1551
1587
  /** @type {import('.')} */
@@ -1558,9 +1594,9 @@
1558
1594
  && 'length' in value
1559
1595
  && typeof value.length === 'number'
1560
1596
  && value.length >= 0
1561
- && $toString$7(value) !== '[object Array]'
1597
+ && $toString$6(value) !== '[object Array]'
1562
1598
  && 'callee' in value
1563
- && $toString$7(value.callee) === '[object Function]';
1599
+ && $toString$6(value.callee) === '[object Function]';
1564
1600
  };
1565
1601
 
1566
1602
  var supportsStandardArguments = (function () {
@@ -2240,22 +2276,22 @@
2240
2276
  };
2241
2277
 
2242
2278
  var GetIntrinsic$5 = getIntrinsic;
2243
- var callBound$e = callBound$i;
2279
+ var callBound$d = callBound$h;
2244
2280
  var inspect$2 = objectInspect;
2245
2281
 
2246
2282
  var $TypeError$3 = type;
2247
2283
  var $Map$3 = GetIntrinsic$5('%Map%', true);
2248
2284
 
2249
2285
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
2250
- var $mapGet$1 = callBound$e('Map.prototype.get', true);
2286
+ var $mapGet$1 = callBound$d('Map.prototype.get', true);
2251
2287
  /** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
2252
- var $mapSet = callBound$e('Map.prototype.set', true);
2288
+ var $mapSet = callBound$d('Map.prototype.set', true);
2253
2289
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2254
- var $mapHas$5 = callBound$e('Map.prototype.has', true);
2290
+ var $mapHas$5 = callBound$d('Map.prototype.has', true);
2255
2291
  /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
2256
- var $mapDelete = callBound$e('Map.prototype.delete', true);
2292
+ var $mapDelete = callBound$d('Map.prototype.delete', true);
2257
2293
  /** @type {<K, V>(thisArg: Map<K, V>) => number} */
2258
- var $mapSize$1 = callBound$e('Map.prototype.size', true);
2294
+ var $mapSize$1 = callBound$d('Map.prototype.size', true);
2259
2295
 
2260
2296
  /** @type {import('.')} */
2261
2297
  var sideChannelMap = !!$Map$3 && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
@@ -2307,7 +2343,7 @@
2307
2343
  };
2308
2344
 
2309
2345
  var GetIntrinsic$4 = getIntrinsic;
2310
- var callBound$d = callBound$i;
2346
+ var callBound$c = callBound$h;
2311
2347
  var inspect$1 = objectInspect;
2312
2348
  var getSideChannelMap$1 = sideChannelMap;
2313
2349
 
@@ -2315,13 +2351,13 @@
2315
2351
  var $WeakMap$1 = GetIntrinsic$4('%WeakMap%', true);
2316
2352
 
2317
2353
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
2318
- var $weakMapGet = callBound$d('WeakMap.prototype.get', true);
2354
+ var $weakMapGet = callBound$c('WeakMap.prototype.get', true);
2319
2355
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
2320
- var $weakMapSet = callBound$d('WeakMap.prototype.set', true);
2356
+ var $weakMapSet = callBound$c('WeakMap.prototype.set', true);
2321
2357
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2322
- var $weakMapHas = callBound$d('WeakMap.prototype.has', true);
2358
+ var $weakMapHas = callBound$c('WeakMap.prototype.has', true);
2323
2359
  /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
2324
- var $weakMapDelete = callBound$d('WeakMap.prototype.delete', true);
2360
+ var $weakMapDelete = callBound$c('WeakMap.prototype.delete', true);
2325
2361
 
2326
2362
  /** @type {import('.')} */
2327
2363
  var sideChannelWeakmap = $WeakMap$1
@@ -2434,7 +2470,7 @@
2434
2470
  /** @typedef {`$${import('.').InternalSlot}`} SaltedInternalSlot */
2435
2471
  /** @typedef {{ [k in SaltedInternalSlot]?: unknown }} SlotsObject */
2436
2472
 
2437
- var hasOwn$1 = hasown;
2473
+ var hasOwn$1 = requireHasown();
2438
2474
  /** @type {import('side-channel').Channel<object, SlotsObject>} */
2439
2475
  var channel = sideChannel();
2440
2476
 
@@ -2550,35 +2586,44 @@
2550
2586
  return toString.call(arr) == '[object Array]';
2551
2587
  };
2552
2588
 
2553
- var callBound$c = callBound$i;
2589
+ var isString$2;
2590
+ var hasRequiredIsString;
2554
2591
 
2555
- /** @type {(receiver: ThisParameterType<typeof String.prototype.valueOf>, ...args: Parameters<typeof String.prototype.valueOf>) => ReturnType<typeof String.prototype.valueOf>} */
2556
- var $strValueOf = callBound$c('String.prototype.valueOf');
2592
+ function requireIsString () {
2593
+ if (hasRequiredIsString) return isString$2;
2594
+ hasRequiredIsString = 1;
2557
2595
 
2558
- /** @type {import('.')} */
2559
- var tryStringObject = function tryStringObject(value) {
2560
- try {
2561
- $strValueOf(value);
2562
- return true;
2563
- } catch (e) {
2564
- return false;
2565
- }
2566
- };
2567
- /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
2568
- var $toString$6 = callBound$c('Object.prototype.toString');
2569
- var strClass = '[object String]';
2570
- var hasToStringTag$6 = shams();
2596
+ var callBound = callBound$h;
2571
2597
 
2572
- /** @type {import('.')} */
2573
- var isString$2 = function isString(value) {
2574
- if (typeof value === 'string') {
2575
- return true;
2576
- }
2577
- if (!value || typeof value !== 'object') {
2578
- return false;
2579
- }
2580
- return hasToStringTag$6 ? tryStringObject(value) : $toString$6(value) === strClass;
2581
- };
2598
+ /** @type {(receiver: ThisParameterType<typeof String.prototype.valueOf>, ...args: Parameters<typeof String.prototype.valueOf>) => ReturnType<typeof String.prototype.valueOf>} */
2599
+ var $strValueOf = callBound('String.prototype.valueOf');
2600
+
2601
+ /** @type {import('.')} */
2602
+ var tryStringObject = function tryStringObject(value) {
2603
+ try {
2604
+ $strValueOf(value);
2605
+ return true;
2606
+ } catch (e) {
2607
+ return false;
2608
+ }
2609
+ };
2610
+ /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
2611
+ var $toString = callBound('Object.prototype.toString');
2612
+ var strClass = '[object String]';
2613
+ var hasToStringTag = requireShams()();
2614
+
2615
+ /** @type {import('.')} */
2616
+ isString$2 = function isString(value) {
2617
+ if (typeof value === 'string') {
2618
+ return true;
2619
+ }
2620
+ if (!value || typeof value !== 'object') {
2621
+ return false;
2622
+ }
2623
+ return hasToStringTag ? tryStringObject(value) : $toString(value) === strClass;
2624
+ };
2625
+ return isString$2;
2626
+ }
2582
2627
 
2583
2628
  /** @const */
2584
2629
  var $Map$2 = typeof Map === 'function' && Map.prototype ? Map : null;
@@ -2683,7 +2728,7 @@
2683
2728
  var isArguments$1 = isArguments$2;
2684
2729
  var getStopIterationIterator = stopIterationIterator;
2685
2730
 
2686
- if (hasSymbols$4() || requireShams()()) {
2731
+ if (hasSymbols$3() || requireShams$1()()) {
2687
2732
  var $iterator = Symbol.iterator;
2688
2733
  // Symbol is available natively or shammed
2689
2734
  // natively:
@@ -2706,11 +2751,11 @@
2706
2751
  } else {
2707
2752
  // Symbol is not available, native or shammed
2708
2753
  var isArray$2 = isarray;
2709
- var isString$1 = isString$2;
2754
+ var isString$1 = requireIsString();
2710
2755
  var GetIntrinsic$3 = getIntrinsic;
2711
2756
  var $Map = GetIntrinsic$3('%Map%', true);
2712
2757
  var $Set$1 = GetIntrinsic$3('%Set%', true);
2713
- var callBound$b = callBound$g;
2758
+ var callBound$b = callBound$f;
2714
2759
  var $arrayPush = callBound$b('Array.prototype.push');
2715
2760
  var $charCodeAt = callBound$b('String.prototype.charCodeAt');
2716
2761
  var $stringSlice = callBound$b('String.prototype.slice');
@@ -2915,7 +2960,7 @@
2915
2960
  var objectIs = polyfill;
2916
2961
 
2917
2962
  var callBind$1 = callBindExports;
2918
- var callBound$a = callBound$i;
2963
+ var callBound$a = callBound$h;
2919
2964
  var GetIntrinsic$2 = getIntrinsic;
2920
2965
 
2921
2966
  var $ArrayBuffer = GetIntrinsic$2('%ArrayBuffer%', true);
@@ -2956,7 +3001,7 @@
2956
3001
  return false;
2957
3002
  };
2958
3003
 
2959
- var callBound$9 = callBound$i;
3004
+ var callBound$9 = callBound$h;
2960
3005
 
2961
3006
  var getDay = callBound$9('Date.prototype.getDay');
2962
3007
  /** @type {import('.')} */
@@ -2972,7 +3017,7 @@
2972
3017
  /** @type {(value: unknown) => string} */
2973
3018
  var toStr$2 = callBound$9('Object.prototype.toString');
2974
3019
  var dateClass = '[object Date]';
2975
- var hasToStringTag$5 = shams();
3020
+ var hasToStringTag$5 = requireShams()();
2976
3021
 
2977
3022
  /** @type {import('.')} */
2978
3023
  var isDateObject = function isDateObject(value) {
@@ -2982,9 +3027,9 @@
2982
3027
  return hasToStringTag$5 ? tryDateObject(value) : toStr$2(value) === dateClass;
2983
3028
  };
2984
3029
 
2985
- var callBound$8 = callBound$i;
2986
- var hasToStringTag$4 = shams();
2987
- var hasOwn = hasown;
3030
+ var callBound$8 = callBound$h;
3031
+ var hasToStringTag$4 = requireShams()();
3032
+ var hasOwn = requireHasown();
2988
3033
  var gOPD$1 = gopd$1;
2989
3034
 
2990
3035
  /** @type {import('.')} */
@@ -3050,7 +3095,7 @@
3050
3095
 
3051
3096
  var isRegex$1 = fn;
3052
3097
 
3053
- var callBound$7 = callBound$i;
3098
+ var callBound$7 = callBound$h;
3054
3099
 
3055
3100
  /** @type {undefined | ((thisArg: SharedArrayBuffer) => number)} */
3056
3101
  var $byteLength$1 = callBound$7('SharedArrayBuffer.prototype.byteLength', true);
@@ -3073,7 +3118,7 @@
3073
3118
  return false;
3074
3119
  };
3075
3120
 
3076
- var callBound$6 = callBound$i;
3121
+ var callBound$6 = callBound$h;
3077
3122
 
3078
3123
  var $numToStr = callBound$6('Number.prototype.toString');
3079
3124
 
@@ -3088,7 +3133,7 @@
3088
3133
  };
3089
3134
  var $toString$3 = callBound$6('Object.prototype.toString');
3090
3135
  var numClass = '[object Number]';
3091
- var hasToStringTag$3 = shams();
3136
+ var hasToStringTag$3 = requireShams()();
3092
3137
 
3093
3138
  /** @type {import('.')} */
3094
3139
  var isNumberObject = function isNumberObject(value) {
@@ -3101,7 +3146,7 @@
3101
3146
  return hasToStringTag$3 ? tryNumberObject(value) : $toString$3(value) === numClass;
3102
3147
  };
3103
3148
 
3104
- var callBound$5 = callBound$i;
3149
+ var callBound$5 = callBound$h;
3105
3150
  var $boolToStr = callBound$5('Boolean.prototype.toString');
3106
3151
  var $toString$2 = callBound$5('Object.prototype.toString');
3107
3152
 
@@ -3115,7 +3160,7 @@
3115
3160
  }
3116
3161
  };
3117
3162
  var boolClass = '[object Boolean]';
3118
- var hasToStringTag$2 = shams();
3163
+ var hasToStringTag$2 = requireShams()();
3119
3164
 
3120
3165
  /** @type {import('.')} */
3121
3166
  var isBooleanObject = function isBoolean(value) {
@@ -3137,7 +3182,7 @@
3137
3182
  if (hasRequiredSafeRegexTest) return safeRegexTest$1;
3138
3183
  hasRequiredSafeRegexTest = 1;
3139
3184
 
3140
- var callBound = callBound$i;
3185
+ var callBound = callBound$h;
3141
3186
  var isRegex = isRegex$1;
3142
3187
 
3143
3188
  var $exec = callBound('RegExp.prototype.exec');
@@ -3155,9 +3200,9 @@
3155
3200
  return safeRegexTest$1;
3156
3201
  }
3157
3202
 
3158
- var callBound$4 = callBound$i;
3203
+ var callBound$4 = callBound$h;
3159
3204
  var $toString$1 = callBound$4('Object.prototype.toString');
3160
- var hasSymbols = hasSymbols$4();
3205
+ var hasSymbols = hasSymbols$3();
3161
3206
  var safeRegexTest = requireSafeRegexTest();
3162
3207
 
3163
3208
  if (hasSymbols) {
@@ -3250,7 +3295,7 @@
3250
3295
 
3251
3296
  var isBigintExports = isBigint.exports;
3252
3297
 
3253
- var isString = isString$2;
3298
+ var isString = requireIsString();
3254
3299
  var isNumber = isNumberObject;
3255
3300
  var isBoolean = isBooleanObject;
3256
3301
  var isSymbol = isSymbolExports;
@@ -3328,7 +3373,7 @@
3328
3373
  var isWeakset = {exports: {}};
3329
3374
 
3330
3375
  var GetIntrinsic$1 = getIntrinsic;
3331
- var callBound$3 = callBound$i;
3376
+ var callBound$3 = callBound$h;
3332
3377
 
3333
3378
  var $WeakSet = GetIntrinsic$1('%WeakSet%', true);
3334
3379
 
@@ -3598,12 +3643,12 @@
3598
3643
  var forEach = forEach$1;
3599
3644
  var availableTypedArrays = availableTypedArrays$1;
3600
3645
  var callBind = callBindExports;
3601
- var callBound$2 = callBound$i;
3646
+ var callBound$2 = callBound$h;
3602
3647
  var gOPD = gopd$1;
3603
- var getProto = getProto$3;
3648
+ var getProto = requireGetProto();
3604
3649
 
3605
3650
  var $toString = callBound$2('Object.prototype.toString');
3606
- var hasToStringTag = shams();
3651
+ var hasToStringTag = requireShams()();
3607
3652
 
3608
3653
  var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
3609
3654
  var typedArrays = availableTypedArrays();
@@ -3711,7 +3756,7 @@
3711
3756
  return tryTypedArrays(value);
3712
3757
  };
3713
3758
 
3714
- var callBound$1 = callBound$i;
3759
+ var callBound$1 = callBound$h;
3715
3760
  var $byteLength = callBound$1('ArrayBuffer.prototype.byteLength', true);
3716
3761
 
3717
3762
  var isArrayBuffer$1 = isArrayBuffer$2;
@@ -3725,7 +3770,7 @@
3725
3770
  }; // in node < 0.11, byteLength is an own nonconfigurable property
3726
3771
 
3727
3772
  var assign = object_assign;
3728
- var callBound = callBound$g;
3773
+ var callBound = callBound$f;
3729
3774
  var flags = regexp_prototype_flags;
3730
3775
  var GetIntrinsic = getIntrinsic;
3731
3776
  var getIterator = esGetIteratorExports;
@@ -5350,7 +5395,7 @@
5350
5395
  })(ChannelTypes || (ChannelTypes = {}));
5351
5396
  const defaultChannelsProps = ["id", "type", "broadcast", "addContextListener", "getCurrentContext"];
5352
5397
  const defaultContextProps = ["type"];
5353
- const defaultGlue42APIs = ["contexts", "channels", "interop", "intents", "appManager", "windows"];
5398
+ const defaultGlue42APIs = ["contexts", "channels", "interop", "intents", "windows"];
5354
5399
  const glueChannelNamePrefix = "___channel___";
5355
5400
  const fdc3NothingContextType = "fdc3.nothing";
5356
5401
  const RaiseTimeoutMs = 75 * 1000;
@@ -6267,22 +6312,65 @@
6267
6312
  if (missingApis.length) {
6268
6313
  return { isValid: false, error: { message: `Fdc3 cannot initialize correctly - Glue is missing the following ${missingApis.length > 1 ? "properties" : "property"}: ${missingApis.join(", ")}` } };
6269
6314
  }
6315
+ if (typeof glue.apps !== "object" && typeof glue.appManager !== "object") {
6316
+ return { isValid: false, error: { message: "Glue should be initialized with either 'apps' or 'appManager' API" } };
6317
+ }
6270
6318
  return { isValid: true };
6271
6319
  }
6272
6320
  interopInstance() {
6273
6321
  return this.glue.interop.instance;
6274
6322
  }
6275
- getApplication(name) {
6276
- return this.glue.appManager.application(name);
6323
+ async getApplication(options) {
6324
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6325
+ if (!isAppsAPIAvailable) {
6326
+ return this.glue.appManager.application(options.name);
6327
+ }
6328
+ const app = await this.glue.apps.registry.get(options);
6329
+ return app ?? undefined;
6330
+ }
6331
+ async getApplicationInstances(appName) {
6332
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6333
+ if (!isAppsAPIAvailable) {
6334
+ return this.glue.appManager.instances().filter(inst => inst.application.name === appName);
6335
+ }
6336
+ const appInstances = await this.glue.apps.instances.getMany({ appNames: [appName] });
6337
+ return appInstances;
6277
6338
  }
6278
- getAllAppManagerInstances() {
6279
- return this.glue.appManager.instances();
6339
+ async getAppInstanceById(id) {
6340
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6341
+ if (!isAppsAPIAvailable) {
6342
+ return this.glue.appManager.instances().find(inst => inst.id === id);
6343
+ }
6344
+ const appInstance = await this.glue.apps.instances.get({ id });
6345
+ return appInstance ?? undefined;
6280
6346
  }
6281
- getApplicationInstances(appName) {
6282
- return this.getAllAppManagerInstances().filter(inst => inst.application.name === appName);
6347
+ async getIoCDAppConfiguration(app) {
6348
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6349
+ if (!isAppsAPIAvailable) {
6350
+ return app.getConfiguration();
6351
+ }
6352
+ const definition = app.definition;
6353
+ if (definition) {
6354
+ return definition;
6355
+ }
6356
+ const appWithDefinition = await this.glue.apps.registry.get({ name: app.name, includeDefinition: true });
6357
+ if (!appWithDefinition?.definition) {
6358
+ throw new Error(`Application definition for app '${app.name}' could not be found`);
6359
+ }
6360
+ return appWithDefinition.definition;
6283
6361
  }
6284
- getAppInstanceById(id) {
6285
- return this.getAllAppManagerInstances().find(inst => inst.id === id);
6362
+ async startApplication({ app, context, waitForInstanceReady }) {
6363
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6364
+ if (!isAppsAPIAvailable) {
6365
+ const glueInst = await app.start(context, { waitForAGMReady: waitForInstanceReady });
6366
+ return glueInst;
6367
+ }
6368
+ const glueInstance = await this.glue.apps.instances.start({ name: app.name, context });
6369
+ if (!waitForInstanceReady) {
6370
+ return glueInstance;
6371
+ }
6372
+ await this.glue.apps.instances.waitForReady({ id: glueInstance.id });
6373
+ return glueInstance;
6286
6374
  }
6287
6375
  async findIntents(intentFilter) {
6288
6376
  return this.glue.intents.find(intentFilter);
@@ -6406,8 +6494,15 @@
6406
6494
  getGlueVersion() {
6407
6495
  return this.glue?.version;
6408
6496
  }
6409
- registerOnInstanceStopped(cb) {
6410
- return this.glue.appManager.onInstanceStopped(cb);
6497
+ async registerOnInstanceStopped(callback) {
6498
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6499
+ if (!isAppsAPIAvailable) {
6500
+ return this.glue.appManager.onInstanceStopped((inst) => callback(inst.id));
6501
+ }
6502
+ const unsub = await this.glue.apps.instances.onStopped((event) => {
6503
+ callback(event.instance.id);
6504
+ });
6505
+ return unsub;
6411
6506
  }
6412
6507
  async unregisterMethod(methodName) {
6413
6508
  return this.glue.interop.unregister(methodName);
@@ -6569,6 +6664,9 @@
6569
6664
  async contextsSetPaths(name, paths) {
6570
6665
  await this.glue.contexts.setPaths(name, paths);
6571
6666
  }
6667
+ isAppsAPIAvailable() {
6668
+ return typeof this.glue.apps === "object";
6669
+ }
6572
6670
  }
6573
6671
 
6574
6672
  const GLUE42_EVENT_NAME = "Glue42";
@@ -8587,7 +8685,7 @@
8587
8685
  if (!context && !resultType) {
8588
8686
  return this.convertGlue42IntentToFDC3Intent(searchedGlueIntent);
8589
8687
  }
8590
- const contextType = (context && context.type === fdc3NothingContextType) ? undefined : context?.type;
8688
+ const contextType = context?.type === fdc3NothingContextType ? undefined : context?.type;
8591
8689
  const filteredIntent = this.getGlueIntentWithFilteredHandlers(searchedGlueIntent, { contextType, resultType });
8592
8690
  if (!filteredIntent.handlers.length) {
8593
8691
  throw new Error(ResolveError.NoAppsFound);
@@ -8602,10 +8700,11 @@
8602
8700
  throw new Error(ResolveError.NoAppsFound);
8603
8701
  }
8604
8702
  this.logger?.info(`[${commandId}] - parsing glue intents to fdc3 intents and returning`);
8605
- return glueIntents.map((glueIntent) => {
8703
+ const appIntents = await Promise.all(glueIntents.map((glueIntent) => {
8606
8704
  const intentWithFilteredHandlers = this.getGlueIntentWithFilteredHandlers(glueIntent, { contextType: context.type, resultType });
8607
8705
  return this.convertGlue42IntentToFDC3Intent(intentWithFilteredHandlers);
8608
- });
8706
+ }));
8707
+ return appIntents;
8609
8708
  }
8610
8709
  async raiseIntent({ commandId, intent, context, target }) {
8611
8710
  await this.glueController.gluePromise;
@@ -8617,7 +8716,7 @@
8617
8716
  throw new Error(ResolveError.NoAppsFound);
8618
8717
  }
8619
8718
  if (!target) {
8620
- const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
8719
+ const filteredGlueIntent = await this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
8621
8720
  this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} and handlers ${filteredGlueIntent.handlers.map(h => h.applicationName && h.instanceId)}`);
8622
8721
  return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
8623
8722
  }
@@ -8723,7 +8822,7 @@
8723
8822
  handler: rememberedHandlerWithFilter.handler
8724
8823
  };
8725
8824
  }
8726
- filterGlueIntentHandlers({ commandId, intent, context, target }) {
8825
+ async filterGlueIntentHandlers({ commandId, intent, context, target }) {
8727
8826
  let filteredGlueIntent;
8728
8827
  filteredGlueIntent = this.filterIntentHandlersByContext(intent, context);
8729
8828
  if (!target) {
@@ -8731,14 +8830,14 @@
8731
8830
  return filteredGlueIntent;
8732
8831
  }
8733
8832
  this.logger?.log(`[${commandId}] - filtering handlers by target (${JSON.stringify(target)}) for intent ${intent.name}`);
8734
- filteredGlueIntent = this.filterIntentHandlersByTarget({ intent, target, commandId });
8833
+ filteredGlueIntent = await this.filterIntentHandlersByTarget({ intent, target, commandId });
8735
8834
  return filteredGlueIntent;
8736
8835
  }
8737
- filterIntentHandlersByTarget({ intent, target, commandId }) {
8836
+ async filterIntentHandlersByTarget({ intent, target, commandId }) {
8738
8837
  const appName = typeof target === "string" ? target : target.appId;
8739
8838
  const instanceId = typeof target === "string" ? undefined : target.instanceId;
8740
8839
  this.logger?.info(`[${commandId}] - Checking if application with name ${appName} exists`);
8741
- const app = this.glueController.getApplication(appName);
8840
+ const app = await this.glueController.getApplication({ name: appName, includeDefinition: true, includeInstances: true });
8742
8841
  const serverInstances = this.serverInstanceAsIntentHandler(intent.name);
8743
8842
  if (!app && (typeof target === "string" || !target.instanceId || !serverInstances.length)) {
8744
8843
  throw new Error(ResolveError.TargetAppUnavailable);
@@ -8752,8 +8851,9 @@
8752
8851
  this.logger?.log(`[${commandId}] - returning all handlers for intent ${intent.name} and target: ${JSON.stringify(target)}`);
8753
8852
  return { name: intent.name, handlers: validHandlersByApplicationName };
8754
8853
  }
8854
+ const appInstances = app?.instances ?? await (this.glueController.getApplicationInstances(appName));
8755
8855
  const isValidInstanceOfTheApp = app
8756
- ? app.instances.find((inst) => inst.id === instanceId)
8856
+ ? appInstances.find((inst) => inst.id === instanceId)
8757
8857
  : serverInstances.find((inst) => inst.instance === instanceId);
8758
8858
  if (!isValidInstanceOfTheApp) {
8759
8859
  throw new Error(ResolveError.TargetInstanceUnavailable);
@@ -8818,27 +8918,33 @@
8818
8918
  this.logger?.info(`[${commandId}] - returning private channel`);
8819
8919
  return channel.toApi();
8820
8920
  }
8821
- convertGlue42IntentToFDC3Intent(glueIntent) {
8921
+ async convertGlue42IntentToFDC3Intent(glueIntent) {
8822
8922
  const { name, handlers } = glueIntent;
8923
+ const apps = await Promise.all(handlers.map(async (handler) => {
8924
+ const appName = handler.applicationName;
8925
+ const app = await this.glueController.getApplication({ name: appName, includeDefinition: true });
8926
+ const icons = [app?.icon, ...(app?.userProperties?.icons ?? []), ...(app?.customProperties?.icons ?? [])]
8927
+ .filter((icon) => !!icon)
8928
+ .map((icon) => ({ src: icon }));
8929
+ const images = [...(app?.userProperties?.images ?? []), ...(app?.customProperties?.images ?? [])]
8930
+ .filter((image) => !!image)
8931
+ .map((image) => ({ src: image }));
8932
+ const tooltip = app?.title || app?.userProperties?.tooltip || `${appName} (${handler.type})`;
8933
+ return {
8934
+ appId: appName,
8935
+ instanceId: handler.instanceId,
8936
+ name: appName,
8937
+ title: handler.applicationTitle || handler.instanceTitle || appName,
8938
+ tooltip,
8939
+ description: handler.applicationDescription,
8940
+ icons,
8941
+ images,
8942
+ resultType: handler.resultType
8943
+ };
8944
+ }));
8823
8945
  const appIntent = {
8824
8946
  intent: { name, displayName: handlers[0].displayName || "" },
8825
- apps: handlers.map((handler) => {
8826
- const appName = handler.applicationName;
8827
- const app = this.glueController.getApplication(appName);
8828
- const icons = (handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons ?? [])] : (app?.userProperties.icons ?? [])).filter((icon) => !!icon).map((icon) => ({ src: icon }));
8829
- const images = (app?.userProperties.images ?? []).filter((image) => !!image).map((image) => ({ src: image }));
8830
- return {
8831
- appId: appName,
8832
- instanceId: handler.instanceId,
8833
- name: appName,
8834
- title: handler.applicationTitle || handler.instanceTitle || appName,
8835
- tooltip: app?.userProperties.tooltip ?? `${appName} (${handler.type})`,
8836
- description: handler.applicationDescription,
8837
- icons,
8838
- images,
8839
- resultType: handler.resultType
8840
- };
8841
- })
8947
+ apps
8842
8948
  };
8843
8949
  return appIntent;
8844
8950
  }
@@ -8951,7 +9057,7 @@
8951
9057
  await this.glueController.gluePromise;
8952
9058
  this.logger?.log(`[${commandId}] - open() invoked with target ${JSON.stringify(target)} ${context ? `and contextType ${context.type}` : ""}`);
8953
9059
  const name = typeof target === "object" ? target.appId : target;
8954
- const app = this.glueController.getApplication(name);
9060
+ const app = await this.glueController.getApplication({ name });
8955
9061
  if (!app) {
8956
9062
  throw new Error(OpenError.AppNotFound);
8957
9063
  }
@@ -8962,8 +9068,7 @@
8962
9068
  }
8963
9069
  try {
8964
9070
  this.logger?.info(`[${commandId}] - opening app '${app.name}' without context`);
8965
- const inBrowser = this.glueController.isRunningInBrowser();
8966
- const glueInst = await app.start(undefined, { waitForAGMReady: !inBrowser });
9071
+ const glueInst = await this.glueController.startApplication({ app, waitForInstanceReady: !this.glueController.isRunningInBrowser() });
8967
9072
  this.logger?.info(`[${commandId}] - instance with id ${glueInst.id} started`);
8968
9073
  return this.parseGlueInstToAppIdentifier(glueInst);
8969
9074
  }
@@ -8975,12 +9080,12 @@
8975
9080
  await this.glueController.gluePromise;
8976
9081
  this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
8977
9082
  const { appId } = appIdentifier;
8978
- const app = this.glueController.getApplication(appId);
9083
+ const app = await this.glueController.getApplication({ name: appId, includeInstances: true, includeDefinition: true });
8979
9084
  if (!app) {
8980
9085
  throw new Error(ResolveError.NoAppsFound);
8981
9086
  }
8982
- const glueInstances = this.glueController.getApplicationInstances(appId);
8983
- const fdc3Instances = glueInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
9087
+ const appInstances = app.instances ?? await this.glueController.getApplicationInstances(appId);
9088
+ const fdc3Instances = appInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
8984
9089
  this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${JSON.stringify(appIdentifier)}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
8985
9090
  return fdc3Instances;
8986
9091
  }
@@ -8988,7 +9093,7 @@
8988
9093
  await this.glueController.gluePromise;
8989
9094
  this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
8990
9095
  const { appId, instanceId } = appIdentifier;
8991
- const app = this.glueController.getApplication(appId);
9096
+ const app = await this.glueController.getApplication({ name: appId, includeDefinition: true, includeInstances: true });
8992
9097
  if (!app) {
8993
9098
  throw new Error(OpenError.AppNotFound);
8994
9099
  }
@@ -8996,7 +9101,7 @@
8996
9101
  this.logger?.info(`[${commandId}] - no opened instances found. Parsing app ${app.name}`);
8997
9102
  return this.parseGlueAppToAppMetadata(app);
8998
9103
  }
8999
- const instance = this.glueController.getAppInstanceById(instanceId);
9104
+ const instance = await this.glueController.getAppInstanceById(instanceId);
9000
9105
  const appMetadata = this.parseGlueAppToAppMetadata(app, instance);
9001
9106
  this.logger?.info(`[${commandId}] - found app metadata: ${appMetadata}`);
9002
9107
  return appMetadata;
@@ -9004,9 +9109,9 @@
9004
9109
  async getInfo({ commandId }) {
9005
9110
  await this.glueController.gluePromise;
9006
9111
  this.logger?.info(`${commandId} - getInfo() invoked`);
9007
- const appMetadata = this.getCurrentAppMetadata();
9112
+ const appMetadata = await this.getCurrentAppMetadata();
9008
9113
  const globalScope = typeof process !== "undefined" ? process : window;
9009
- const { provider, providerVersion, standardVersion } = globalScope.fdc3Info;
9114
+ const { provider, providerVersion, standardVersion } = globalScope.fdc3Info ?? {};
9010
9115
  return {
9011
9116
  provider,
9012
9117
  providerVersion,
@@ -9019,10 +9124,10 @@
9019
9124
  appMetadata
9020
9125
  };
9021
9126
  }
9022
- getCurrentAppMetadata() {
9127
+ async getCurrentAppMetadata() {
9023
9128
  const myInstance = this.glueController.interopInstance();
9024
9129
  const myInstanceApplicationName = myInstance.application ?? myInstance.applicationName;
9025
- const myApp = this.glueController.getApplication(myInstanceApplicationName);
9130
+ const myApp = await this.glueController.getApplication({ name: myInstanceApplicationName, includeDefinition: true });
9026
9131
  if (myApp) {
9027
9132
  return { appId: myApp.name, instanceId: myInstance.instance };
9028
9133
  }
@@ -9031,49 +9136,64 @@
9031
9136
  }
9032
9137
  parseGlueInstToAppIdentifier(glueInst) {
9033
9138
  return {
9034
- appId: glueInst.application.name,
9139
+ appId: this.isApplicationInstance(glueInst) ? glueInst.appName : glueInst.application.name,
9035
9140
  instanceId: glueInst.id
9036
9141
  };
9037
9142
  }
9038
9143
  async parseGlueAppToAppMetadata(app, instance) {
9039
- const appMetadata = await this.getBaseGlueAppToAppMetadata(app);
9144
+ const inBrowserNamespace = this.glueController.isRunningInBrowser();
9145
+ const appMetadata = inBrowserNamespace
9146
+ ? await this.getBaseGlueAppToAppMetadataInBrowser(app)
9147
+ : await this.getBaseGlueAppToAppMetadataInDesktop(app);
9040
9148
  if (!instance) {
9041
9149
  return appMetadata;
9042
9150
  }
9043
- return this.addInstanceMetadataToAppMetadata(appMetadata, instance);
9151
+ const instanceData = {
9152
+ instanceId: instance.id,
9153
+ instanceMetadata: this.isApplicationInstance(instance) ? instance.interopInstance : instance.agm
9154
+ };
9155
+ return { ...appMetadata, ...instanceData };
9044
9156
  }
9045
- async getBaseGlueAppToAppMetadata(app) {
9046
- const inBrowserNamespace = this.glueController.isRunningInBrowser();
9047
- const appConfiguration = inBrowserNamespace
9048
- ? app.userProperties
9049
- : await app.getConfiguration();
9050
- const icon = inBrowserNamespace
9051
- ? app.icon
9052
- : (await app.getConfiguration()).icon;
9157
+ async getBaseGlueAppToAppMetadataInDesktop(app) {
9158
+ const appConfiguration = await this.glueController.getIoCDAppConfiguration(app);
9159
+ const screenshots = appConfiguration.customProperties?.screenshots ?? appConfiguration.userProperties?.screenshots;
9160
+ return {
9161
+ appId: appConfiguration.name,
9162
+ name: appConfiguration.name,
9163
+ version: appConfiguration.version,
9164
+ description: appConfiguration.description,
9165
+ title: appConfiguration.title,
9166
+ icons: appConfiguration.icon ? [{ src: appConfiguration.icon }] : [],
9167
+ tooltip: appConfiguration.tooltip,
9168
+ screenshots
9169
+ };
9170
+ }
9171
+ async getBaseGlueAppToAppMetadataInBrowser(app) {
9053
9172
  return {
9054
9173
  appId: app.name,
9055
9174
  name: app.name,
9056
9175
  version: app.version,
9057
- description: appConfiguration.description,
9176
+ description: app.userProperties.description,
9058
9177
  title: app.title,
9059
- icons: icon ? [{ src: icon }] : [],
9060
- tooltip: appConfiguration.tooltip,
9061
- screenshots: inBrowserNamespace
9062
- ? appConfiguration.screenshots
9063
- : appConfiguration.customProperties.screenshots
9178
+ icons: app.icon ? [{ src: app.icon }] : [],
9179
+ tooltip: app.userProperties.tooltip,
9180
+ screenshots: app.userProperties.screenshots
9064
9181
  };
9065
9182
  }
9066
- addInstanceMetadataToAppMetadata(appMetadata, instance) {
9067
- return { ...appMetadata, instanceId: instance.id, instanceMetadata: instance.agm };
9183
+ isApplicationInstance(instance) {
9184
+ return "appName" in instance;
9068
9185
  }
9069
9186
  async openAppWithContext(app, context) {
9070
9187
  const guid = nanoid();
9071
9188
  const startContext = this.buildStartContext(context, guid);
9072
- const wrappedPromise = this.createContextListenerWrappedPromise(app);
9189
+ const wrappedPromise = this.createContextListenerWrappedPromise(app.name);
9073
9190
  this.appsStateStore.addOpenAppPromise(guid, wrappedPromise);
9074
- const inBrowser = this.glueController.isRunningInBrowser();
9075
9191
  try {
9076
- const glueInst = await app.start(startContext, { waitForAGMReady: !inBrowser });
9192
+ const glueInst = await this.glueController.startApplication({
9193
+ app,
9194
+ context: startContext,
9195
+ waitForInstanceReady: !this.glueController.isRunningInBrowser()
9196
+ });
9077
9197
  await wrappedPromise.promise;
9078
9198
  this.appsStateStore.removeOpenAppPromise(guid);
9079
9199
  return this.parseGlueInstToAppIdentifier(glueInst);
@@ -9100,15 +9220,16 @@
9100
9220
  }
9101
9221
  };
9102
9222
  }
9103
- createContextListenerWrappedPromise(app) {
9223
+ createContextListenerWrappedPromise(appName) {
9104
9224
  let resolve = () => { };
9105
9225
  let reject = () => { };
9226
+ const timeoutMessage = `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${appName} to register context listener`;
9106
9227
  const promise = promisePlus(() => {
9107
9228
  return new Promise((res, rej) => {
9108
9229
  resolve = res;
9109
9230
  reject = rej;
9110
9231
  });
9111
- }, this.defaultContextListenerInvokedPromiseTimeout, `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${app.name} to register context listener`);
9232
+ }, this.defaultContextListenerInvokedPromiseTimeout, timeoutMessage);
9112
9233
  return { promise, resolve, reject };
9113
9234
  }
9114
9235
  }
@@ -9535,9 +9656,12 @@
9535
9656
  this.channelsController.removePrivateChannelFromStoreById(this.id);
9536
9657
  await this.sendCollaborateMessage({ action: "disconnectedFromPrivateChannel" });
9537
9658
  this.logger?.trace(`[${commandId}] - collaborator received action ${"disconnectedFromPrivateChannel"}`);
9538
- if (this.unsubFromInstanceStopped) {
9539
- this.unsubFromInstanceStopped();
9659
+ if (!this.unsubFromInstanceStopped) {
9660
+ return;
9540
9661
  }
9662
+ const unsub = this.unsubFromInstanceStopped instanceof Promise ? await this.unsubFromInstanceStopped : this.unsubFromInstanceStopped;
9663
+ unsub();
9664
+ this.unsubFromInstanceStopped = undefined;
9541
9665
  }
9542
9666
  ensureAlive(commandId) {
9543
9667
  if (!this.disconnected) {
@@ -9556,8 +9680,8 @@
9556
9680
  throw new Error(ChannelError.AccessDenied);
9557
9681
  }
9558
9682
  subscribeForCollaboratorInstanceStop(commandId) {
9559
- const handler = (instance) => {
9560
- if (instance.id !== this.collaborator?.instanceId) {
9683
+ const handler = (id) => {
9684
+ if (id !== this.collaborator?.instanceId) {
9561
9685
  return;
9562
9686
  }
9563
9687
  this.handleCollaboratorDisconnect();
@@ -10442,7 +10566,7 @@
10442
10566
  return ioc.fdc3;
10443
10567
  };
10444
10568
 
10445
- var version = "2.7.1-beta.0";
10569
+ var version = "2.7.2";
10446
10570
 
10447
10571
  const globalScope = typeof process !== "undefined" ? process : window;
10448
10572
  globalScope.fdc3Info = {