@interopio/iframes-api 0.1.0-beta.0
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/LICENSE +21 -0
- package/changelog.md +2 -0
- package/dist/iframes.es.js +1229 -0
- package/dist/iframes.es.js.map +1 -0
- package/dist/iframes.umd.js +1237 -0
- package/dist/iframes.umd.js.map +1 -0
- package/dist/iframes.umd.min.js +2 -0
- package/dist/iframes.umd.min.js.map +1 -0
- package/iframes.d.ts +73 -0
- package/package.json +38 -0
- package/readme.md +121 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iframes.umd.js","sources":["../src/shared/constants.ts","../../../node_modules/decoder-validate/dist/index.es5.js","../src/shared/decoders.ts","../src/communication/bridge.ts","../../../node_modules/callback-registry/lib/index.js","../src/shared/utils.ts","../src/iframes/protocol.ts","../src/iframes/controller.ts","../src/shared/ioc.ts","../src/main.ts","../src/index.ts"],"sourcesContent":[null,"/**\r\n * Wraps values in an `Ok` type.\r\n *\r\n * Example: `ok(5) // => {ok: true, result: 5}`\r\n */\r\nvar ok = function (result) { return ({ ok: true, result: result }); };\r\n/**\r\n * Typeguard for `Ok`.\r\n */\r\nvar isOk = function (r) { return r.ok === true; };\r\n/**\r\n * Wraps errors in an `Err` type.\r\n *\r\n * Example: `err('on fire') // => {ok: false, error: 'on fire'}`\r\n */\r\nvar err = function (error) { return ({ ok: false, error: error }); };\r\n/**\r\n * Typeguard for `Err`.\r\n */\r\nvar isErr = function (r) { return r.ok === false; };\r\n/**\r\n * Create a `Promise` that either resolves with the result of `Ok` or rejects\r\n * with the error of `Err`.\r\n */\r\nvar asPromise = function (r) {\r\n return r.ok === true ? Promise.resolve(r.result) : Promise.reject(r.error);\r\n};\r\n/**\r\n * Unwraps a `Result` and returns either the result of an `Ok`, or\r\n * `defaultValue`.\r\n *\r\n * Example:\r\n * ```\r\n * Result.withDefault(5, number().run(json))\r\n * ```\r\n *\r\n * It would be nice if `Decoder` had an instance method that mirrored this\r\n * function. Such a method would look something like this:\r\n * ```\r\n * class Decoder<A> {\r\n * runWithDefault = (defaultValue: A, json: any): A =>\r\n * Result.withDefault(defaultValue, this.run(json));\r\n * }\r\n *\r\n * number().runWithDefault(5, json)\r\n * ```\r\n * Unfortunately, the type of `defaultValue: A` on the method causes issues\r\n * with type inference on the `object` decoder in some situations. While these\r\n * inference issues can be solved by providing the optional type argument for\r\n * `object`s, the extra trouble and confusion doesn't seem worth it.\r\n */\r\nvar withDefault = function (defaultValue, r) {\r\n return r.ok === true ? r.result : defaultValue;\r\n};\r\n/**\r\n * Return the successful result, or throw an error.\r\n */\r\nvar withException = function (r) {\r\n if (r.ok === true) {\r\n return r.result;\r\n }\r\n else {\r\n throw r.error;\r\n }\r\n};\r\n/**\r\n * Given an array of `Result`s, return the successful values.\r\n */\r\nvar successes = function (results) {\r\n return results.reduce(function (acc, r) { return (r.ok === true ? acc.concat(r.result) : acc); }, []);\r\n};\r\n/**\r\n * Apply `f` to the result of an `Ok`, or pass the error through.\r\n */\r\nvar map = function (f, r) {\r\n return r.ok === true ? ok(f(r.result)) : r;\r\n};\r\n/**\r\n * Apply `f` to the result of two `Ok`s, or pass an error through. If both\r\n * `Result`s are errors then the first one is returned.\r\n */\r\nvar map2 = function (f, ar, br) {\r\n return ar.ok === false ? ar :\r\n br.ok === false ? br :\r\n ok(f(ar.result, br.result));\r\n};\r\n/**\r\n * Apply `f` to the error of an `Err`, or pass the success through.\r\n */\r\nvar mapError = function (f, r) {\r\n return r.ok === true ? r : err(f(r.error));\r\n};\r\n/**\r\n * Chain together a sequence of computations that may fail, similar to a\r\n * `Promise`. If the first computation fails then the error will propagate\r\n * through. If it succeeds, then `f` will be applied to the value, returning a\r\n * new `Result`.\r\n */\r\nvar andThen = function (f, r) {\r\n return r.ok === true ? f(r.result) : r;\r\n};\r\n\r\n\r\nvar result = Object.freeze({\r\n\tok: ok,\r\n\tisOk: isOk,\r\n\terr: err,\r\n\tisErr: isErr,\r\n\tasPromise: asPromise,\r\n\twithDefault: withDefault,\r\n\twithException: withException,\r\n\tsuccesses: successes,\r\n\tmap: map,\r\n\tmap2: map2,\r\n\tmapError: mapError,\r\n\tandThen: andThen\r\n});\r\n\r\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\n\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction isEqual(a, b) {\r\n if (a === b) {\r\n return true;\r\n }\r\n if (a === null && b === null) {\r\n return true;\r\n }\r\n if (typeof (a) !== typeof (b)) {\r\n return false;\r\n }\r\n if (typeof (a) === 'object') {\r\n // Array\r\n if (Array.isArray(a)) {\r\n if (!Array.isArray(b)) {\r\n return false;\r\n }\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < a.length; i++) {\r\n if (!isEqual(a[i], b[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n // Hash table\r\n var keys = Object.keys(a);\r\n if (keys.length !== Object.keys(b).length) {\r\n return false;\r\n }\r\n for (var i = 0; i < keys.length; i++) {\r\n if (!b.hasOwnProperty(keys[i])) {\r\n return false;\r\n }\r\n if (!isEqual(a[keys[i]], b[keys[i]])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\n/**\r\n * Type guard for `DecoderError`. One use case of the type guard is in the\r\n * `catch` of a promise. Typescript types the error argument of `catch` as\r\n * `any`, so when dealing with a decoder as a promise you may need to\r\n * distinguish between a `DecoderError` and an error string.\r\n */\r\nvar isDecoderError = function (a) {\r\n return a.kind === 'DecoderError' && typeof a.at === 'string' && typeof a.message === 'string';\r\n};\r\n/*\r\n * Helpers\r\n */\r\nvar isJsonArray = function (json) { return Array.isArray(json); };\r\nvar isJsonObject = function (json) {\r\n return typeof json === 'object' && json !== null && !isJsonArray(json);\r\n};\r\nvar typeString = function (json) {\r\n switch (typeof json) {\r\n case 'string':\r\n return 'a string';\r\n case 'number':\r\n return 'a number';\r\n case 'boolean':\r\n return 'a boolean';\r\n case 'undefined':\r\n return 'undefined';\r\n case 'object':\r\n if (json instanceof Array) {\r\n return 'an array';\r\n }\r\n else if (json === null) {\r\n return 'null';\r\n }\r\n else {\r\n return 'an object';\r\n }\r\n default:\r\n return JSON.stringify(json);\r\n }\r\n};\r\nvar expectedGot = function (expected, got) {\r\n return \"expected \" + expected + \", got \" + typeString(got);\r\n};\r\nvar printPath = function (paths) {\r\n return paths.map(function (path) { return (typeof path === 'string' ? \".\" + path : \"[\" + path + \"]\"); }).join('');\r\n};\r\nvar prependAt = function (newAt, _a) {\r\n var at = _a.at, rest = __rest(_a, [\"at\"]);\r\n return (__assign({ at: newAt + (at || '') }, rest));\r\n};\r\n/**\r\n * Decoders transform json objects with unknown structure into known and\r\n * verified forms. You can create objects of type `Decoder<A>` with either the\r\n * primitive decoder functions, such as `boolean()` and `string()`, or by\r\n * applying higher-order decoders to the primitives, such as `array(boolean())`\r\n * or `dict(string())`.\r\n *\r\n * Each of the decoder functions are available both as a static method on\r\n * `Decoder` and as a function alias -- for example the string decoder is\r\n * defined at `Decoder.string()`, but is also aliased to `string()`. Using the\r\n * function aliases exported with the library is recommended.\r\n *\r\n * `Decoder` exposes a number of 'run' methods, which all decode json in the\r\n * same way, but communicate success and failure in different ways. The `map`\r\n * and `andThen` methods modify decoders without having to call a 'run' method.\r\n *\r\n * Alternatively, the main decoder `run()` method returns an object of type\r\n * `Result<A, DecoderError>`. This library provides a number of helper\r\n * functions for dealing with the `Result` type, so you can do all the same\r\n * things with a `Result` as with the decoder methods.\r\n */\r\nvar Decoder = /** @class */ (function () {\r\n /**\r\n * The Decoder class constructor is kept private to separate the internal\r\n * `decode` function from the external `run` function. The distinction\r\n * between the two functions is that `decode` returns a\r\n * `Partial<DecoderError>` on failure, which contains an unfinished error\r\n * report. When `run` is called on a decoder, the relevant series of `decode`\r\n * calls is made, and then on failure the resulting `Partial<DecoderError>`\r\n * is turned into a `DecoderError` by filling in the missing information.\r\n *\r\n * While hiding the constructor may seem restrictive, leveraging the\r\n * provided decoder combinators and helper functions such as\r\n * `andThen` and `map` should be enough to build specialized decoders as\r\n * needed.\r\n */\r\n function Decoder(decode) {\r\n var _this = this;\r\n this.decode = decode;\r\n /**\r\n * Run the decoder and return a `Result` with either the decoded value or a\r\n * `DecoderError` containing the json input, the location of the error, and\r\n * the error message.\r\n *\r\n * Examples:\r\n * ```\r\n * number().run(12)\r\n * // => {ok: true, result: 12}\r\n *\r\n * string().run(9001)\r\n * // =>\r\n * // {\r\n * // ok: false,\r\n * // error: {\r\n * // kind: 'DecoderError',\r\n * // input: 9001,\r\n * // at: 'input',\r\n * // message: 'expected a string, got 9001'\r\n * // }\r\n * // }\r\n * ```\r\n */\r\n this.run = function (json) {\r\n return mapError(function (error) { return ({\r\n kind: 'DecoderError',\r\n input: json,\r\n at: 'input' + (error.at || ''),\r\n message: error.message || ''\r\n }); }, _this.decode(json));\r\n };\r\n /**\r\n * Run the decoder as a `Promise`.\r\n */\r\n this.runPromise = function (json) { return asPromise(_this.run(json)); };\r\n /**\r\n * Run the decoder and return the value on success, or throw an exception\r\n * with a formatted error string.\r\n */\r\n this.runWithException = function (json) { return withException(_this.run(json)); };\r\n /**\r\n * Construct a new decoder that applies a transformation to the decoded\r\n * result. If the decoder succeeds then `f` will be applied to the value. If\r\n * it fails the error will propagated through.\r\n *\r\n * Example:\r\n * ```\r\n * number().map(x => x * 5).run(10)\r\n * // => {ok: true, result: 50}\r\n * ```\r\n */\r\n this.map = function (f) {\r\n return new Decoder(function (json) { return map(f, _this.decode(json)); });\r\n };\r\n /**\r\n * Chain together a sequence of decoders. The first decoder will run, and\r\n * then the function will determine what decoder to run second. If the result\r\n * of the first decoder succeeds then `f` will be applied to the decoded\r\n * value. If it fails the error will propagate through.\r\n *\r\n * This is a very powerful method -- it can act as both the `map` and `where`\r\n * methods, can improve error messages for edge cases, and can be used to\r\n * make a decoder for custom types.\r\n *\r\n * Example of adding an error message:\r\n * ```\r\n * const versionDecoder = valueAt(['version'], number());\r\n * const infoDecoder3 = object({a: boolean()});\r\n *\r\n * const decoder = versionDecoder.andThen(version => {\r\n * switch (version) {\r\n * case 3:\r\n * return infoDecoder3;\r\n * default:\r\n * return fail(`Unable to decode info, version ${version} is not supported.`);\r\n * }\r\n * });\r\n *\r\n * decoder.run({version: 3, a: true})\r\n * // => {ok: true, result: {a: true}}\r\n *\r\n * decoder.run({version: 5, x: 'abc'})\r\n * // =>\r\n * // {\r\n * // ok: false,\r\n * // error: {... message: 'Unable to decode info, version 5 is not supported.'}\r\n * // }\r\n * ```\r\n *\r\n * Example of decoding a custom type:\r\n * ```\r\n * // nominal type for arrays with a length of at least one\r\n * type NonEmptyArray<T> = T[] & { __nonEmptyArrayBrand__: void };\r\n *\r\n * const nonEmptyArrayDecoder = <T>(values: Decoder<T>): Decoder<NonEmptyArray<T>> =>\r\n * array(values).andThen(arr =>\r\n * arr.length > 0\r\n * ? succeed(createNonEmptyArray(arr))\r\n * : fail(`expected a non-empty array, got an empty array`)\r\n * );\r\n * ```\r\n */\r\n this.andThen = function (f) {\r\n return new Decoder(function (json) {\r\n return andThen(function (value) { return f(value).decode(json); }, _this.decode(json));\r\n });\r\n };\r\n /**\r\n * Add constraints to a decoder _without_ changing the resulting type. The\r\n * `test` argument is a predicate function which returns true for valid\r\n * inputs. When `test` fails on an input, the decoder fails with the given\r\n * `errorMessage`.\r\n *\r\n * ```\r\n * const chars = (length: number): Decoder<string> =>\r\n * string().where(\r\n * (s: string) => s.length === length,\r\n * `expected a string of length ${length}`\r\n * );\r\n *\r\n * chars(5).run('12345')\r\n * // => {ok: true, result: '12345'}\r\n *\r\n * chars(2).run('HELLO')\r\n * // => {ok: false, error: {... message: 'expected a string of length 2'}}\r\n *\r\n * chars(12).run(true)\r\n * // => {ok: false, error: {... message: 'expected a string, got a boolean'}}\r\n * ```\r\n */\r\n this.where = function (test, errorMessage) {\r\n return _this.andThen(function (value) { return (test(value) ? Decoder.succeed(value) : Decoder.fail(errorMessage)); });\r\n };\r\n }\r\n /**\r\n * Decoder primitive that validates strings, and fails on all other input.\r\n */\r\n Decoder.string = function () {\r\n return new Decoder(function (json) {\r\n return typeof json === 'string'\r\n ? ok(json)\r\n : err({ message: expectedGot('a string', json) });\r\n });\r\n };\r\n /**\r\n * Decoder primitive that validates numbers, and fails on all other input.\r\n */\r\n Decoder.number = function () {\r\n return new Decoder(function (json) {\r\n return typeof json === 'number'\r\n ? ok(json)\r\n : err({ message: expectedGot('a number', json) });\r\n });\r\n };\r\n /**\r\n * Decoder primitive that validates booleans, and fails on all other input.\r\n */\r\n Decoder.boolean = function () {\r\n return new Decoder(function (json) {\r\n return typeof json === 'boolean'\r\n ? ok(json)\r\n : err({ message: expectedGot('a boolean', json) });\r\n });\r\n };\r\n Decoder.constant = function (value) {\r\n return new Decoder(function (json) {\r\n return isEqual(json, value)\r\n ? ok(value)\r\n : err({ message: \"expected \" + JSON.stringify(value) + \", got \" + JSON.stringify(json) });\r\n });\r\n };\r\n Decoder.object = function (decoders) {\r\n return new Decoder(function (json) {\r\n if (isJsonObject(json) && decoders) {\r\n var obj = {};\r\n for (var key in decoders) {\r\n if (decoders.hasOwnProperty(key)) {\r\n var r = decoders[key].decode(json[key]);\r\n if (r.ok === true) {\r\n // tslint:disable-next-line:strict-type-predicates\r\n if (r.result !== undefined) {\r\n obj[key] = r.result;\r\n }\r\n }\r\n else if (json[key] === undefined) {\r\n return err({ message: \"the key '\" + key + \"' is required but was not present\" });\r\n }\r\n else {\r\n return err(prependAt(\".\" + key, r.error));\r\n }\r\n }\r\n }\r\n return ok(obj);\r\n }\r\n else if (isJsonObject(json)) {\r\n return ok(json);\r\n }\r\n else {\r\n return err({ message: expectedGot('an object', json) });\r\n }\r\n });\r\n };\r\n Decoder.array = function (decoder) {\r\n return new Decoder(function (json) {\r\n if (isJsonArray(json) && decoder) {\r\n var decodeValue_1 = function (v, i) {\r\n return mapError(function (err$$1) { return prependAt(\"[\" + i + \"]\", err$$1); }, decoder.decode(v));\r\n };\r\n return json.reduce(function (acc, v, i) {\r\n return map2(function (arr, result) { return arr.concat([result]); }, acc, decodeValue_1(v, i));\r\n }, ok([]));\r\n }\r\n else if (isJsonArray(json)) {\r\n return ok(json);\r\n }\r\n else {\r\n return err({ message: expectedGot('an array', json) });\r\n }\r\n });\r\n };\r\n Decoder.tuple = function (decoders) {\r\n return new Decoder(function (json) {\r\n if (isJsonArray(json)) {\r\n if (json.length !== decoders.length) {\r\n return err({\r\n message: \"expected a tuple of length \" + decoders.length + \", got one of length \" + json.length\r\n });\r\n }\r\n var result = [];\r\n for (var i = 0; i < decoders.length; i++) {\r\n var nth = decoders[i].decode(json[i]);\r\n if (nth.ok) {\r\n result[i] = nth.result;\r\n }\r\n else {\r\n return err(prependAt(\"[\" + i + \"]\", nth.error));\r\n }\r\n }\r\n return ok(result);\r\n }\r\n else {\r\n return err({ message: expectedGot(\"a tuple of length \" + decoders.length, json) });\r\n }\r\n });\r\n };\r\n Decoder.union = function (ad, bd) {\r\n var decoders = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n decoders[_i - 2] = arguments[_i];\r\n }\r\n return Decoder.oneOf.apply(Decoder, [ad, bd].concat(decoders));\r\n };\r\n Decoder.intersection = function (ad, bd) {\r\n var ds = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n ds[_i - 2] = arguments[_i];\r\n }\r\n return new Decoder(function (json) {\r\n return [ad, bd].concat(ds).reduce(function (acc, decoder) { return map2(Object.assign, acc, decoder.decode(json)); }, ok({}));\r\n });\r\n };\r\n /**\r\n * Escape hatch to bypass validation. Always succeeds and types the result as\r\n * `any`. Useful for defining decoders incrementally, particularly for\r\n * complex objects.\r\n *\r\n * Example:\r\n * ```\r\n * interface User {\r\n * name: string;\r\n * complexUserData: ComplexType;\r\n * }\r\n *\r\n * const userDecoder: Decoder<User> = object({\r\n * name: string(),\r\n * complexUserData: anyJson()\r\n * });\r\n * ```\r\n */\r\n Decoder.anyJson = function () { return new Decoder(function (json) { return ok(json); }); };\r\n /**\r\n * Decoder identity function which always succeeds and types the result as\r\n * `unknown`.\r\n */\r\n Decoder.unknownJson = function () {\r\n return new Decoder(function (json) { return ok(json); });\r\n };\r\n /**\r\n * Decoder for json objects where the keys are unknown strings, but the values\r\n * should all be of the same type.\r\n *\r\n * Example:\r\n * ```\r\n * dict(number()).run({chocolate: 12, vanilla: 10, mint: 37});\r\n * // => {ok: true, result: {chocolate: 12, vanilla: 10, mint: 37}}\r\n * ```\r\n */\r\n Decoder.dict = function (decoder) {\r\n return new Decoder(function (json) {\r\n if (isJsonObject(json)) {\r\n var obj = {};\r\n for (var key in json) {\r\n if (json.hasOwnProperty(key)) {\r\n var r = decoder.decode(json[key]);\r\n if (r.ok === true) {\r\n obj[key] = r.result;\r\n }\r\n else {\r\n return err(prependAt(\".\" + key, r.error));\r\n }\r\n }\r\n }\r\n return ok(obj);\r\n }\r\n else {\r\n return err({ message: expectedGot('an object', json) });\r\n }\r\n });\r\n };\r\n /**\r\n * Decoder for values that may be `undefined`. This is primarily helpful for\r\n * decoding interfaces with optional fields.\r\n *\r\n * Example:\r\n * ```\r\n * interface User {\r\n * id: number;\r\n * isOwner?: boolean;\r\n * }\r\n *\r\n * const decoder: Decoder<User> = object({\r\n * id: number(),\r\n * isOwner: optional(boolean())\r\n * });\r\n * ```\r\n */\r\n Decoder.optional = function (decoder) {\r\n return new Decoder(function (json) { return (json === undefined || json === null ? ok(undefined) : decoder.decode(json)); });\r\n };\r\n /**\r\n * Decoder that attempts to run each decoder in `decoders` and either succeeds\r\n * with the first successful decoder, or fails after all decoders have failed.\r\n *\r\n * Note that `oneOf` expects the decoders to all have the same return type,\r\n * while `union` creates a decoder for the union type of all the input\r\n * decoders.\r\n *\r\n * Examples:\r\n * ```\r\n * oneOf(string(), number().map(String))\r\n * oneOf(constant('start'), constant('stop'), succeed('unknown'))\r\n * ```\r\n */\r\n Decoder.oneOf = function () {\r\n var decoders = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n decoders[_i] = arguments[_i];\r\n }\r\n return new Decoder(function (json) {\r\n var errors = [];\r\n for (var i = 0; i < decoders.length; i++) {\r\n var r = decoders[i].decode(json);\r\n if (r.ok === true) {\r\n return r;\r\n }\r\n else {\r\n errors[i] = r.error;\r\n }\r\n }\r\n var errorsList = errors\r\n .map(function (error) { return \"at error\" + (error.at || '') + \": \" + error.message; })\r\n .join('\", \"');\r\n return err({\r\n message: \"expected a value matching one of the decoders, got the errors [\\\"\" + errorsList + \"\\\"]\"\r\n });\r\n });\r\n };\r\n /**\r\n * Decoder that always succeeds with either the decoded value, or a fallback\r\n * default value.\r\n */\r\n Decoder.withDefault = function (defaultValue, decoder) {\r\n return new Decoder(function (json) {\r\n return ok(withDefault(defaultValue, decoder.decode(json)));\r\n });\r\n };\r\n /**\r\n * Decoder that pulls a specific field out of a json structure, instead of\r\n * decoding and returning the full structure. The `paths` array describes the\r\n * object keys and array indices to traverse, so that values can be pulled out\r\n * of a nested structure.\r\n *\r\n * Example:\r\n * ```\r\n * const decoder = valueAt(['a', 'b', 0], string());\r\n *\r\n * decoder.run({a: {b: ['surprise!']}})\r\n * // => {ok: true, result: 'surprise!'}\r\n *\r\n * decoder.run({a: {x: 'cats'}})\r\n * // => {ok: false, error: {... at: 'input.a.b[0]' message: 'path does not exist'}}\r\n * ```\r\n *\r\n * Note that the `decoder` is ran on the value found at the last key in the\r\n * path, even if the last key is not found. This allows the `optional`\r\n * decoder to succeed when appropriate.\r\n * ```\r\n * const optionalDecoder = valueAt(['a', 'b', 'c'], optional(string()));\r\n *\r\n * optionalDecoder.run({a: {b: {c: 'surprise!'}}})\r\n * // => {ok: true, result: 'surprise!'}\r\n *\r\n * optionalDecoder.run({a: {b: 'cats'}})\r\n * // => {ok: false, error: {... at: 'input.a.b.c' message: 'expected an object, got \"cats\"'}\r\n *\r\n * optionalDecoder.run({a: {b: {z: 1}}})\r\n * // => {ok: true, result: undefined}\r\n * ```\r\n */\r\n Decoder.valueAt = function (paths, decoder) {\r\n return new Decoder(function (json) {\r\n var jsonAtPath = json;\r\n for (var i = 0; i < paths.length; i++) {\r\n if (jsonAtPath === undefined) {\r\n return err({\r\n at: printPath(paths.slice(0, i + 1)),\r\n message: 'path does not exist'\r\n });\r\n }\r\n else if (typeof paths[i] === 'string' && !isJsonObject(jsonAtPath)) {\r\n return err({\r\n at: printPath(paths.slice(0, i + 1)),\r\n message: expectedGot('an object', jsonAtPath)\r\n });\r\n }\r\n else if (typeof paths[i] === 'number' && !isJsonArray(jsonAtPath)) {\r\n return err({\r\n at: printPath(paths.slice(0, i + 1)),\r\n message: expectedGot('an array', jsonAtPath)\r\n });\r\n }\r\n else {\r\n jsonAtPath = jsonAtPath[paths[i]];\r\n }\r\n }\r\n return mapError(function (error) {\r\n return jsonAtPath === undefined\r\n ? { at: printPath(paths), message: 'path does not exist' }\r\n : prependAt(printPath(paths), error);\r\n }, decoder.decode(jsonAtPath));\r\n });\r\n };\r\n /**\r\n * Decoder that ignores the input json and always succeeds with `fixedValue`.\r\n */\r\n Decoder.succeed = function (fixedValue) {\r\n return new Decoder(function (json) { return ok(fixedValue); });\r\n };\r\n /**\r\n * Decoder that ignores the input json and always fails with `errorMessage`.\r\n */\r\n Decoder.fail = function (errorMessage) {\r\n return new Decoder(function (json) { return err({ message: errorMessage }); });\r\n };\r\n /**\r\n * Decoder that allows for validating recursive data structures. Unlike with\r\n * functions, decoders assigned to variables can't reference themselves\r\n * before they are fully defined. We can avoid prematurely referencing the\r\n * decoder by wrapping it in a function that won't be called until use, at\r\n * which point the decoder has been defined.\r\n *\r\n * Example:\r\n * ```\r\n * interface Comment {\r\n * msg: string;\r\n * replies: Comment[];\r\n * }\r\n *\r\n * const decoder: Decoder<Comment> = object({\r\n * msg: string(),\r\n * replies: lazy(() => array(decoder))\r\n * });\r\n * ```\r\n */\r\n Decoder.lazy = function (mkDecoder) {\r\n return new Decoder(function (json) { return mkDecoder().decode(json); });\r\n };\r\n return Decoder;\r\n}());\r\n\r\n/* tslint:disable:variable-name */\r\n/** See `Decoder.string` */\r\nvar string = Decoder.string;\r\n/** See `Decoder.number` */\r\nvar number = Decoder.number;\r\n/** See `Decoder.boolean` */\r\nvar boolean = Decoder.boolean;\r\n/** See `Decoder.anyJson` */\r\nvar anyJson = Decoder.anyJson;\r\n/** See `Decoder.unknownJson` */\r\nvar unknownJson = Decoder.unknownJson;\r\n/** See `Decoder.constant` */\r\nvar constant = Decoder.constant;\r\n/** See `Decoder.object` */\r\nvar object = Decoder.object;\r\n/** See `Decoder.array` */\r\nvar array = Decoder.array;\r\n/** See `Decoder.tuple` */\r\nvar tuple = Decoder.tuple;\r\n/** See `Decoder.dict` */\r\nvar dict = Decoder.dict;\r\n/** See `Decoder.optional` */\r\nvar optional = Decoder.optional;\r\n/** See `Decoder.oneOf` */\r\nvar oneOf = Decoder.oneOf;\r\n/** See `Decoder.union` */\r\nvar union = Decoder.union;\r\n/** See `Decoder.intersection` */\r\nvar intersection = Decoder.intersection;\r\n/** See `Decoder.withDefault` */\r\nvar withDefault$1 = Decoder.withDefault;\r\n/** See `Decoder.valueAt` */\r\nvar valueAt = Decoder.valueAt;\r\n/** See `Decoder.succeed` */\r\nvar succeed = Decoder.succeed;\r\n/** See `Decoder.fail` */\r\nvar fail = Decoder.fail;\r\n/** See `Decoder.lazy` */\r\nvar lazy = Decoder.lazy;\r\n\r\nexport { result as Result, Decoder, isDecoderError, string, number, boolean, anyJson, unknownJson, constant, object, array, tuple, dict, optional, oneOf, union, intersection, withDefault$1 as withDefault, valueAt, succeed, fail, lazy };\r\n//# sourceMappingURL=index.es5.js.map\r\n",null,null,"\"use strict\";\nfunction createRegistry(options) {\n if (options && options.errorHandling\n && typeof options.errorHandling !== \"function\"\n && options.errorHandling !== \"log\"\n && options.errorHandling !== \"silent\"\n && options.errorHandling !== \"throw\") {\n throw new Error(\"Invalid options passed to createRegistry. Prop errorHandling should be [\\\"log\\\" | \\\"silent\\\" | \\\"throw\\\" | (err) => void], but \" + typeof options.errorHandling + \" was passed\");\n }\n var _userErrorHandler = options && typeof options.errorHandling === \"function\" && options.errorHandling;\n var callbacks = {};\n function add(key, callback, replayArgumentsArr) {\n var callbacksForKey = callbacks[key];\n if (!callbacksForKey) {\n callbacksForKey = [];\n callbacks[key] = callbacksForKey;\n }\n callbacksForKey.push(callback);\n if (replayArgumentsArr) {\n setTimeout(function () {\n replayArgumentsArr.forEach(function (replayArgument) {\n var _a;\n if ((_a = callbacks[key]) === null || _a === void 0 ? void 0 : _a.includes(callback)) {\n try {\n if (Array.isArray(replayArgument)) {\n callback.apply(undefined, replayArgument);\n }\n else {\n callback.apply(undefined, [replayArgument]);\n }\n }\n catch (err) {\n _handleError(err, key);\n }\n }\n });\n }, 0);\n }\n return function () {\n var allForKey = callbacks[key];\n if (!allForKey) {\n return;\n }\n allForKey = allForKey.reduce(function (acc, element, index) {\n if (!(element === callback && acc.length === index)) {\n acc.push(element);\n }\n return acc;\n }, []);\n if (allForKey.length === 0) {\n delete callbacks[key];\n }\n else {\n callbacks[key] = allForKey;\n }\n };\n }\n function execute(key) {\n var argumentsArr = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n argumentsArr[_i - 1] = arguments[_i];\n }\n var callbacksForKey = callbacks[key];\n if (!callbacksForKey || callbacksForKey.length === 0) {\n return [];\n }\n var results = [];\n callbacksForKey.forEach(function (callback) {\n try {\n var result = callback.apply(undefined, argumentsArr);\n results.push(result);\n }\n catch (err) {\n results.push(undefined);\n _handleError(err, key);\n }\n });\n return results;\n }\n function _handleError(exceptionArtifact, key) {\n var errParam = exceptionArtifact instanceof Error ? exceptionArtifact : new Error(exceptionArtifact);\n if (_userErrorHandler) {\n _userErrorHandler(errParam);\n return;\n }\n var msg = \"[ERROR] callback-registry: User callback for key \\\"\" + key + \"\\\" failed: \" + errParam.stack;\n if (options) {\n switch (options.errorHandling) {\n case \"log\":\n return console.error(msg);\n case \"silent\":\n return;\n case \"throw\":\n throw new Error(msg);\n }\n }\n console.error(msg);\n }\n function clear() {\n callbacks = {};\n }\n function clearKey(key) {\n var callbacksForKey = callbacks[key];\n if (!callbacksForKey) {\n return;\n }\n delete callbacks[key];\n }\n return {\n add: add,\n execute: execute,\n clear: clear,\n clearKey: clearKey\n };\n}\n;\ncreateRegistry.default = createRegistry;\nmodule.exports = createRegistry;\n//# sourceMappingURL=index.js.map",null,null,null,null,null,null],"names":[],"mappings":";;;;;;IA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0 +1,2 @@
|
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):((e="undefined"!=typeof globalThis?globalThis:e||self).iframes=e.iframes||{},e.iframes.min=r())}(this,function(){"use strict";var e=function(e){return{ok:!0,result:e}},r=function(e){return{ok:!1,error:e}},n=function(r,n,t){return!1===n.ok?n:!1===t.ok?t:e(r(n.result,t.result))},t=function(e,n){return!0===n.ok?n:r(e(n.error))},o=function(){return o=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},o.apply(this,arguments)};function i(e,r){if(e===r)return!0;if(null===e&&null===r)return!0;if(typeof e!=typeof r)return!1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(r))return!1;if(e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!i(e[n],r[n]))return!1;return!0}var t=Object.keys(e);if(t.length!==Object.keys(r).length)return!1;for(n=0;n<t.length;n++){if(!r.hasOwnProperty(t[n]))return!1;if(!i(e[t[n]],r[t[n]]))return!1}return!0}}var a=function(e){return Array.isArray(e)},s=function(e){return"object"==typeof e&&null!==e&&!a(e)},u=function(e,r){return"expected "+e+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}}(r)},c=function(e){return e.map(function(e){return"string"==typeof e?"."+e:"["+e+"]"}).join("")},l=function(e,r){var n=r.at,t=function(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(n[t[o]]=e[t[o]])}return n}(r,["at"]);return o({at:e+(n||"")},t)},d=function(){function o(r){var n=this;this.decode=r,this.run=function(e){return t(function(r){return{kind:"DecoderError",input:e,at:"input"+(r.at||""),message:r.message||""}},n.decode(e))},this.runPromise=function(e){return!0===(r=n.run(e)).ok?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(e){return function(e){if(!0===e.ok)return e.result;throw e.error}(n.run(e))},this.map=function(r){return new o(function(t){return function(r,n){return!0===n.ok?e(r(n.result)):n}(r,n.decode(t))})},this.andThen=function(e){return new o(function(r){return function(e,r){return!0===r.ok?e(r.result):r}(function(n){return e(n).decode(r)},n.decode(r))})},this.where=function(e,r){return n.andThen(function(n){return e(n)?o.succeed(n):o.fail(r)})}}return o.string=function(){return new o(function(n){return"string"==typeof n?e(n):r({message:u("a string",n)})})},o.number=function(){return new o(function(n){return"number"==typeof n?e(n):r({message:u("a number",n)})})},o.boolean=function(){return new o(function(n){return"boolean"==typeof n?e(n):r({message:u("a boolean",n)})})},o.constant=function(n){return new o(function(t){return i(t,n)?e(n):r({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(t)})})},o.object=function(n){return new o(function(t){if(s(t)&&n){var o={};for(var i in n)if(n.hasOwnProperty(i)){var a=n[i].decode(t[i]);if(!0!==a.ok)return void 0===t[i]?r({message:"the key '"+i+"' is required but was not present"}):r(l("."+i,a.error));void 0!==a.result&&(o[i]=a.result)}return e(o)}return s(t)?e(t):r({message:u("an object",t)})})},o.array=function(i){return new o(function(o){if(a(o)&&i){return o.reduce(function(e,r,o){return n(function(e,r){return e.concat([r])},e,function(e,r){return t(function(e){return l("["+r+"]",e)},i.decode(e))}(r,o))},e([]))}return a(o)?e(o):r({message:u("an array",o)})})},o.tuple=function(n){return new o(function(t){if(a(t)){if(t.length!==n.length)return r({message:"expected a tuple of length "+n.length+", got one of length "+t.length});for(var o=[],i=0;i<n.length;i++){var s=n[i].decode(t[i]);if(!s.ok)return r(l("["+i+"]",s.error));o[i]=s.result}return e(o)}return r({message:u("a tuple of length "+n.length,t)})})},o.union=function(e,r){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];return o.oneOf.apply(o,[e,r].concat(n))},o.intersection=function(r,t){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return new o(function(o){return[r,t].concat(i).reduce(function(e,r){return n(Object.assign,e,r.decode(o))},e({}))})},o.anyJson=function(){return new o(function(r){return e(r)})},o.unknownJson=function(){return new o(function(r){return e(r)})},o.dict=function(n){return new o(function(t){if(s(t)){var o={};for(var i in t)if(t.hasOwnProperty(i)){var a=n.decode(t[i]);if(!0!==a.ok)return r(l("."+i,a.error));o[i]=a.result}return e(o)}return r({message:u("an object",t)})})},o.optional=function(r){return new o(function(n){return null==n?e(void 0):r.decode(n)})},o.oneOf=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new o(function(n){for(var t=[],o=0;o<e.length;o++){var i=e[o].decode(n);if(!0===i.ok)return i;t[o]=i.error}var a=t.map(function(e){return"at error"+(e.at||"")+": "+e.message}).join('", "');return r({message:'expected a value matching one of the decoders, got the errors ["'+a+'"]'})})},o.withDefault=function(r,n){return new o(function(t){return e(function(e,r){return!0===r.ok?r.result:e}(r,n.decode(t)))})},o.valueAt=function(e,n){return new o(function(o){for(var i=o,d=0;d<e.length;d++){if(void 0===i)return r({at:c(e.slice(0,d+1)),message:"path does not exist"});if("string"==typeof e[d]&&!s(i))return r({at:c(e.slice(0,d+1)),message:u("an object",i)});if("number"==typeof e[d]&&!a(i))return r({at:c(e.slice(0,d+1)),message:u("an array",i)});i=i[e[d]]}return t(function(r){return void 0===i?{at:c(e),message:"path does not exist"}:l(c(e),r)},n.decode(i))})},o.succeed=function(r){return new o(function(n){return e(r)})},o.fail=function(e){return new o(function(n){return r({message:e})})},o.lazy=function(e){return new o(function(r){return e().decode(r)})},o}(),f=d.string;d.number;var p=d.boolean,h=d.anyJson;d.unknownJson;var m=d.constant,g=d.object;d.array,d.tuple,d.dict;var y=d.optional,w=d.oneOf;d.union,d.intersection,d.withDefault,d.valueAt,d.succeed,d.fail,d.lazy;const v=f().where(e=>e.length>0,"Expected a non-empty string"),b=g({operation:v}),I=g({isSupported:p()}),O=g({windowId:v}),C=w(m("operationCheck"),m("reserveStandaloneIFrameApp"),m("registerStandaloneIFrameApp"),m("unregisterStandaloneIFrameApp"),m("closeRequested")),A=g({appName:v,channelId:y(v),context:y(h()),waitForAGMReady:y(p())}),x=g({appName:v,waitForAGMReady:p()}),k=g({instanceId:v,url:v}),E=g({channelId:y(v),context:y(h()),instanceId:v,name:v,parentId:v});class S{io;constructor(e){this.io=e}getMyInstanceId(){return this.io.interop.instance.instance}async initiate(e){await this.io.interop.registerAsync("T42.IFrames.Control",(r,n,t,o)=>{e(r).then(e=>t(e)).catch(e=>o(e))})}async send(e,r,n,t){if(e.dataDecoder)try{e.dataDecoder.runWithException(r)}catch(r){throw new Error(`Unexpected Web->Platform outgoing validation error: ${r.message}, for operation: ${e.name} and input: ${JSON.stringify(r.input)}`)}if(!(!t?.includeOperationCheck||(await this.checkOperationSupported(e)).isSupported))throw new Error(`Cannot complete operation: ${e.name} because this client is connected to a platform which does not support it`);const o=await this.transmitMessage(e,r,n);if(e.resultDecoder)try{e.resultDecoder.runWithException(o)}catch(r){throw new Error(`Unexpected Web<-Platform incoming validation error: ${r.message}, for operation: ${e.name} and input: ${JSON.stringify(r.input)}`)}return o}async checkOperationSupported(e){try{return await this.send({name:"operationCheck",dataDecoder:b,resultDecoder:I},{operation:e.name})}catch{return{isSupported:!1}}}async transmitMessage(e,r,n){const t=(window.glue42core||window.iobrowser).communicationId,o={domain:"iframes",data:r,operation:e.name};let i;const a=`Internal Platform Communication Error. Attempted operation: ${JSON.stringify(e.name)} with data: ${JSON.stringify(r)}. `;try{if(i=await this.io.interop.invoke("T42.Web.Platform.Control",o,t?{instance:t}:void 0,n),!i)throw new Error("Received unsupported result from the platform - empty result");if(!Array.isArray(i.all_return_values)||0===i.all_return_values.length)throw new Error("Received unsupported result from the platform - empty values collection")}catch(e){if(e?.all_errors?.length){const r=e.all_errors[0].message;throw new Error(`${a} -> Inner message: ${r}`)}throw new Error(`${a} -> Inner message: ${e.message}`)}return i.all_return_values[0].returned}}function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function j(e){if(e&&e.errorHandling&&"function"!=typeof e.errorHandling&&"log"!==e.errorHandling&&"silent"!==e.errorHandling&&"throw"!==e.errorHandling)throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof e.errorHandling+" was passed");var r=e&&"function"==typeof e.errorHandling&&e.errorHandling,n={};function t(n,t){var o=n instanceof Error?n:new Error(n);if(r)r(o);else{var i='[ERROR] callback-registry: User callback for key "'+t+'" failed: '+o.stack;if(e)switch(e.errorHandling){case"log":return console.error(i);case"silent":return;case"throw":throw new Error(i)}console.error(i)}}return{add:function(e,r,o){var i=n[e];return i||(i=[],n[e]=i),i.push(r),o&&setTimeout(function(){o.forEach(function(o){var i;if(null===(i=n[e])||void 0===i?void 0:i.includes(r))try{Array.isArray(o)?r.apply(void 0,o):r.apply(void 0,[o])}catch(r){t(r,e)}})},0),function(){var t=n[e];t&&(0===(t=t.reduce(function(e,n,t){return n===r&&e.length===t||e.push(n),e},[])).length?delete n[e]:n[e]=t)}},execute:function(e){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];var i=n[e];if(!i||0===i.length)return[];var a=[];return i.forEach(function(n){try{var o=n.apply(void 0,r);a.push(o)}catch(r){a.push(void 0),t(r,e)}}),a},clear:function(){n={}},clearKey:function(e){n[e]&&delete n[e]}}}j.default=j;var R=F(j);const P={operationCheck:{name:"operationCheck",dataDecoder:b,resultDecoder:I},reserveStandaloneIFrameApp:{name:"reserveStandaloneIFrameApp",dataDecoder:x,resultDecoder:k},registerStandaloneIFrameApp:{name:"registerStandaloneIFrameApp",dataDecoder:E},unregisterStandaloneIFrameApp:{name:"unregisterStandaloneIFrameApp",dataDecoder:O},closeRequested:{name:"closeRequested",dataDecoder:O}};class ${bridge;registry=R();instances=new Map;pendingCloseResolvers=new Map;supportedOperationsNames=[];confirmFrameClosedTimeoutMs=15e3;constructor(e){this.bridge=e,this.addOperationsExecutors()}exposeApi(e){const r={openApp:this.openApp.bind(this),onCloseRequested:this.onCloseRequested.bind(this),confirmFrameClosed:this.confirmFrameClosed.bind(this),version:e};return Object.freeze(r)}async handleControlMessage(e){const r=C.runWithException(e.operation),n=P[r];if(!n.execute)return;let t=e.data;return n.dataDecoder&&(t=n.dataDecoder.runWithException(e.data)),n.execute(t)}addOperationsExecutors(){P.operationCheck.execute=async e=>{return r=this.supportedOperationsNames,n=e.operation,{isSupported:r.some(e=>e.toLowerCase()===n.toLowerCase())};var r,n},P.closeRequested.execute=this.handleCloseRequested.bind(this),this.supportedOperationsNames=(e=>Object.keys(e).filter(r=>e[r].execute))(P)}async openApp(e){const{appName:r,channelId:n,context:t,waitForAGMReady:o=!0}=A.runWithException(e),{instanceId:i,url:a}=await this.reserveStandaloneIFrameApp({appName:r,waitForAGMReady:o}),s=this.bridge.getMyInstanceId(),u=this.generateIframeElement(a,i);document.body.appendChild(u);try{await this.registerStandaloneIFrameApp({channelId:n,context:t,instanceId:i,name:`${r}_${i}`,parentId:s})}catch(e){throw u.remove(),e}const c=Object.freeze({appName:r,id:i,iframe:u,parentId:s});return this.instances.set(i,c),c}generateIframeElement(e,r){const n=document.createElement("iframe");return n.name=`${r}#wsp`,n.id=r,n.src=e,n.style.position="absolute",n.style.top="30000px",n.style.left="30000px",n.style.width="0px",n.style.height="0px",n}async reserveStandaloneIFrameApp(e){return this.bridge.send(P.reserveStandaloneIFrameApp,e,void 0,{includeOperationCheck:!0})}async registerStandaloneIFrameApp(e){await this.bridge.send(P.registerStandaloneIFrameApp,e,void 0,{includeOperationCheck:!0})}async handleCloseRequested({windowId:e}){const r=this.instances.get(e);if(!r)throw new Error(`Cannot handle close request for iframe ${e}, because no local instance was found`);const{promise:n,resolve:t}=(()=>{let e,r;return{promise:new Promise((n,t)=>{e=n,r=t}),resolve:e,reject:r}})();this.pendingCloseResolvers.set(e,t),this.registry.execute("on-close-requested",r);try{await(o=()=>n,i=this.confirmFrameClosedTimeoutMs,new Promise((e,r)=>{let n=!0;const t=setTimeout(()=>{n&&(n=!1,r(`Promise timeout hit: ${i}`))},i);o().then(r=>{n&&(n=!1,clearTimeout(t),e(r))}).catch(e=>{n&&(n=!1,clearTimeout(t),r(e))})}))}catch{throw this.pendingCloseResolvers.delete(e),new Error(`IFrame close for ${e} timed out waiting for client to be closed`)}var o,i}onCloseRequested(e){return this.registry.add("on-close-requested",e)}async confirmFrameClosed(e){const r=this.pendingCloseResolvers.get(e),n=this.instances.get(e);if(!n)return this.pendingCloseResolvers.delete(e),void r?.();n.iframe.remove(),await this.bridge.send(P.unregisterStandaloneIFrameApp,{windowId:e},void 0,{includeOperationCheck:!0}),this.instances.delete(e),this.pendingCloseResolvers.delete(e),r?.()}}class _{io;_bridge;_iframesController;constructor(e){this.io=e}get bridge(){return this._bridge||(this._bridge=new S(this.io)),this._bridge}get iframesController(){return this._iframesController||(this._iframesController=new $(this.bridge)),this._iframesController}}const D=async e=>{const r=new _(e);await r.bridge.initiate(r.iframesController.handleControlMessage.bind(r.iframesController)),e.iframes=r.iframesController.exposeApi("0.1.0-beta.0")};return"undefined"!=typeof window&&(window.IOIFrames=D),D});
|
|
2
|
+
//# sourceMappingURL=iframes.umd.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iframes.umd.min.js","sources":["../../../node_modules/decoder-validate/dist/index.es5.js","../src/shared/decoders.ts","../src/communication/bridge.ts","../src/shared/constants.ts","../../../node_modules/callback-registry/lib/index.js","../src/shared/utils.ts","../src/iframes/protocol.ts","../src/iframes/controller.ts","../src/shared/ioc.ts","../src/main.ts","../src/index.ts"],"sourcesContent":["/**\r\n * Wraps values in an `Ok` type.\r\n *\r\n * Example: `ok(5) // => {ok: true, result: 5}`\r\n */\r\nvar ok = function (result) { return ({ ok: true, result: result }); };\r\n/**\r\n * Typeguard for `Ok`.\r\n */\r\nvar isOk = function (r) { return r.ok === true; };\r\n/**\r\n * Wraps errors in an `Err` type.\r\n *\r\n * Example: `err('on fire') // => {ok: false, error: 'on fire'}`\r\n */\r\nvar err = function (error) { return ({ ok: false, error: error }); };\r\n/**\r\n * Typeguard for `Err`.\r\n */\r\nvar isErr = function (r) { return r.ok === false; };\r\n/**\r\n * Create a `Promise` that either resolves with the result of `Ok` or rejects\r\n * with the error of `Err`.\r\n */\r\nvar asPromise = function (r) {\r\n return r.ok === true ? Promise.resolve(r.result) : Promise.reject(r.error);\r\n};\r\n/**\r\n * Unwraps a `Result` and returns either the result of an `Ok`, or\r\n * `defaultValue`.\r\n *\r\n * Example:\r\n * ```\r\n * Result.withDefault(5, number().run(json))\r\n * ```\r\n *\r\n * It would be nice if `Decoder` had an instance method that mirrored this\r\n * function. Such a method would look something like this:\r\n * ```\r\n * class Decoder<A> {\r\n * runWithDefault = (defaultValue: A, json: any): A =>\r\n * Result.withDefault(defaultValue, this.run(json));\r\n * }\r\n *\r\n * number().runWithDefault(5, json)\r\n * ```\r\n * Unfortunately, the type of `defaultValue: A` on the method causes issues\r\n * with type inference on the `object` decoder in some situations. While these\r\n * inference issues can be solved by providing the optional type argument for\r\n * `object`s, the extra trouble and confusion doesn't seem worth it.\r\n */\r\nvar withDefault = function (defaultValue, r) {\r\n return r.ok === true ? r.result : defaultValue;\r\n};\r\n/**\r\n * Return the successful result, or throw an error.\r\n */\r\nvar withException = function (r) {\r\n if (r.ok === true) {\r\n return r.result;\r\n }\r\n else {\r\n throw r.error;\r\n }\r\n};\r\n/**\r\n * Given an array of `Result`s, return the successful values.\r\n */\r\nvar successes = function (results) {\r\n return results.reduce(function (acc, r) { return (r.ok === true ? acc.concat(r.result) : acc); }, []);\r\n};\r\n/**\r\n * Apply `f` to the result of an `Ok`, or pass the error through.\r\n */\r\nvar map = function (f, r) {\r\n return r.ok === true ? ok(f(r.result)) : r;\r\n};\r\n/**\r\n * Apply `f` to the result of two `Ok`s, or pass an error through. If both\r\n * `Result`s are errors then the first one is returned.\r\n */\r\nvar map2 = function (f, ar, br) {\r\n return ar.ok === false ? ar :\r\n br.ok === false ? br :\r\n ok(f(ar.result, br.result));\r\n};\r\n/**\r\n * Apply `f` to the error of an `Err`, or pass the success through.\r\n */\r\nvar mapError = function (f, r) {\r\n return r.ok === true ? r : err(f(r.error));\r\n};\r\n/**\r\n * Chain together a sequence of computations that may fail, similar to a\r\n * `Promise`. If the first computation fails then the error will propagate\r\n * through. If it succeeds, then `f` will be applied to the value, returning a\r\n * new `Result`.\r\n */\r\nvar andThen = function (f, r) {\r\n return r.ok === true ? f(r.result) : r;\r\n};\r\n\r\n\r\nvar result = Object.freeze({\r\n\tok: ok,\r\n\tisOk: isOk,\r\n\terr: err,\r\n\tisErr: isErr,\r\n\tasPromise: asPromise,\r\n\twithDefault: withDefault,\r\n\twithException: withException,\r\n\tsuccesses: successes,\r\n\tmap: map,\r\n\tmap2: map2,\r\n\tmapError: mapError,\r\n\tandThen: andThen\r\n});\r\n\r\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\n\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction isEqual(a, b) {\r\n if (a === b) {\r\n return true;\r\n }\r\n if (a === null && b === null) {\r\n return true;\r\n }\r\n if (typeof (a) !== typeof (b)) {\r\n return false;\r\n }\r\n if (typeof (a) === 'object') {\r\n // Array\r\n if (Array.isArray(a)) {\r\n if (!Array.isArray(b)) {\r\n return false;\r\n }\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < a.length; i++) {\r\n if (!isEqual(a[i], b[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n // Hash table\r\n var keys = Object.keys(a);\r\n if (keys.length !== Object.keys(b).length) {\r\n return false;\r\n }\r\n for (var i = 0; i < keys.length; i++) {\r\n if (!b.hasOwnProperty(keys[i])) {\r\n return false;\r\n }\r\n if (!isEqual(a[keys[i]], b[keys[i]])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\n/**\r\n * Type guard for `DecoderError`. One use case of the type guard is in the\r\n * `catch` of a promise. Typescript types the error argument of `catch` as\r\n * `any`, so when dealing with a decoder as a promise you may need to\r\n * distinguish between a `DecoderError` and an error string.\r\n */\r\nvar isDecoderError = function (a) {\r\n return a.kind === 'DecoderError' && typeof a.at === 'string' && typeof a.message === 'string';\r\n};\r\n/*\r\n * Helpers\r\n */\r\nvar isJsonArray = function (json) { return Array.isArray(json); };\r\nvar isJsonObject = function (json) {\r\n return typeof json === 'object' && json !== null && !isJsonArray(json);\r\n};\r\nvar typeString = function (json) {\r\n switch (typeof json) {\r\n case 'string':\r\n return 'a string';\r\n case 'number':\r\n return 'a number';\r\n case 'boolean':\r\n return 'a boolean';\r\n case 'undefined':\r\n return 'undefined';\r\n case 'object':\r\n if (json instanceof Array) {\r\n return 'an array';\r\n }\r\n else if (json === null) {\r\n return 'null';\r\n }\r\n else {\r\n return 'an object';\r\n }\r\n default:\r\n return JSON.stringify(json);\r\n }\r\n};\r\nvar expectedGot = function (expected, got) {\r\n return \"expected \" + expected + \", got \" + typeString(got);\r\n};\r\nvar printPath = function (paths) {\r\n return paths.map(function (path) { return (typeof path === 'string' ? \".\" + path : \"[\" + path + \"]\"); }).join('');\r\n};\r\nvar prependAt = function (newAt, _a) {\r\n var at = _a.at, rest = __rest(_a, [\"at\"]);\r\n return (__assign({ at: newAt + (at || '') }, rest));\r\n};\r\n/**\r\n * Decoders transform json objects with unknown structure into known and\r\n * verified forms. You can create objects of type `Decoder<A>` with either the\r\n * primitive decoder functions, such as `boolean()` and `string()`, or by\r\n * applying higher-order decoders to the primitives, such as `array(boolean())`\r\n * or `dict(string())`.\r\n *\r\n * Each of the decoder functions are available both as a static method on\r\n * `Decoder` and as a function alias -- for example the string decoder is\r\n * defined at `Decoder.string()`, but is also aliased to `string()`. Using the\r\n * function aliases exported with the library is recommended.\r\n *\r\n * `Decoder` exposes a number of 'run' methods, which all decode json in the\r\n * same way, but communicate success and failure in different ways. The `map`\r\n * and `andThen` methods modify decoders without having to call a 'run' method.\r\n *\r\n * Alternatively, the main decoder `run()` method returns an object of type\r\n * `Result<A, DecoderError>`. This library provides a number of helper\r\n * functions for dealing with the `Result` type, so you can do all the same\r\n * things with a `Result` as with the decoder methods.\r\n */\r\nvar Decoder = /** @class */ (function () {\r\n /**\r\n * The Decoder class constructor is kept private to separate the internal\r\n * `decode` function from the external `run` function. The distinction\r\n * between the two functions is that `decode` returns a\r\n * `Partial<DecoderError>` on failure, which contains an unfinished error\r\n * report. When `run` is called on a decoder, the relevant series of `decode`\r\n * calls is made, and then on failure the resulting `Partial<DecoderError>`\r\n * is turned into a `DecoderError` by filling in the missing information.\r\n *\r\n * While hiding the constructor may seem restrictive, leveraging the\r\n * provided decoder combinators and helper functions such as\r\n * `andThen` and `map` should be enough to build specialized decoders as\r\n * needed.\r\n */\r\n function Decoder(decode) {\r\n var _this = this;\r\n this.decode = decode;\r\n /**\r\n * Run the decoder and return a `Result` with either the decoded value or a\r\n * `DecoderError` containing the json input, the location of the error, and\r\n * the error message.\r\n *\r\n * Examples:\r\n * ```\r\n * number().run(12)\r\n * // => {ok: true, result: 12}\r\n *\r\n * string().run(9001)\r\n * // =>\r\n * // {\r\n * // ok: false,\r\n * // error: {\r\n * // kind: 'DecoderError',\r\n * // input: 9001,\r\n * // at: 'input',\r\n * // message: 'expected a string, got 9001'\r\n * // }\r\n * // }\r\n * ```\r\n */\r\n this.run = function (json) {\r\n return mapError(function (error) { return ({\r\n kind: 'DecoderError',\r\n input: json,\r\n at: 'input' + (error.at || ''),\r\n message: error.message || ''\r\n }); }, _this.decode(json));\r\n };\r\n /**\r\n * Run the decoder as a `Promise`.\r\n */\r\n this.runPromise = function (json) { return asPromise(_this.run(json)); };\r\n /**\r\n * Run the decoder and return the value on success, or throw an exception\r\n * with a formatted error string.\r\n */\r\n this.runWithException = function (json) { return withException(_this.run(json)); };\r\n /**\r\n * Construct a new decoder that applies a transformation to the decoded\r\n * result. If the decoder succeeds then `f` will be applied to the value. If\r\n * it fails the error will propagated through.\r\n *\r\n * Example:\r\n * ```\r\n * number().map(x => x * 5).run(10)\r\n * // => {ok: true, result: 50}\r\n * ```\r\n */\r\n this.map = function (f) {\r\n return new Decoder(function (json) { return map(f, _this.decode(json)); });\r\n };\r\n /**\r\n * Chain together a sequence of decoders. The first decoder will run, and\r\n * then the function will determine what decoder to run second. If the result\r\n * of the first decoder succeeds then `f` will be applied to the decoded\r\n * value. If it fails the error will propagate through.\r\n *\r\n * This is a very powerful method -- it can act as both the `map` and `where`\r\n * methods, can improve error messages for edge cases, and can be used to\r\n * make a decoder for custom types.\r\n *\r\n * Example of adding an error message:\r\n * ```\r\n * const versionDecoder = valueAt(['version'], number());\r\n * const infoDecoder3 = object({a: boolean()});\r\n *\r\n * const decoder = versionDecoder.andThen(version => {\r\n * switch (version) {\r\n * case 3:\r\n * return infoDecoder3;\r\n * default:\r\n * return fail(`Unable to decode info, version ${version} is not supported.`);\r\n * }\r\n * });\r\n *\r\n * decoder.run({version: 3, a: true})\r\n * // => {ok: true, result: {a: true}}\r\n *\r\n * decoder.run({version: 5, x: 'abc'})\r\n * // =>\r\n * // {\r\n * // ok: false,\r\n * // error: {... message: 'Unable to decode info, version 5 is not supported.'}\r\n * // }\r\n * ```\r\n *\r\n * Example of decoding a custom type:\r\n * ```\r\n * // nominal type for arrays with a length of at least one\r\n * type NonEmptyArray<T> = T[] & { __nonEmptyArrayBrand__: void };\r\n *\r\n * const nonEmptyArrayDecoder = <T>(values: Decoder<T>): Decoder<NonEmptyArray<T>> =>\r\n * array(values).andThen(arr =>\r\n * arr.length > 0\r\n * ? succeed(createNonEmptyArray(arr))\r\n * : fail(`expected a non-empty array, got an empty array`)\r\n * );\r\n * ```\r\n */\r\n this.andThen = function (f) {\r\n return new Decoder(function (json) {\r\n return andThen(function (value) { return f(value).decode(json); }, _this.decode(json));\r\n });\r\n };\r\n /**\r\n * Add constraints to a decoder _without_ changing the resulting type. The\r\n * `test` argument is a predicate function which returns true for valid\r\n * inputs. When `test` fails on an input, the decoder fails with the given\r\n * `errorMessage`.\r\n *\r\n * ```\r\n * const chars = (length: number): Decoder<string> =>\r\n * string().where(\r\n * (s: string) => s.length === length,\r\n * `expected a string of length ${length}`\r\n * );\r\n *\r\n * chars(5).run('12345')\r\n * // => {ok: true, result: '12345'}\r\n *\r\n * chars(2).run('HELLO')\r\n * // => {ok: false, error: {... message: 'expected a string of length 2'}}\r\n *\r\n * chars(12).run(true)\r\n * // => {ok: false, error: {... message: 'expected a string, got a boolean'}}\r\n * ```\r\n */\r\n this.where = function (test, errorMessage) {\r\n return _this.andThen(function (value) { return (test(value) ? Decoder.succeed(value) : Decoder.fail(errorMessage)); });\r\n };\r\n }\r\n /**\r\n * Decoder primitive that validates strings, and fails on all other input.\r\n */\r\n Decoder.string = function () {\r\n return new Decoder(function (json) {\r\n return typeof json === 'string'\r\n ? ok(json)\r\n : err({ message: expectedGot('a string', json) });\r\n });\r\n };\r\n /**\r\n * Decoder primitive that validates numbers, and fails on all other input.\r\n */\r\n Decoder.number = function () {\r\n return new Decoder(function (json) {\r\n return typeof json === 'number'\r\n ? ok(json)\r\n : err({ message: expectedGot('a number', json) });\r\n });\r\n };\r\n /**\r\n * Decoder primitive that validates booleans, and fails on all other input.\r\n */\r\n Decoder.boolean = function () {\r\n return new Decoder(function (json) {\r\n return typeof json === 'boolean'\r\n ? ok(json)\r\n : err({ message: expectedGot('a boolean', json) });\r\n });\r\n };\r\n Decoder.constant = function (value) {\r\n return new Decoder(function (json) {\r\n return isEqual(json, value)\r\n ? ok(value)\r\n : err({ message: \"expected \" + JSON.stringify(value) + \", got \" + JSON.stringify(json) });\r\n });\r\n };\r\n Decoder.object = function (decoders) {\r\n return new Decoder(function (json) {\r\n if (isJsonObject(json) && decoders) {\r\n var obj = {};\r\n for (var key in decoders) {\r\n if (decoders.hasOwnProperty(key)) {\r\n var r = decoders[key].decode(json[key]);\r\n if (r.ok === true) {\r\n // tslint:disable-next-line:strict-type-predicates\r\n if (r.result !== undefined) {\r\n obj[key] = r.result;\r\n }\r\n }\r\n else if (json[key] === undefined) {\r\n return err({ message: \"the key '\" + key + \"' is required but was not present\" });\r\n }\r\n else {\r\n return err(prependAt(\".\" + key, r.error));\r\n }\r\n }\r\n }\r\n return ok(obj);\r\n }\r\n else if (isJsonObject(json)) {\r\n return ok(json);\r\n }\r\n else {\r\n return err({ message: expectedGot('an object', json) });\r\n }\r\n });\r\n };\r\n Decoder.array = function (decoder) {\r\n return new Decoder(function (json) {\r\n if (isJsonArray(json) && decoder) {\r\n var decodeValue_1 = function (v, i) {\r\n return mapError(function (err$$1) { return prependAt(\"[\" + i + \"]\", err$$1); }, decoder.decode(v));\r\n };\r\n return json.reduce(function (acc, v, i) {\r\n return map2(function (arr, result) { return arr.concat([result]); }, acc, decodeValue_1(v, i));\r\n }, ok([]));\r\n }\r\n else if (isJsonArray(json)) {\r\n return ok(json);\r\n }\r\n else {\r\n return err({ message: expectedGot('an array', json) });\r\n }\r\n });\r\n };\r\n Decoder.tuple = function (decoders) {\r\n return new Decoder(function (json) {\r\n if (isJsonArray(json)) {\r\n if (json.length !== decoders.length) {\r\n return err({\r\n message: \"expected a tuple of length \" + decoders.length + \", got one of length \" + json.length\r\n });\r\n }\r\n var result = [];\r\n for (var i = 0; i < decoders.length; i++) {\r\n var nth = decoders[i].decode(json[i]);\r\n if (nth.ok) {\r\n result[i] = nth.result;\r\n }\r\n else {\r\n return err(prependAt(\"[\" + i + \"]\", nth.error));\r\n }\r\n }\r\n return ok(result);\r\n }\r\n else {\r\n return err({ message: expectedGot(\"a tuple of length \" + decoders.length, json) });\r\n }\r\n });\r\n };\r\n Decoder.union = function (ad, bd) {\r\n var decoders = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n decoders[_i - 2] = arguments[_i];\r\n }\r\n return Decoder.oneOf.apply(Decoder, [ad, bd].concat(decoders));\r\n };\r\n Decoder.intersection = function (ad, bd) {\r\n var ds = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n ds[_i - 2] = arguments[_i];\r\n }\r\n return new Decoder(function (json) {\r\n return [ad, bd].concat(ds).reduce(function (acc, decoder) { return map2(Object.assign, acc, decoder.decode(json)); }, ok({}));\r\n });\r\n };\r\n /**\r\n * Escape hatch to bypass validation. Always succeeds and types the result as\r\n * `any`. Useful for defining decoders incrementally, particularly for\r\n * complex objects.\r\n *\r\n * Example:\r\n * ```\r\n * interface User {\r\n * name: string;\r\n * complexUserData: ComplexType;\r\n * }\r\n *\r\n * const userDecoder: Decoder<User> = object({\r\n * name: string(),\r\n * complexUserData: anyJson()\r\n * });\r\n * ```\r\n */\r\n Decoder.anyJson = function () { return new Decoder(function (json) { return ok(json); }); };\r\n /**\r\n * Decoder identity function which always succeeds and types the result as\r\n * `unknown`.\r\n */\r\n Decoder.unknownJson = function () {\r\n return new Decoder(function (json) { return ok(json); });\r\n };\r\n /**\r\n * Decoder for json objects where the keys are unknown strings, but the values\r\n * should all be of the same type.\r\n *\r\n * Example:\r\n * ```\r\n * dict(number()).run({chocolate: 12, vanilla: 10, mint: 37});\r\n * // => {ok: true, result: {chocolate: 12, vanilla: 10, mint: 37}}\r\n * ```\r\n */\r\n Decoder.dict = function (decoder) {\r\n return new Decoder(function (json) {\r\n if (isJsonObject(json)) {\r\n var obj = {};\r\n for (var key in json) {\r\n if (json.hasOwnProperty(key)) {\r\n var r = decoder.decode(json[key]);\r\n if (r.ok === true) {\r\n obj[key] = r.result;\r\n }\r\n else {\r\n return err(prependAt(\".\" + key, r.error));\r\n }\r\n }\r\n }\r\n return ok(obj);\r\n }\r\n else {\r\n return err({ message: expectedGot('an object', json) });\r\n }\r\n });\r\n };\r\n /**\r\n * Decoder for values that may be `undefined`. This is primarily helpful for\r\n * decoding interfaces with optional fields.\r\n *\r\n * Example:\r\n * ```\r\n * interface User {\r\n * id: number;\r\n * isOwner?: boolean;\r\n * }\r\n *\r\n * const decoder: Decoder<User> = object({\r\n * id: number(),\r\n * isOwner: optional(boolean())\r\n * });\r\n * ```\r\n */\r\n Decoder.optional = function (decoder) {\r\n return new Decoder(function (json) { return (json === undefined || json === null ? ok(undefined) : decoder.decode(json)); });\r\n };\r\n /**\r\n * Decoder that attempts to run each decoder in `decoders` and either succeeds\r\n * with the first successful decoder, or fails after all decoders have failed.\r\n *\r\n * Note that `oneOf` expects the decoders to all have the same return type,\r\n * while `union` creates a decoder for the union type of all the input\r\n * decoders.\r\n *\r\n * Examples:\r\n * ```\r\n * oneOf(string(), number().map(String))\r\n * oneOf(constant('start'), constant('stop'), succeed('unknown'))\r\n * ```\r\n */\r\n Decoder.oneOf = function () {\r\n var decoders = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n decoders[_i] = arguments[_i];\r\n }\r\n return new Decoder(function (json) {\r\n var errors = [];\r\n for (var i = 0; i < decoders.length; i++) {\r\n var r = decoders[i].decode(json);\r\n if (r.ok === true) {\r\n return r;\r\n }\r\n else {\r\n errors[i] = r.error;\r\n }\r\n }\r\n var errorsList = errors\r\n .map(function (error) { return \"at error\" + (error.at || '') + \": \" + error.message; })\r\n .join('\", \"');\r\n return err({\r\n message: \"expected a value matching one of the decoders, got the errors [\\\"\" + errorsList + \"\\\"]\"\r\n });\r\n });\r\n };\r\n /**\r\n * Decoder that always succeeds with either the decoded value, or a fallback\r\n * default value.\r\n */\r\n Decoder.withDefault = function (defaultValue, decoder) {\r\n return new Decoder(function (json) {\r\n return ok(withDefault(defaultValue, decoder.decode(json)));\r\n });\r\n };\r\n /**\r\n * Decoder that pulls a specific field out of a json structure, instead of\r\n * decoding and returning the full structure. The `paths` array describes the\r\n * object keys and array indices to traverse, so that values can be pulled out\r\n * of a nested structure.\r\n *\r\n * Example:\r\n * ```\r\n * const decoder = valueAt(['a', 'b', 0], string());\r\n *\r\n * decoder.run({a: {b: ['surprise!']}})\r\n * // => {ok: true, result: 'surprise!'}\r\n *\r\n * decoder.run({a: {x: 'cats'}})\r\n * // => {ok: false, error: {... at: 'input.a.b[0]' message: 'path does not exist'}}\r\n * ```\r\n *\r\n * Note that the `decoder` is ran on the value found at the last key in the\r\n * path, even if the last key is not found. This allows the `optional`\r\n * decoder to succeed when appropriate.\r\n * ```\r\n * const optionalDecoder = valueAt(['a', 'b', 'c'], optional(string()));\r\n *\r\n * optionalDecoder.run({a: {b: {c: 'surprise!'}}})\r\n * // => {ok: true, result: 'surprise!'}\r\n *\r\n * optionalDecoder.run({a: {b: 'cats'}})\r\n * // => {ok: false, error: {... at: 'input.a.b.c' message: 'expected an object, got \"cats\"'}\r\n *\r\n * optionalDecoder.run({a: {b: {z: 1}}})\r\n * // => {ok: true, result: undefined}\r\n * ```\r\n */\r\n Decoder.valueAt = function (paths, decoder) {\r\n return new Decoder(function (json) {\r\n var jsonAtPath = json;\r\n for (var i = 0; i < paths.length; i++) {\r\n if (jsonAtPath === undefined) {\r\n return err({\r\n at: printPath(paths.slice(0, i + 1)),\r\n message: 'path does not exist'\r\n });\r\n }\r\n else if (typeof paths[i] === 'string' && !isJsonObject(jsonAtPath)) {\r\n return err({\r\n at: printPath(paths.slice(0, i + 1)),\r\n message: expectedGot('an object', jsonAtPath)\r\n });\r\n }\r\n else if (typeof paths[i] === 'number' && !isJsonArray(jsonAtPath)) {\r\n return err({\r\n at: printPath(paths.slice(0, i + 1)),\r\n message: expectedGot('an array', jsonAtPath)\r\n });\r\n }\r\n else {\r\n jsonAtPath = jsonAtPath[paths[i]];\r\n }\r\n }\r\n return mapError(function (error) {\r\n return jsonAtPath === undefined\r\n ? { at: printPath(paths), message: 'path does not exist' }\r\n : prependAt(printPath(paths), error);\r\n }, decoder.decode(jsonAtPath));\r\n });\r\n };\r\n /**\r\n * Decoder that ignores the input json and always succeeds with `fixedValue`.\r\n */\r\n Decoder.succeed = function (fixedValue) {\r\n return new Decoder(function (json) { return ok(fixedValue); });\r\n };\r\n /**\r\n * Decoder that ignores the input json and always fails with `errorMessage`.\r\n */\r\n Decoder.fail = function (errorMessage) {\r\n return new Decoder(function (json) { return err({ message: errorMessage }); });\r\n };\r\n /**\r\n * Decoder that allows for validating recursive data structures. Unlike with\r\n * functions, decoders assigned to variables can't reference themselves\r\n * before they are fully defined. We can avoid prematurely referencing the\r\n * decoder by wrapping it in a function that won't be called until use, at\r\n * which point the decoder has been defined.\r\n *\r\n * Example:\r\n * ```\r\n * interface Comment {\r\n * msg: string;\r\n * replies: Comment[];\r\n * }\r\n *\r\n * const decoder: Decoder<Comment> = object({\r\n * msg: string(),\r\n * replies: lazy(() => array(decoder))\r\n * });\r\n * ```\r\n */\r\n Decoder.lazy = function (mkDecoder) {\r\n return new Decoder(function (json) { return mkDecoder().decode(json); });\r\n };\r\n return Decoder;\r\n}());\r\n\r\n/* tslint:disable:variable-name */\r\n/** See `Decoder.string` */\r\nvar string = Decoder.string;\r\n/** See `Decoder.number` */\r\nvar number = Decoder.number;\r\n/** See `Decoder.boolean` */\r\nvar boolean = Decoder.boolean;\r\n/** See `Decoder.anyJson` */\r\nvar anyJson = Decoder.anyJson;\r\n/** See `Decoder.unknownJson` */\r\nvar unknownJson = Decoder.unknownJson;\r\n/** See `Decoder.constant` */\r\nvar constant = Decoder.constant;\r\n/** See `Decoder.object` */\r\nvar object = Decoder.object;\r\n/** See `Decoder.array` */\r\nvar array = Decoder.array;\r\n/** See `Decoder.tuple` */\r\nvar tuple = Decoder.tuple;\r\n/** See `Decoder.dict` */\r\nvar dict = Decoder.dict;\r\n/** See `Decoder.optional` */\r\nvar optional = Decoder.optional;\r\n/** See `Decoder.oneOf` */\r\nvar oneOf = Decoder.oneOf;\r\n/** See `Decoder.union` */\r\nvar union = Decoder.union;\r\n/** See `Decoder.intersection` */\r\nvar intersection = Decoder.intersection;\r\n/** See `Decoder.withDefault` */\r\nvar withDefault$1 = Decoder.withDefault;\r\n/** See `Decoder.valueAt` */\r\nvar valueAt = Decoder.valueAt;\r\n/** See `Decoder.succeed` */\r\nvar succeed = Decoder.succeed;\r\n/** See `Decoder.fail` */\r\nvar fail = Decoder.fail;\r\n/** See `Decoder.lazy` */\r\nvar lazy = Decoder.lazy;\r\n\r\nexport { result as Result, Decoder, isDecoderError, string, number, boolean, anyJson, unknownJson, constant, object, array, tuple, dict, optional, oneOf, union, intersection, withDefault$1 as withDefault, valueAt, succeed, fail, lazy };\r\n//# sourceMappingURL=index.es5.js.map\r\n",null,null,null,"\"use strict\";\nfunction createRegistry(options) {\n if (options && options.errorHandling\n && typeof options.errorHandling !== \"function\"\n && options.errorHandling !== \"log\"\n && options.errorHandling !== \"silent\"\n && options.errorHandling !== \"throw\") {\n throw new Error(\"Invalid options passed to createRegistry. Prop errorHandling should be [\\\"log\\\" | \\\"silent\\\" | \\\"throw\\\" | (err) => void], but \" + typeof options.errorHandling + \" was passed\");\n }\n var _userErrorHandler = options && typeof options.errorHandling === \"function\" && options.errorHandling;\n var callbacks = {};\n function add(key, callback, replayArgumentsArr) {\n var callbacksForKey = callbacks[key];\n if (!callbacksForKey) {\n callbacksForKey = [];\n callbacks[key] = callbacksForKey;\n }\n callbacksForKey.push(callback);\n if (replayArgumentsArr) {\n setTimeout(function () {\n replayArgumentsArr.forEach(function (replayArgument) {\n var _a;\n if ((_a = callbacks[key]) === null || _a === void 0 ? void 0 : _a.includes(callback)) {\n try {\n if (Array.isArray(replayArgument)) {\n callback.apply(undefined, replayArgument);\n }\n else {\n callback.apply(undefined, [replayArgument]);\n }\n }\n catch (err) {\n _handleError(err, key);\n }\n }\n });\n }, 0);\n }\n return function () {\n var allForKey = callbacks[key];\n if (!allForKey) {\n return;\n }\n allForKey = allForKey.reduce(function (acc, element, index) {\n if (!(element === callback && acc.length === index)) {\n acc.push(element);\n }\n return acc;\n }, []);\n if (allForKey.length === 0) {\n delete callbacks[key];\n }\n else {\n callbacks[key] = allForKey;\n }\n };\n }\n function execute(key) {\n var argumentsArr = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n argumentsArr[_i - 1] = arguments[_i];\n }\n var callbacksForKey = callbacks[key];\n if (!callbacksForKey || callbacksForKey.length === 0) {\n return [];\n }\n var results = [];\n callbacksForKey.forEach(function (callback) {\n try {\n var result = callback.apply(undefined, argumentsArr);\n results.push(result);\n }\n catch (err) {\n results.push(undefined);\n _handleError(err, key);\n }\n });\n return results;\n }\n function _handleError(exceptionArtifact, key) {\n var errParam = exceptionArtifact instanceof Error ? exceptionArtifact : new Error(exceptionArtifact);\n if (_userErrorHandler) {\n _userErrorHandler(errParam);\n return;\n }\n var msg = \"[ERROR] callback-registry: User callback for key \\\"\" + key + \"\\\" failed: \" + errParam.stack;\n if (options) {\n switch (options.errorHandling) {\n case \"log\":\n return console.error(msg);\n case \"silent\":\n return;\n case \"throw\":\n throw new Error(msg);\n }\n }\n console.error(msg);\n }\n function clear() {\n callbacks = {};\n }\n function clearKey(key) {\n var callbacksForKey = callbacks[key];\n if (!callbacksForKey) {\n return;\n }\n delete callbacks[key];\n }\n return {\n add: add,\n execute: execute,\n clear: clear,\n clearKey: clearKey\n };\n}\n;\ncreateRegistry.default = createRegistry;\nmodule.exports = createRegistry;\n//# sourceMappingURL=index.js.map",null,null,null,null,null,null],"names":["ok","result","err","error","map2","f","ar","br","mapError","r","__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","isEqual","a","b","Array","isArray","keys","isJsonArray","json","isJsonObject","expectedGot","expected","got","JSON","stringify","typeString","printPath","paths","map","path","join","prependAt","newAt","_a","at","rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__rest","Decoder","decode","_this","run","kind","input","message","runPromise","Promise","resolve","reject","runWithException","withException","andThen","value","where","test","errorMessage","succeed","fail","string","number","boolean","constant","object","decoders","obj","key","undefined","array","decoder","reduce","acc","v","arr","concat","err$$1","decodeValue_1","tuple","nth","union","ad","bd","_i","oneOf","intersection","ds","anyJson","unknownJson","dict","optional","errors","errorsList","withDefault","defaultValue","valueAt","jsonAtPath","slice","fixedValue","lazy","mkDecoder","nonEmptyStringDecoder","operationCheckConfigDecoder","operation","operationCheckResultDecoder","isSupported","simpleWindowDecoder","windowId","iframesOperationTypesDecoder","iframesOpenAppConfigDecoder","appName","channelId","context","waitForAGMReady","reserveStandaloneIFrameAppDataDecoder","reserveStandaloneIFrameAppResultDecoder","instanceId","url","registerStandaloneIFrameAppDataDecoder","name","parentId","Bridge","io","constructor","getMyInstanceId","interop","instance","initiate","handleControlMessage","registerAsync","args","_","success","then","catch","reason","send","operationData","options","webOptions","dataDecoder","Error","includeOperationCheck","checkOperationSupported","operationResult","transmitMessage","resultDecoder","data","platformTarget","window","glue42core","iobrowser","communicationId","messageData","domain","invocationResult","baseErrorMessage","invoke","all_return_values","all_errors","invocationErrorMessage","returned","createRegistry","errorHandling","_userErrorHandler","callbacks","_handleError","exceptionArtifact","errParam","msg","stack","console","add","callback","replayArgumentsArr","callbacksForKey","push","setTimeout","forEach","replayArgument","includes","allForKey","element","index","execute","argumentsArr","results","clear","clearKey","default","operations","operationCheck","reserveStandaloneIFrameApp","registerStandaloneIFrameApp","unregisterStandaloneIFrameApp","closeRequested","IFramesController","bridge","registry","CallbackRegistryFactory","instances","Map","pendingCloseResolvers","supportedOperationsNames","confirmFrameClosedTimeoutMs","addOperationsExecutors","exposeApi","version","api","openApp","bind","onCloseRequested","confirmFrameClosed","freeze","operationName","async","config","handleOperationCheck","supportedOperations","some","toLowerCase","handleCloseRequested","filter","getSupportedOperationsNames","iframe","generateIframeElement","document","body","appendChild","remove","id","set","createElement","src","style","position","top","left","width","height","get","promise","wrapperResolve","wrapperReject","wrapPromise","timeoutMilliseconds","promiseActive","timeout","clearTimeout","delete","IoC","_bridge","_iframesController","iframesController","factoryFunction","ioc","iframes","IOIFrames"],"mappings":"qQAKA,IAAIA,EAAK,SAAUC,GAAU,OAAUD,IAAI,EAAMC,OAAQA,EAAW,EAUhEC,EAAM,SAAUC,GAAS,OAAUH,IAAI,EAAOG,MAAOA,EAAU,EAkE/DC,EAAO,SAAUC,EAAGC,EAAIC,GACxB,OAAiB,IAAVD,EAAGN,GAAeM,GACX,IAAVC,EAAGP,GAAeO,EACdP,EAAGK,EAAEC,EAAGL,OAAQM,EAAGN,QAC/B,EAIIO,EAAW,SAAUH,EAAGI,GACxB,OAAgB,IAATA,EAAET,GAAcS,EAAIP,EA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+
export type IFramesFactoryFunction = (io: IOConnectCore.API) => Promise<void>;
|
|
5
|
+
declare const IFramesFactory: IFramesFactoryFunction;
|
|
6
|
+
export default IFramesFactory;
|
|
7
|
+
|
|
8
|
+
declare module "@interopio/core" {
|
|
9
|
+
export namespace IOConnectCore {
|
|
10
|
+
export interface API {
|
|
11
|
+
iframes: IOConnectIFrames.API;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @docname IFrames
|
|
18
|
+
* @intro
|
|
19
|
+
*/
|
|
20
|
+
export namespace IOConnectIFrames {
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
export type Unsubscribe = () => void;
|
|
26
|
+
|
|
27
|
+
export interface Instance {
|
|
28
|
+
id: string;
|
|
29
|
+
|
|
30
|
+
appName: string;
|
|
31
|
+
|
|
32
|
+
parentId: string;
|
|
33
|
+
|
|
34
|
+
iframe: HTMLIFrameElement;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface OpenAppConfig {
|
|
38
|
+
appName: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Name of the Channel which the window will join.
|
|
42
|
+
*/
|
|
43
|
+
channelId?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The initial context of the application
|
|
47
|
+
*/
|
|
48
|
+
context?: any;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* If true, will wait for the Interop library to be initialized.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
waitForAGMReady?: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* IFrames API.
|
|
59
|
+
*/
|
|
60
|
+
export interface API {
|
|
61
|
+
|
|
62
|
+
openApp(config: OpenAppConfig): Promise<Instance>;
|
|
63
|
+
|
|
64
|
+
onCloseRequested(callback: (instance: Instance) => void): Unsubscribe;
|
|
65
|
+
|
|
66
|
+
confirmFrameClosed(id: string): Promise<void>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Version of the IFrames API.
|
|
70
|
+
*/
|
|
71
|
+
version: string;
|
|
72
|
+
}
|
|
73
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@interopio/iframes-api",
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
|
+
"description": "IOConnect IFrames API",
|
|
5
|
+
"main": "dist/iframes.umd.js",
|
|
6
|
+
"module": "dist/iframes.es.js",
|
|
7
|
+
"types": "./iframes.d.ts",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"glue",
|
|
10
|
+
"glue42",
|
|
11
|
+
"desktop",
|
|
12
|
+
"iframes",
|
|
13
|
+
"interop.io",
|
|
14
|
+
"io.connect browser",
|
|
15
|
+
"io.connect desktop"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://interop.io/",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "echo no tests found",
|
|
20
|
+
"build": "rollup -c",
|
|
21
|
+
"audit": "echo no audit found",
|
|
22
|
+
"audit:V1": "node ../../scripts/audit/index.js",
|
|
23
|
+
"postversion": "npm run build"
|
|
24
|
+
},
|
|
25
|
+
"author": {
|
|
26
|
+
"name": "Interop.IO",
|
|
27
|
+
"url": "https://interop.io/"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@interopio/core": "^6.10.4"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"@interopio:registry": "https://registry.npmjs.org",
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "3d731cc0a6305927219d5f180a808da731e3e95b"
|
|
38
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# @interopio/iframes-api
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The [`@interopio/iframes-api`](https://www.npmjs.com/package/@interopio/iframes-api) library provides a convenient API for starting applications in iframes.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
To install the library, execute the following command:
|
|
10
|
+
|
|
11
|
+
```cmd
|
|
12
|
+
npm install @interopio/iframes-api
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
The following examples demonstrate basic initialization of the `@interopio/iframes-api` library in **io.Connect Browser** projects.
|
|
18
|
+
|
|
19
|
+
### io.Connect Browser
|
|
20
|
+
|
|
21
|
+
Initializing the `@interopio/iframes-api` library in the Main app of an **io.Connect Browser** project:
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
import IOBrowserPlatform from "@interopio/browser-platform";
|
|
25
|
+
import IOIFrames from "@interopio/iframes-api";
|
|
26
|
+
|
|
27
|
+
const config = {
|
|
28
|
+
licenseKey: "my-license-key",
|
|
29
|
+
browser: {
|
|
30
|
+
libraries: [IOIFrames],
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const { io } = await IOBrowserPlatform(config);
|
|
35
|
+
|
|
36
|
+
// Now you can access the IFrames API via `io.iframes`.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Initializing the `@interopio/iframes-api` library in a Browser Client app of an **io.Connect Browser** project:
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
import IOBrowser from "@interopio/browser";
|
|
43
|
+
import IOIFrames from "@interopio/iframes-api";
|
|
44
|
+
|
|
45
|
+
const config = {
|
|
46
|
+
libraries: [IOIFrames],
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const io = await IOBrowser(config);
|
|
50
|
+
|
|
51
|
+
// Now you can access the IFrames API via `io.iframes`.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Using the IFrames API
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
// STEP 1 => create a map to store iframe containers by ID
|
|
58
|
+
const iframeContainers = {};
|
|
59
|
+
|
|
60
|
+
// STEP 2 => register listener for close requests
|
|
61
|
+
// onCloseRequested can only listen for iframe instances that are inside the app that registers the listener
|
|
62
|
+
const unsubscribe = io.iframes.onCloseRequested(async ({ id }) => {
|
|
63
|
+
|
|
64
|
+
// remove the iframe container
|
|
65
|
+
iframeContainers[id]?.remove();
|
|
66
|
+
delete iframeContainers[id];
|
|
67
|
+
|
|
68
|
+
// confirm to the platform that local cleanup is done, so it can remove the iframe and clean up its state
|
|
69
|
+
await io.iframes.confirmFrameClosed(id);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// STEP 3 => start the app
|
|
73
|
+
const start = async () => {
|
|
74
|
+
|
|
75
|
+
// create a container where the iframe will be visualized
|
|
76
|
+
const createIFrameContainer = () => {
|
|
77
|
+
const container = document.createElement("div");
|
|
78
|
+
|
|
79
|
+
container.style.width = "400px";
|
|
80
|
+
container.style.height = "300px";
|
|
81
|
+
container.style.boxSizing = "border-box";
|
|
82
|
+
container.style.border = "1px solid orange";
|
|
83
|
+
|
|
84
|
+
container.innerText = "Loading ...";
|
|
85
|
+
|
|
86
|
+
document.body.appendChild(container);
|
|
87
|
+
|
|
88
|
+
return container;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const iframeContainer = createIFrameContainer();
|
|
92
|
+
|
|
93
|
+
// start the app (the returned iframe is automatically attached to document.body)
|
|
94
|
+
const { id, iframe } = await io.iframes.openApp({ appName: "simple", context: { ticker: "TMDX" }});
|
|
95
|
+
|
|
96
|
+
// store the container so it can be removed when a close request is received
|
|
97
|
+
iframeContainers[id] = iframeContainer;
|
|
98
|
+
|
|
99
|
+
// position the iframe inside the container
|
|
100
|
+
const positionIFrame = (iframe) => {
|
|
101
|
+
const { top, left, width, height } = iframeContainer.getBoundingClientRect();
|
|
102
|
+
|
|
103
|
+
iframe.style.top = `${top}px`;
|
|
104
|
+
iframe.style.left = `${left}px`;
|
|
105
|
+
iframe.style.width = `${width}px`;
|
|
106
|
+
iframe.style.height = `${height}px`;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
iframeContainer.innerText = "";
|
|
110
|
+
|
|
111
|
+
positionIFrame(iframe);
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
return { windowId: id, iframe };
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const { windowId, iframe } = await start();
|
|
118
|
+
|
|
119
|
+
// STEP 4 => close the app
|
|
120
|
+
await io.windows.findById(windowId).close();
|
|
121
|
+
```
|