From fe5aa442cffba0af2c7926c63d15c821ae789e07 Mon Sep 17 00:00:00 2001 From: Kaushik Shetty Date: Thu, 14 Dec 2023 15:32:13 +0530 Subject: [PATCH] chore: update maintainers and remove build files --- .gitignore | 1 + dist/index.js | 3 - dist/index.js.LICENSE.txt | 6 - dist/index.js.map | 1 - dist/src/AssetSidebarWidget.d.ts | 71 ------ dist/src/AssetSidebarWidget.d.ts.map | 1 - dist/src/RTE/index.d.ts | 13 -- dist/src/RTE/index.d.ts.map | 1 - dist/src/RTE/test/rte.test.d.ts | 2 - dist/src/RTE/test/rte.test.d.ts.map | 1 - dist/src/RTE/types.d.ts | 208 ------------------ dist/src/RTE/types.d.ts.map | 1 - dist/src/appConfig/index.d.ts | 28 --- dist/src/appConfig/index.d.ts.map | 1 - dist/src/entry.d.ts | 63 ------ dist/src/entry.d.ts.map | 1 - dist/src/entryFieldLocation/entry.d.ts | 1 - dist/src/entryFieldLocation/entry.d.ts.map | 1 - dist/src/entryFieldLocation/field.d.ts | 1 - dist/src/entryFieldLocation/field.d.ts.map | 1 - dist/src/entryFieldLocation/frame.d.ts | 1 - dist/src/entryFieldLocation/frame.d.ts.map | 1 - dist/src/extension.d.ts | 106 --------- dist/src/extension.d.ts.map | 1 - dist/src/field.d.ts | 48 ---- dist/src/field.d.ts.map | 1 - dist/src/fieldLocation/entry.d.ts | 19 -- dist/src/fieldLocation/entry.d.ts.map | 1 - dist/src/fieldLocation/field.d.ts | 43 ---- dist/src/fieldLocation/field.d.ts.map | 1 - dist/src/fieldLocation/frame.d.ts | 38 ---- dist/src/fieldLocation/frame.d.ts.map | 1 - dist/src/fieldModifierLocation/entry.d.ts | 20 -- dist/src/fieldModifierLocation/entry.d.ts.map | 1 - dist/src/fieldModifierLocation/field.d.ts | 38 ---- dist/src/fieldModifierLocation/field.d.ts.map | 1 - dist/src/fieldModifierLocation/frame.d.ts | 49 ----- dist/src/fieldModifierLocation/frame.d.ts.map | 1 - dist/src/index.d.ts | 32 --- dist/src/index.d.ts.map | 1 - dist/src/location.d.ts | 106 --------- dist/src/location.d.ts.map | 1 - dist/src/metadata.d.ts | 79 ------- dist/src/metadata.d.ts.map | 1 - dist/src/modal.d.ts | 6 - dist/src/modal.d.ts.map | 1 - dist/src/stack/api/asset/index.d.ts | 167 -------------- dist/src/stack/api/asset/index.d.ts.map | 1 - dist/src/stack/api/base.d.ts | 30 --- dist/src/stack/api/base.d.ts.map | 1 - dist/src/stack/api/content-type/entry.d.ts | 3 - .../src/stack/api/content-type/entry.d.ts.map | 1 - dist/src/stack/api/content-type/index.d.ts | 3 - .../src/stack/api/content-type/index.d.ts.map | 1 - dist/src/stack/api/query.d.ts | 169 -------------- dist/src/stack/api/query.d.ts.map | 1 - dist/src/stack/index.d.ts | 129 ----------- dist/src/stack/index.d.ts.map | 1 - dist/src/stack/utils.d.ts | 26 --- dist/src/stack/utils.d.ts.map | 1 - dist/src/store.d.ts | 47 ---- dist/src/store.d.ts.map | 1 - dist/src/streamlinedField.d.ts | 1 - dist/src/streamlinedField.d.ts.map | 1 - dist/src/types.d.ts | 195 ---------------- dist/src/types.d.ts.map | 1 - dist/src/types/common.types.d.ts | 5 - dist/src/types/common.types.d.ts.map | 1 - dist/src/types/entry.types.d.ts | 44 ---- dist/src/types/entry.types.d.ts.map | 1 - dist/src/types/postRobot.types.d.ts | 39 ---- dist/src/types/postRobot.types.d.ts.map | 1 - dist/src/types/stack.types.d.ts | 144 ------------ dist/src/types/stack.types.d.ts.map | 1 - dist/src/types/user.types.d.ts | 12 - dist/src/types/user.types.d.ts.map | 1 - dist/src/uiLocation.d.ts | 106 --------- dist/src/uiLocation.d.ts.map | 1 - dist/src/utils.d.ts | 5 - dist/src/utils.d.ts.map | 1 - dist/src/utils/errorMessages.d.ts | 20 -- dist/src/utils/errorMessages.d.ts.map | 1 - dist/src/utils/utils.d.ts | 8 - dist/src/utils/utils.d.ts.map | 1 - dist/src/window.d.ts | 59 ----- dist/src/window.d.ts.map | 1 - package.json | 6 - 87 files changed, 1 insertion(+), 2241 deletions(-) delete mode 100644 dist/index.js delete mode 100644 dist/index.js.LICENSE.txt delete mode 100644 dist/index.js.map delete mode 100644 dist/src/AssetSidebarWidget.d.ts delete mode 100644 dist/src/AssetSidebarWidget.d.ts.map delete mode 100644 dist/src/RTE/index.d.ts delete mode 100644 dist/src/RTE/index.d.ts.map delete mode 100644 dist/src/RTE/test/rte.test.d.ts delete mode 100644 dist/src/RTE/test/rte.test.d.ts.map delete mode 100644 dist/src/RTE/types.d.ts delete mode 100644 dist/src/RTE/types.d.ts.map delete mode 100644 dist/src/appConfig/index.d.ts delete mode 100644 dist/src/appConfig/index.d.ts.map delete mode 100644 dist/src/entry.d.ts delete mode 100644 dist/src/entry.d.ts.map delete mode 100644 dist/src/entryFieldLocation/entry.d.ts delete mode 100644 dist/src/entryFieldLocation/entry.d.ts.map delete mode 100644 dist/src/entryFieldLocation/field.d.ts delete mode 100644 dist/src/entryFieldLocation/field.d.ts.map delete mode 100644 dist/src/entryFieldLocation/frame.d.ts delete mode 100644 dist/src/entryFieldLocation/frame.d.ts.map delete mode 100644 dist/src/extension.d.ts delete mode 100644 dist/src/extension.d.ts.map delete mode 100644 dist/src/field.d.ts delete mode 100644 dist/src/field.d.ts.map delete mode 100644 dist/src/fieldLocation/entry.d.ts delete mode 100644 dist/src/fieldLocation/entry.d.ts.map delete mode 100644 dist/src/fieldLocation/field.d.ts delete mode 100644 dist/src/fieldLocation/field.d.ts.map delete mode 100644 dist/src/fieldLocation/frame.d.ts delete mode 100644 dist/src/fieldLocation/frame.d.ts.map delete mode 100644 dist/src/fieldModifierLocation/entry.d.ts delete mode 100644 dist/src/fieldModifierLocation/entry.d.ts.map delete mode 100644 dist/src/fieldModifierLocation/field.d.ts delete mode 100644 dist/src/fieldModifierLocation/field.d.ts.map delete mode 100644 dist/src/fieldModifierLocation/frame.d.ts delete mode 100644 dist/src/fieldModifierLocation/frame.d.ts.map delete mode 100644 dist/src/index.d.ts delete mode 100644 dist/src/index.d.ts.map delete mode 100644 dist/src/location.d.ts delete mode 100644 dist/src/location.d.ts.map delete mode 100644 dist/src/metadata.d.ts delete mode 100644 dist/src/metadata.d.ts.map delete mode 100644 dist/src/modal.d.ts delete mode 100644 dist/src/modal.d.ts.map delete mode 100644 dist/src/stack/api/asset/index.d.ts delete mode 100644 dist/src/stack/api/asset/index.d.ts.map delete mode 100644 dist/src/stack/api/base.d.ts delete mode 100644 dist/src/stack/api/base.d.ts.map delete mode 100644 dist/src/stack/api/content-type/entry.d.ts delete mode 100644 dist/src/stack/api/content-type/entry.d.ts.map delete mode 100644 dist/src/stack/api/content-type/index.d.ts delete mode 100644 dist/src/stack/api/content-type/index.d.ts.map delete mode 100644 dist/src/stack/api/query.d.ts delete mode 100644 dist/src/stack/api/query.d.ts.map delete mode 100644 dist/src/stack/index.d.ts delete mode 100644 dist/src/stack/index.d.ts.map delete mode 100644 dist/src/stack/utils.d.ts delete mode 100644 dist/src/stack/utils.d.ts.map delete mode 100644 dist/src/store.d.ts delete mode 100644 dist/src/store.d.ts.map delete mode 100644 dist/src/streamlinedField.d.ts delete mode 100644 dist/src/streamlinedField.d.ts.map delete mode 100644 dist/src/types.d.ts delete mode 100644 dist/src/types.d.ts.map delete mode 100644 dist/src/types/common.types.d.ts delete mode 100644 dist/src/types/common.types.d.ts.map delete mode 100644 dist/src/types/entry.types.d.ts delete mode 100644 dist/src/types/entry.types.d.ts.map delete mode 100644 dist/src/types/postRobot.types.d.ts delete mode 100644 dist/src/types/postRobot.types.d.ts.map delete mode 100644 dist/src/types/stack.types.d.ts delete mode 100644 dist/src/types/stack.types.d.ts.map delete mode 100644 dist/src/types/user.types.d.ts delete mode 100644 dist/src/types/user.types.d.ts.map delete mode 100644 dist/src/uiLocation.d.ts delete mode 100644 dist/src/uiLocation.d.ts.map delete mode 100644 dist/src/utils.d.ts delete mode 100644 dist/src/utils.d.ts.map delete mode 100644 dist/src/utils/errorMessages.d.ts delete mode 100644 dist/src/utils/errorMessages.d.ts.map delete mode 100644 dist/src/utils/utils.d.ts delete mode 100644 dist/src/utils/utils.d.ts.map delete mode 100644 dist/src/window.d.ts delete mode 100644 dist/src/window.d.ts.map diff --git a/.gitignore b/.gitignore index b598901..39f16a4 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ bower_components # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release +dist/ # Dependency directories node_modules/ diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 9085487..0000000 --- a/dist/index.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see index.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ContentstackAppSDK=e():t.ContentstackAppSDK=e()}(this,(()=>{return t={957:function(t){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="./src/index.js")}({"./src/index.js":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={};function o(t){return"[object RegExp]"===Object.prototype.toString.call(t)}n.d(r,"cleanUpWindow",(function(){return Pt})),n.d(r,"Promise",(function(){return z})),n.d(r,"bridge",(function(){return St})),n.d(r,"init",(function(){return Tt})),n.d(r,"parent",(function(){return Ot})),n.d(r,"send",(function(){return pt})),n.d(r,"request",(function(){return ht})),n.d(r,"sendToParent",(function(){return yt})),n.d(r,"client",(function(){return vt})),n.d(r,"on",(function(){return mt})),n.d(r,"listen",(function(){return wt})),n.d(r,"once",(function(){return gt})),n.d(r,"listener",(function(){return bt})),n.d(r,"CONFIG",(function(){return R})),n.d(r,"CONSTANTS",(function(){return A})),n.d(r,"disable",(function(){return Et}));var i="mock:",a="file:",s="about:",u="Call was rejected by callee.\r\n";function c(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===s}function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;if(t)try{if(t.parent&&t.parent!==t)return t.parent}catch(t){}}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;if(t&&!l(t))try{return t.opener}catch(t){}}function d(t){try{return t&&t.location&&t.location.href,!0}catch(t){}return!1}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,e=t.location;if(!e)throw new Error("Can not read window location");var n=e.protocol;if(!n)throw new Error("Can not read window protocol");if(n===a)return a+"//";if(n===s){var r=l(t);return r&&d(r)?h(r):s+"//"}var o=e.host;if(!o)throw new Error("Can not read window host");return n+"//"+o}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,e=h(t);return e&&t.mockDomain&&0===t.mockDomain.indexOf(i)?t.mockDomain:e}function y(t){try{if(t===window)return!0}catch(t){}try{var e=Object.getOwnPropertyDescriptor(t,"location");if(e&&!1===e.enumerable)return!1}catch(t){}try{if(c(t)&&d(t))return!0}catch(t){}try{if(h(t)===h(window))return!0}catch(t){}return!1}function v(t,e){if(!t||!e)return!1;var n=l(e);return n?n===t:-1!==function(t){var e=[];try{for(;t.parent!==t;)e.push(t.parent),t=t.parent}catch(t){}return e}(e).indexOf(t)}function _(t){var e=[],n=void 0;try{n=t.frames}catch(e){n=t}var r=void 0;try{r=n.length}catch(t){}if(0===r)return e;if(r){for(var o=0;o1&&void 0!==arguments[1])||arguments[1];try{if(t===window)return!1}catch(t){return!0}try{if(!t)return!0}catch(t){return!0}try{if(t.closed)return!0}catch(t){return!t||t.message!==u}if(e&&function(t){if(!y(t))return!1;try{if(t===window)return!0;if(c(t)&&d(t))return!0;if(p(window)===p(t))return!0}catch(t){}return!1}(t))try{if(t.mockclosed)return!0}catch(t){}try{if(!t.parent||!t.top)return!0}catch(t){}var n=function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:window;return f(t=t||window)||l(t)||void 0}function E(t,e){if("string"==typeof t){if("string"==typeof e)return"*"===t||e===t;if(o(e))return!1;if(Array.isArray(e))return!1}return o(t)?o(e)?t.toString()===e.toString():!Array.isArray(e)&&Boolean(e.match(t)):!!Array.isArray(t)&&(Array.isArray(e)?JSON.stringify(t)===JSON.stringify(e):!o(e)&&t.some((function(t){return E(t,e)})))}function O(t){try{if(t===window)return!0}catch(t){if(t&&t.message===u)return!0}try{if("[object Window]"===Object.prototype.toString.call(t))return!0}catch(t){if(t&&t.message===u)return!0}try{if(window.Window&&t instanceof window.Window)return!0}catch(t){if(t&&t.message===u)return!0}try{if(t&&t.self===t)return!0}catch(t){if(t&&t.message===u)return!0}try{if(t&&t.parent===t)return!0}catch(t){if(t&&t.message===u)return!0}try{if(t&&t.top===t)return!0}catch(t){if(t&&t.message===u)return!0}try{if(t&&"__unlikely_value__"===t.__cross_domain_utils_window_check__)return!1}catch(t){return!0}return!1}function P(t,e){for(var n=0;n>>0)+"__",function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var t=new WeakMap,e={};return Object.freeze(e),t.set(e,"__testvalue__"),"__testvalue__"===t.get(e)}catch(t){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}return t.prototype._cleanupClosedWindows=function(){for(var t=this.weakmap,e=this.keys,n=0;n1&&void 0!==arguments[1]?arguments[1]:1;if(e>=3)return"stringifyError stack overflow";try{if(!t)return"";if("string"==typeof t)return t;if(t instanceof Error){var n=t&&t.stack,r=t&&t.message;if(n&&r)return-1!==n.indexOf(r)?n:r+"\n"+n;if(n)return n;if(r)return r}return"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}catch(t){return"Error while stringifying error: "+M(t,e+1)}}var j=function(t){if(!t)return t;var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}};function L(){}function x(){var t="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,(function(){return t.charAt(Math.floor(Math.random()*t.length))}))}function I(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n>=100)throw new Error("Self-referential object passed, or object contained too many layers");var r=void 0;if("object"!==(void 0===t?"undefined":k(t))||null===t||Array.isArray(t)){if(!Array.isArray(t))throw new TypeError("Invalid type: "+(void 0===t?"undefined":k(t)));r=[]}else r={};return function(t,e){Array.isArray(t)?function(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=x(),o=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return Boolean(f(t))}()?A.WINDOW_TYPES.POPUP:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return Boolean(l(t))}()?A.WINDOW_TYPES.IFRAME:A.WINDOW_TYPES.FULLPAGE,i=p(window);return et({},e,n,{sourceDomain:i,id:e.id||r,windowType:o})}(t,e,{data:function(t,n,r){return I({obj:e.data},(function(e,r){return"function"==typeof e?Z(t,n,e,r.toString()):e instanceof Error?(o=e,{__type__:A.SERIALIZATION_TYPES.ERROR,__message__:M(o),__code__:o.code}):window.Promise&&e instanceof window.Promise?function(t,e,n,r){return{__type__:A.SERIALIZATION_TYPES.PROMISE,__then__:Z(t,e,(function(t,e){return n.then(t,e)}),r+".then")}}(t,n,e,r.toString()):z.isPromise(e)?function(t,e,n,r){return{__type__:A.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:Z(t,e,(function(t,e){return n.then(t,e)}),r+".then")}}(t,n,e,r.toString()):C(e)?(i=e,{__type__:A.SERIALIZATION_TYPES.REGEX,__source__:i.source}):void 0;var o,i})).obj}(t,n),domain:n}),t===window&&!R.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(g(t))throw new Error("Window is closed");var o=[],i=function(t,e,n){var r=void 0,o=void 0;try{if("{}"!==JSON.stringify({})&&(r=Object.prototype.toJSON,delete Object.prototype.toJSON),"{}"!==JSON.stringify({}))throw new Error("Can not correctly serialize JSON objects");if("[]"!==JSON.stringify([])&&(o=Array.prototype.toJSON,delete Array.prototype.toJSON),"[]"!==JSON.stringify([]))throw new Error("Can not correctly serialize JSON objects")}catch(t){throw new Error("Can not repair JSON.stringify: "+t.message)}var i=JSON.stringify.call(this,t,null,2);try{r&&(Object.prototype.toJSON=r),o&&(Array.prototype.toJSON=o)}catch(t){throw new Error("Can not repair JSON.stringify: "+t.message)}return i}(((r={})[A.WINDOW_PROPS.POSTROBOT]=e,r));return z.map(Object.keys(tt),(function(e){return z.try((function(){if(!R.ALLOWED_POST_MESSAGE_METHODS[e])throw new Error("Strategy disallowed: "+e);return tt[e](t,i,n)})).then((function(){return o.push(e+": success"),!0}),(function(t){return o.push(e+": "+M(t)+"\n"),!1}))})).then((function(t){var n=t.some(Boolean),r=e.type+" "+e.name+" "+(n?"success":"error")+":\n - "+o.join("\n - ")+"\n";if(!n)throw new Error(r)}))}))}K.responseListeners=K.responseListeners||{},K.requestListeners=K.requestListeners||{},K.WINDOW_WILDCARD=K.WINDOW_WILDCARD||new function(){},K.erroredResponseListeners=K.erroredResponseListeners||{};var rt;function ot(t){return K.responseListeners[t]}function it(t){delete K.responseListeners[t]}function at(t){return Boolean(K.erroredResponseListeners[t])}function st(t){var e=t.name,n=t.win,r=t.domain;if(n===A.WILDCARD&&(n=null),r===A.WILDCARD&&(r=null),!e)throw new Error("Name required to get request listener");var o=K.requestListeners[e];if(o)for(var i=0,a=[n,K.WINDOW_WILDCARD],s=null==a?0:a.length;i0&&void 0!==arguments[0]?arguments[0]:window;try{if(t.top)return t.top}catch(t){}if(l(t)===t)return t;try{if(v(window,t)&&window.top)return window.top}catch(t){}try{if(v(t,window)&&window.top)return window.top}catch(t){}for(var e=0,n=function t(e){for(var n=[],r=0,o=_(e),i=null==o?0:o.length;r1&&void 0!==arguments[1]?arguments[1]:5e3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=K.readyPromises.get(t);return r||(r=new z,K.readyPromises.set(t,r),-1!==e&&setTimeout((function(){return r.reject(new Error(n+" did not load after "+e+"ms"))}),e),r)}(i,t.timeout||R.CHILD_WINDOW_TIMEOUT)})).then((function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(C(r)&&!t)return X(i)})).then((function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(C(r)){if(!E(r,n))throw new Error("Remote window domain "+n+" does not match regex: "+r.toString());r=n}if("string"!=typeof r&&!Array.isArray(r))throw new TypeError("Expected domain to be a string or array");var o=r;return new z((function(n,r){var l=void 0;if(t.fireAndForget||function(t,e){K.responseListeners[t]=e}(a,l={name:e,window:i,domain:o,respond:function(t,e){t||(s=!0,u.splice(u.indexOf(c,1))),t?r(t):n(e)}}),nt(i,{type:A.POST_MESSAGE_TYPE.REQUEST,hash:a,name:e,data:t.data,fireAndForget:t.fireAndForget},o).catch(r),t.fireAndForget)return n();var f=R.ACK_TIMEOUT,d=t.timeout||R.RES_TIMEOUT,h=100;setTimeout((function n(){if(!s){if(g(i))return l.ack?r(new Error("Window closed for "+e+" before response")):r(new Error("Window closed for "+e+" before ack"));if(f=Math.max(f-h,0),-1!==d&&(d=Math.max(d-h,0)),l.ack){if(-1===d)return;h=Math.min(d,2e3)}else{if(0===f)return r(new Error("No ack for postMessage "+e+" in "+p()+" in "+R.ACK_TIMEOUT+"ms"));if(0===d)return r(new Error("No response for postMessage "+e+" in "+p()+" in "+(t.timeout||R.RES_TIMEOUT)+"ms"))}setTimeout(n,h)}}),h)}))}));return c.catch((function(){!function(t){K.erroredResponseListeners[t]=!0}(a),it(a)})),u.push(c),c}))}function pt(t,e,n,r){return(r=r||{}).window=t,r.name=e,r.data=n,ht(r)}function yt(t,e,n){var r=b();return r?pt(r,t,e,n):new z((function(t,e){return e(new Error("Window does not have a parent"))}))}function vt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!t.window)throw new Error("Expected options.window");var e=t.window;return{send:function(n,r){return pt(e,n,r,t)}}}K.receivedMessages=K.receivedMessages||[],K.receiveMessage=ft,K.requestPromises=K.requestPromises||new T,K.send=pt;var _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function wt(t){if(!t.name)throw new Error("Expected options.name");if(!t.handler)throw new Error("Expected options.handler");var e,n=t.name,r=t.window,o=t.domain,i={handler:t.handler,handleError:t.errorHandler||function(t){throw t},window:r,domain:o||A.WILDCARD,name:n},a=function t(e,n){var r=e.name,o=e.win,i=e.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],s=0,u=o,c=null==u?0:u.length;s1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"function"==typeof e&&(n=e,e={}),e=e||{},n=n||e.handler;var r=e.errorHandler,o=new z((function(o,i){(e=e||{}).name=t,e.once=!0,e.handler=function(t){if(o(t),n)return n(t)},e.errorHandler=function(t){if(i(t),r)return r(t)}})),i=wt(e);return o.cancel=i.cancel,o}function bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(e,n){return mt(e,t,n)}}}function Et(){delete window[A.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",dt)}K.on=mt;var Ot=b();function Pt(t){var e=K.requestPromises.get(t);if(e)for(var n=0,r=null==e?0:e.length;n{t.exports=n(957),t.exports.default=t.exports},979:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(974),o=function(){function t(){var t;if(!Object.prototype.hasOwnProperty.call(window,"iframeRef")){var e=(0,r.getPreferredBodyElement)(null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.children);window.iframeRef=e}}return t.prototype.setBackgroundElement=function(t){window.iframeRef=t},t}();e.default=o},160:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getReferences=e.includeReference=e.includeSchema=e.includeContentType=e.includeOwner=e.environment=e.language=e.addQuery=e.addParam=e._type=e.mergeDeep=e.merge=e.transform=void 0,e.transform=function(t){return function(){switch(arguments.length){case 1:if(Array.isArray(arguments[0])||"string"==typeof arguments[0])return e=(e=this._query[t+"[BASE]"]||[]).concat(arguments[0]),this._query[t+"[BASE]"]=e,this;throw Error("Kindly provide valid parameters");case 2:var e;if("string"==typeof arguments[0]&&(Array.isArray(arguments[1])||"string"==typeof arguments[1]))return e=(e=this._query[t+"["+arguments[0]+"]"]||[]).concat(arguments[1]),this._query[t+"["+arguments[0]+"]"]=e,this;throw Error("Kindly provide valid parameters");default:throw Error("Kindly provide valid parameters")}}},e.merge=function(t,e){var n=t;return t&&e&&Object.keys(e).forEach((function(t){n[t]=e[t]})),n},e.mergeDeep=function(t,e){var n=t,r=this,o=function(t,e){var n=t;Object.keys(e).forEach((function(t){"object"===r._type(e[t])&&r._type(n[t])===r._type(e[t])?o(n[t],e[t]):"array"===r._type(e[t])&&r._type(n[t])===r._type(e[t])?n[t]=n[t].concat(e[t]):n[t]=e[t]}))};return o(n,e),n},e._type=function(t){var e=typeof t;return"object"===e&&Array.isArray(t)&&(e="array"),e},e.addParam=function(t,e){if(t&&"string"==typeof t&&e&&"string"==typeof e)return this._query[t]=e,this;throw Error("Kindly provide valid parameters.")},e.addQuery=function(t,e){if(t&&e&&"string"==typeof t)return this._query[t]=e,this;throw Error("First argument should be a String.")},e.language=function(t){if(t&&"string"==typeof t)return this._query.locale=t,this;throw Error("Argument should be a String.")},e.environment=function(t){if(t&&"string"==typeof t)return this._query.environment=t,this;throw Error("Argument should be a String.")},e.includeOwner=function(){return this._query.include_owner=!0,this},e.includeContentType=function(){return this._query.include_content_type=!0,this},e.includeSchema=function(){return this._query.include_schema=!0,this},e.includeReference=function(t){if(Array.isArray(t))for(var e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(974),o=function(){function t(t){this._connection=t}return t.prototype.get=function(t){if(!t||"string"!=typeof t)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"get",key:t}).then((function(t){return Promise.resolve(t.data)})).catch(r.onError)},t.prototype.getAll=function(){return this._connection.sendToParent("store",{action:"getAll"}).then((function(t){var e=t.data,n=void 0===e?{}:e;return Promise.resolve(n)})).catch(r.onError)},t.prototype.set=function(t,e){if(!t||!e||"string"!=typeof t)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"set",key:t,value:e}).then((function(){return Promise.resolve(!0)})).catch(r.onError)},t.prototype.remove=function(t){if(!t||"string"!=typeof t)throw new Error("Kindly provide valid parameters");return this._connection.sendToParent("store",{action:"remove",key:t}).then((function(){return Promise.resolve(!0)})).catch(r.onError)},t.prototype.clear=function(){return this._connection.sendToParent("store",{action:"clear"}).then((function(){return Promise.resolve(!0)})).catch(r.onError)},t}();e.default=o},699:(t,e)=>{"use strict";var n,r,o,i;Object.defineProperty(e,"__esModule",{value:!0}),e.Region=e.OrganizationLocation=e.StackLocation=e.LocationType=e.DashboardWidth=void 0,(i=e.DashboardWidth||(e.DashboardWidth={})).FULL_WIDTH="full_width",i.HALF_WIDTH="half_width",(o=e.LocationType||(e.LocationType={})).APP_CONFIG_WIDGET="APP_CONFIG_WIDGET",o.ASSET_SIDEBAR_WIDGET="ASSET_SIDEBAR_WIDGET",o.DASHBOARD="DASHBOARD",o.FIELD="FIELD",o.FIELD_MODIFIER_LOCATION="FIELD_MODIFIER_LOCATION",o.FULL_PAGE_LOCATION="FULL_PAGE_LOCATION",o.RTE="RTE",o.WIDGET="WIDGET",(r=e.StackLocation||(e.StackLocation={})).STACK_CONFIG="cs.cm.stack.config",r.DASHBOARD="cs.cm.stack.dashboard",r.SIDEBAR="cs.cm.stack.sidebar",r.CUSTOM_FIELD="cs.cm.stack.custom_field",r.RTE="cs.cm.stack.rte",(e.OrganizationLocation||(e.OrganizationLocation={})).ORG_CONFIG="cs.org.config",(n=e.Region||(e.Region={})).UNKNOWN="UNKNOWN",n.NA="NA",n.EU="EU",n.AZURE_NA="AZURE_NA",n.AZURE_EU="AZURE_EU"},796:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERROR_MESSAGES=void 0,e.ERROR_MESSAGES=Object.freeze({configPage:{setValidity:{isValidTypeBoolean:"isValid should be a boolean",messageTypeString:"message should be a string"}},entryField:{entry:{tagsShouldNotBeBlank:"Tags cannot be blank",tagsShouldBeArrayOfStrings:"Tags must be an array of strings"},frame:{dimensionHeightShouldBeNumber:"Dimension height must be a number",dimensionWidthShouldBeNumber:"Dimension width must be a number"}}}),e.default=function(t){return"Contentstack App SDK: "+t}},974:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPreferredBodyElement=e.formatAppRegion=e.onError=e.onData=void 0;var r=n(699);e.onData=function(t){return"string"==typeof t.data?Promise.reject(t.data):Promise.resolve(t.data)},e.onError=function(t){return Promise.reject(t)},e.formatAppRegion=function(t){switch(t){case"NA":return r.Region.NA;case"EU":return r.Region.EU;case"AZURE_NA":return r.Region.AZURE_NA;case"AZURE_EU":return r.Region.AZURE_EU;default:return r.Region.UNKNOWN}},e.getPreferredBodyElement=function(t){var e,n=1/0,r=["HEADER","NAV","MAIN","SECTION","ARTICLE","ASIDE","FOOTER","DIV"],o=["SCRIPT","NOSCRIPT","STYLE","TEMPLATE"];return Array.from(t).forEach((function(t){var o=r.indexOf(t.nodeName);o>=0&&o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";t.exports=JSON.parse('{"name":"@contentstack/app-sdk","version":"2.0.0","types":"dist/src/index.d.ts","description":"The Contentstack App SDK allows you to customize your Contentstack applications.","main":"dist/index.js","repository":"https://github.com/contentstack/app-sdk","scripts":{"prepublish":"npm run build","build":"webpack","test":"jest","test:watch":"jest --watchAll","test:coverage":"jest --coverage --coverageDirectory=\\"coverage\\"","dev":"webpack --watch --mode development","lint":"eslint . --ext .ts --max-warnings=0","docs":"typedoc","prettier":"npx prettier src --check","prettier:fix":"npx prettier src --write","lint:fix":"eslint --fix","prepare":"npm run build && husky install","format":"npm run prettier:fix && npm run lint:fix"},"keywords":[],"author":{"name":"Contentstack","url":"https://www.contentstack.com/"},"maintainers":[{"name":"Deepak Kharah","email":"deepak.kharah@contentstack.com"}],"license":"MIT","devDependencies":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.3.1","@testing-library/jest-dom":"^5.16.5","@types/chai":"^4.2.22","@types/jest":"^27.0.2","@types/react":"^17.0.18","@typescript-eslint/eslint-plugin":"^5.10.1","@typescript-eslint/parser":"^5.10.1","babel-loader":"^9.1.0","chai":"^4.3.4","css-loader":"^5.2.2","eslint":"^8.7.0","eslint-plugin-only-warn":"^1.1.0","husky":"^8.0.0","jest":"^27.3.1","lint-staged":"^13.2.3","react":"^17.0.2","slate":"^0.72.3","ts-jest":"^27.0.7","ts-loader":"^8.1.0","ts-node":"^10.3.0","typedoc":"^0.22.18","typedoc-plugin-rename-defaults":"^0.6.5","typescript":"^4.4.4","webpack":"^5.65.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3"},"dependencies":{"loader-utils":"^3.2.1","post-robot":"^8.0.31","wolfy87-eventemitter":"^5.2.9"},"files":["dist"],"lint-staged":{"src/**/*.{ts,css,md}":["npm run prettier:fix ","npm run lint:fix"]}}')}},e={},function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}(607);var t,e})); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.LICENSE.txt b/dist/index.js.LICENSE.txt deleted file mode 100644 index 77e0334..0000000 --- a/dist/index.js.LICENSE.txt +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * EventEmitter v5.2.9 - git.io/ee - * Unlicense - http://unlicense.org/ - * Oliver Caldwell - https://oli.me.uk/ - * @preserve - */ diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index 67ccfbf..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAA4B,mBAAID,IAEhCD,E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webpack/universalModuleDefinition","webpack://ContentstackAppSDK/./node_modules/post-robot/dist/post-robot.js","webpack://ContentstackAppSDK/./node_modules/post-robot/index.js","webpack://ContentstackAppSDK/./src/AssetSidebarWidget.ts","webpack://ContentstackAppSDK/./src/RTE/index.tsx","webpack://ContentstackAppSDK/./src/appConfig/index.ts","webpack://ContentstackAppSDK/./src/entry.ts","webpack://ContentstackAppSDK/./src/field.ts","webpack://ContentstackAppSDK/./src/fieldModifierLocation/entry.ts","webpack://ContentstackAppSDK/./src/fieldModifierLocation/field.ts","webpack://ContentstackAppSDK/./src/fieldModifierLocation/frame.ts","webpack://ContentstackAppSDK/./src/index.ts","webpack://ContentstackAppSDK/./src/metadata.ts","webpack://ContentstackAppSDK/./src/modal.ts","webpack://ContentstackAppSDK/./src/stack/api/asset/index.ts","webpack://ContentstackAppSDK/./src/stack/api/base.ts","webpack://ContentstackAppSDK/./src/stack/api/content-type/entry.ts","webpack://ContentstackAppSDK/./src/stack/api/content-type/index.ts","webpack://ContentstackAppSDK/./src/stack/api/query.ts","webpack://ContentstackAppSDK/./src/stack/index.ts","webpack://ContentstackAppSDK/./src/stack/utils.ts","webpack://ContentstackAppSDK/./src/store.ts","webpack://ContentstackAppSDK/./src/types.ts","webpack://ContentstackAppSDK/./src/uiLocation.ts","webpack://ContentstackAppSDK/./src/utils/errorMessages.ts","webpack://ContentstackAppSDK/./src/utils/utils.ts","webpack://ContentstackAppSDK/./src/window.ts","webpack://ContentstackAppSDK/./node_modules/wolfy87-eventemitter/EventEmitter.js","webpack://ContentstackAppSDK/webpack/bootstrap","webpack://ContentstackAppSDK/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ContentstackAppSDK\"] = factory();\n\telse\n\t\troot[\"ContentstackAppSDK\"] = factory();\n})(this, () => {\nreturn ","!function(root, factory) {\n \"object\" == typeof exports && \"object\" == typeof module ? module.exports = factory() : \"function\" == typeof define && define.amd ? define(\"postRobot\", [], factory) : \"object\" == typeof exports ? exports.postRobot = factory() : root.postRobot = factory();\n}(\"undefined\" != typeof self ? self : this, function() {\n return function(modules) {\n var installedModules = {};\n function __webpack_require__(moduleId) {\n if (installedModules[moduleId]) return installedModules[moduleId].exports;\n var module = installedModules[moduleId] = {\n i: moduleId,\n l: !1,\n exports: {}\n };\n modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n module.l = !0;\n return module.exports;\n }\n __webpack_require__.m = modules;\n __webpack_require__.c = installedModules;\n __webpack_require__.d = function(exports, name, getter) {\n __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {\n configurable: !1,\n enumerable: !0,\n get: getter\n });\n };\n __webpack_require__.n = function(module) {\n var getter = module && module.__esModule ? function() {\n return module.default;\n } : function() {\n return module;\n };\n __webpack_require__.d(getter, \"a\", getter);\n return getter;\n };\n __webpack_require__.o = function(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n };\n __webpack_require__.p = \"\";\n return __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n }({\n \"./src/index.js\": function(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n Object.defineProperty(__webpack_exports__, \"__esModule\", {\n value: !0\n });\n var interface_namespaceObject = {};\n __webpack_require__.d(interface_namespaceObject, \"cleanUpWindow\", function() {\n return cleanUpWindow;\n });\n __webpack_require__.d(interface_namespaceObject, \"Promise\", function() {\n return promise_ZalgoPromise;\n });\n __webpack_require__.d(interface_namespaceObject, \"bridge\", function() {\n return bridge;\n });\n __webpack_require__.d(interface_namespaceObject, \"init\", function() {\n return init;\n });\n __webpack_require__.d(interface_namespaceObject, \"parent\", function() {\n return public_parent;\n });\n __webpack_require__.d(interface_namespaceObject, \"send\", function() {\n return _send;\n });\n __webpack_require__.d(interface_namespaceObject, \"request\", function() {\n return request;\n });\n __webpack_require__.d(interface_namespaceObject, \"sendToParent\", function() {\n return sendToParent;\n });\n __webpack_require__.d(interface_namespaceObject, \"client\", function() {\n return client;\n });\n __webpack_require__.d(interface_namespaceObject, \"on\", function() {\n return _on;\n });\n __webpack_require__.d(interface_namespaceObject, \"listen\", function() {\n return listen;\n });\n __webpack_require__.d(interface_namespaceObject, \"once\", function() {\n return server_once;\n });\n __webpack_require__.d(interface_namespaceObject, \"listener\", function() {\n return server_listener;\n });\n __webpack_require__.d(interface_namespaceObject, \"CONFIG\", function() {\n return CONFIG;\n });\n __webpack_require__.d(interface_namespaceObject, \"CONSTANTS\", function() {\n return constants_CONSTANTS;\n });\n __webpack_require__.d(interface_namespaceObject, \"disable\", function() {\n return disable;\n });\n function isRegex(item) {\n return \"[object RegExp]\" === Object.prototype.toString.call(item);\n }\n var PROTOCOL = {\n MOCK: \"mock:\",\n FILE: \"file:\",\n ABOUT: \"about:\"\n }, WILDCARD = \"*\", IE_WIN_ACCESS_ERROR = \"Call was rejected by callee.\\r\\n\";\n function isAboutProtocol() {\n return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window).location.protocol === PROTOCOL.ABOUT;\n }\n function getParent() {\n var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window;\n if (win) try {\n if (win.parent && win.parent !== win) return win.parent;\n } catch (err) {}\n }\n function getOpener() {\n var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window;\n if (win && !getParent(win)) try {\n return win.opener;\n } catch (err) {}\n }\n function canReadFromWindow(win) {\n try {\n win && win.location && win.location.href;\n return !0;\n } catch (err) {}\n return !1;\n }\n function getActualDomain() {\n var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window, location = win.location;\n if (!location) throw new Error(\"Can not read window location\");\n var protocol = location.protocol;\n if (!protocol) throw new Error(\"Can not read window protocol\");\n if (protocol === PROTOCOL.FILE) return PROTOCOL.FILE + \"//\";\n if (protocol === PROTOCOL.ABOUT) {\n var parent = getParent(win);\n return parent && canReadFromWindow(parent) ? getActualDomain(parent) : PROTOCOL.ABOUT + \"//\";\n }\n var host = location.host;\n if (!host) throw new Error(\"Can not read window host\");\n return protocol + \"//\" + host;\n }\n function utils_getDomain() {\n var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window, domain = getActualDomain(win);\n return domain && win.mockDomain && 0 === win.mockDomain.indexOf(PROTOCOL.MOCK) ? win.mockDomain : domain;\n }\n function isActuallySameDomain(win) {\n try {\n if (win === window) return !0;\n } catch (err) {}\n try {\n var desc = Object.getOwnPropertyDescriptor(win, \"location\");\n if (desc && !1 === desc.enumerable) return !1;\n } catch (err) {}\n try {\n if (isAboutProtocol(win) && canReadFromWindow(win)) return !0;\n } catch (err) {}\n try {\n if (getActualDomain(win) === getActualDomain(window)) return !0;\n } catch (err) {}\n return !1;\n }\n function isAncestorParent(parent, child) {\n if (!parent || !child) return !1;\n var childParent = getParent(child);\n return childParent ? childParent === parent : -1 !== function(win) {\n var result = [];\n try {\n for (;win.parent !== win; ) {\n result.push(win.parent);\n win = win.parent;\n }\n } catch (err) {}\n return result;\n }(child).indexOf(parent);\n }\n function getFrames(win) {\n var result = [], frames = void 0;\n try {\n frames = win.frames;\n } catch (err) {\n frames = win;\n }\n var len = void 0;\n try {\n len = frames.length;\n } catch (err) {}\n if (0 === len) return result;\n if (len) {\n for (var i = 0; i < len; i++) {\n var frame = void 0;\n try {\n frame = frames[i];\n } catch (err) {\n continue;\n }\n result.push(frame);\n }\n return result;\n }\n for (var _i = 0; _i < 100; _i++) {\n var _frame = void 0;\n try {\n _frame = frames[_i];\n } catch (err) {\n return result;\n }\n if (!_frame) return result;\n result.push(_frame);\n }\n return result;\n }\n var iframeWindows = [], iframeFrames = [];\n function isWindowClosed(win) {\n var allowMock = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];\n try {\n if (win === window) return !1;\n } catch (err) {\n return !0;\n }\n try {\n if (!win) return !0;\n } catch (err) {\n return !0;\n }\n try {\n if (win.closed) return !0;\n } catch (err) {\n return !err || err.message !== IE_WIN_ACCESS_ERROR;\n }\n if (allowMock && function(win) {\n if (!isActuallySameDomain(win)) return !1;\n try {\n if (win === window) return !0;\n if (isAboutProtocol(win) && canReadFromWindow(win)) return !0;\n if (utils_getDomain(window) === utils_getDomain(win)) return !0;\n } catch (err) {}\n return !1;\n }(win)) try {\n if (win.mockclosed) return !0;\n } catch (err) {}\n try {\n if (!win.parent || !win.top) return !0;\n } catch (err) {}\n var iframeIndex = function(collection, item) {\n for (var i = 0; i < collection.length; i++) try {\n if (collection[i] === item) return i;\n } catch (err) {}\n return -1;\n }(iframeWindows, win);\n if (-1 !== iframeIndex) {\n var frame = iframeFrames[iframeIndex];\n if (frame && function(frame) {\n if (!frame.contentWindow) return !0;\n if (!frame.parentNode) return !0;\n var doc = frame.ownerDocument;\n return !(!doc || !doc.documentElement || doc.documentElement.contains(frame));\n }(frame)) return !0;\n }\n return !1;\n }\n function getAncestor() {\n var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window;\n return getOpener(win = win || window) || getParent(win) || void 0;\n }\n function matchDomain(pattern, origin) {\n if (\"string\" == typeof pattern) {\n if (\"string\" == typeof origin) return pattern === WILDCARD || origin === pattern;\n if (isRegex(origin)) return !1;\n if (Array.isArray(origin)) return !1;\n }\n return isRegex(pattern) ? isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !isRegex(origin) && pattern.some(function(subpattern) {\n return matchDomain(subpattern, origin);\n }));\n }\n function isWindow(obj) {\n try {\n if (obj === window) return !0;\n } catch (err) {\n if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n }\n try {\n if (\"[object Window]\" === Object.prototype.toString.call(obj)) return !0;\n } catch (err) {\n if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n }\n try {\n if (window.Window && obj instanceof window.Window) return !0;\n } catch (err) {\n if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n }\n try {\n if (obj && obj.self === obj) return !0;\n } catch (err) {\n if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n }\n try {\n if (obj && obj.parent === obj) return !0;\n } catch (err) {\n if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n }\n try {\n if (obj && obj.top === obj) return !0;\n } catch (err) {\n if (err && err.message === IE_WIN_ACCESS_ERROR) return !0;\n }\n try {\n if (obj && \"__unlikely_value__\" === obj.__cross_domain_utils_window_check__) return !1;\n } catch (err) {\n return !0;\n }\n return !1;\n }\n function util_safeIndexOf(collection, item) {\n for (var i = 0; i < collection.length; i++) try {\n if (collection[i] === item) return i;\n } catch (err) {}\n return -1;\n }\n var _ALLOWED_POST_MESSAGE, weakmap_CrossDomainSafeWeakMap = function() {\n function CrossDomainSafeWeakMap() {\n !function(instance, Constructor) {\n if (!(instance instanceof CrossDomainSafeWeakMap)) throw new TypeError(\"Cannot call a class as a function\");\n }(this);\n this.name = \"__weakmap_\" + (1e9 * Math.random() >>> 0) + \"__\";\n if (function() {\n if (\"undefined\" == typeof WeakMap) return !1;\n if (void 0 === Object.freeze) return !1;\n try {\n var testWeakMap = new WeakMap(), testKey = {};\n Object.freeze(testKey);\n testWeakMap.set(testKey, \"__testvalue__\");\n return \"__testvalue__\" === testWeakMap.get(testKey);\n } catch (err) {\n return !1;\n }\n }()) try {\n this.weakmap = new WeakMap();\n } catch (err) {}\n this.keys = [];\n this.values = [];\n }\n CrossDomainSafeWeakMap.prototype._cleanupClosedWindows = function() {\n for (var weakmap = this.weakmap, keys = this.keys, i = 0; i < keys.length; i++) {\n var value = keys[i];\n if (isWindow(value) && isWindowClosed(value)) {\n if (weakmap) try {\n weakmap.delete(value);\n } catch (err) {}\n keys.splice(i, 1);\n this.values.splice(i, 1);\n i -= 1;\n }\n }\n };\n CrossDomainSafeWeakMap.prototype.isSafeToReadWrite = function(key) {\n if (isWindow(key)) return !1;\n try {\n key && key.self;\n key && key[this.name];\n } catch (err) {\n return !1;\n }\n return !0;\n };\n CrossDomainSafeWeakMap.prototype.set = function(key, value) {\n if (!key) throw new Error(\"WeakMap expected key\");\n var weakmap = this.weakmap;\n if (weakmap) try {\n weakmap.set(key, value);\n } catch (err) {\n delete this.weakmap;\n }\n if (this.isSafeToReadWrite(key)) try {\n var name = this.name, entry = key[name];\n entry && entry[0] === key ? entry[1] = value : Object.defineProperty(key, name, {\n value: [ key, value ],\n writable: !0\n });\n return;\n } catch (err) {}\n this._cleanupClosedWindows();\n var keys = this.keys, values = this.values, index = util_safeIndexOf(keys, key);\n if (-1 === index) {\n keys.push(key);\n values.push(value);\n } else values[index] = value;\n };\n CrossDomainSafeWeakMap.prototype.get = function(key) {\n if (!key) throw new Error(\"WeakMap expected key\");\n var weakmap = this.weakmap;\n if (weakmap) try {\n if (weakmap.has(key)) return weakmap.get(key);\n } catch (err) {\n delete this.weakmap;\n }\n if (this.isSafeToReadWrite(key)) try {\n var entry = key[this.name];\n return entry && entry[0] === key ? entry[1] : void 0;\n } catch (err) {}\n this._cleanupClosedWindows();\n var index = util_safeIndexOf(this.keys, key);\n if (-1 !== index) return this.values[index];\n };\n CrossDomainSafeWeakMap.prototype.delete = function(key) {\n if (!key) throw new Error(\"WeakMap expected key\");\n var weakmap = this.weakmap;\n if (weakmap) try {\n weakmap.delete(key);\n } catch (err) {\n delete this.weakmap;\n }\n if (this.isSafeToReadWrite(key)) try {\n var entry = key[this.name];\n entry && entry[0] === key && (entry[0] = entry[1] = void 0);\n } catch (err) {}\n this._cleanupClosedWindows();\n var keys = this.keys, index = util_safeIndexOf(keys, key);\n if (-1 !== index) {\n keys.splice(index, 1);\n this.values.splice(index, 1);\n }\n };\n CrossDomainSafeWeakMap.prototype.has = function(key) {\n if (!key) throw new Error(\"WeakMap expected key\");\n var weakmap = this.weakmap;\n if (weakmap) try {\n if (weakmap.has(key)) return !0;\n } catch (err) {\n delete this.weakmap;\n }\n if (this.isSafeToReadWrite(key)) try {\n var entry = key[this.name];\n return !(!entry || entry[0] !== key);\n } catch (err) {}\n this._cleanupClosedWindows();\n return -1 !== util_safeIndexOf(this.keys, key);\n };\n CrossDomainSafeWeakMap.prototype.getOrSet = function(key, getter) {\n if (this.has(key)) return this.get(key);\n var value = getter();\n this.set(key, value);\n return value;\n };\n return CrossDomainSafeWeakMap;\n }(), constants_CONSTANTS = {\n POST_MESSAGE_TYPE: {\n REQUEST: \"postrobot_message_request\",\n RESPONSE: \"postrobot_message_response\",\n ACK: \"postrobot_message_ack\"\n },\n POST_MESSAGE_ACK: {\n SUCCESS: \"success\",\n ERROR: \"error\"\n },\n POST_MESSAGE_NAMES: {\n METHOD: \"postrobot_method\",\n HELLO: \"postrobot_ready\",\n OPEN_TUNNEL: \"postrobot_open_tunnel\"\n },\n WINDOW_TYPES: {\n FULLPAGE: \"fullpage\",\n POPUP: \"popup\",\n IFRAME: \"iframe\"\n },\n WINDOW_PROPS: {\n POSTROBOT: \"__postRobot__\"\n },\n SERIALIZATION_TYPES: {\n METHOD: \"postrobot_method\",\n ERROR: \"postrobot_error\",\n PROMISE: \"postrobot_promise\",\n ZALGO_PROMISE: \"postrobot_zalgo_promise\",\n REGEX: \"regex\"\n },\n SEND_STRATEGIES: {\n POST_MESSAGE: \"postrobot_post_message\",\n BRIDGE: \"postrobot_bridge\",\n GLOBAL: \"postrobot_global\"\n },\n MOCK_PROTOCOL: \"mock:\",\n FILE_PROTOCOL: \"file:\",\n BRIDGE_NAME_PREFIX: \"__postrobot_bridge__\",\n POSTROBOT_PROXY: \"__postrobot_proxy__\",\n WILDCARD: \"*\"\n }, POST_MESSAGE_NAMES = {\n METHOD: \"postrobot_method\",\n HELLO: \"postrobot_hello\",\n OPEN_TUNNEL: \"postrobot_open_tunnel\"\n }, CONFIG = (Object.keys(POST_MESSAGE_NAMES).map(function(key) {\n return POST_MESSAGE_NAMES[key];\n }), {\n ALLOW_POSTMESSAGE_POPUP: !(\"__ALLOW_POSTMESSAGE_POPUP__\" in window) || window.__ALLOW_POSTMESSAGE_POPUP__,\n BRIDGE_TIMEOUT: 5e3,\n CHILD_WINDOW_TIMEOUT: 5e3,\n ACK_TIMEOUT: -1 !== window.navigator.userAgent.match(/MSIE/i) ? 1e4 : 2e3,\n RES_TIMEOUT: -1,\n ALLOWED_POST_MESSAGE_METHODS: (_ALLOWED_POST_MESSAGE = {}, _ALLOWED_POST_MESSAGE[constants_CONSTANTS.SEND_STRATEGIES.POST_MESSAGE] = !0, \n _ALLOWED_POST_MESSAGE[constants_CONSTANTS.SEND_STRATEGIES.BRIDGE] = !0, _ALLOWED_POST_MESSAGE[constants_CONSTANTS.SEND_STRATEGIES.GLOBAL] = !0, \n _ALLOWED_POST_MESSAGE),\n ALLOW_SAME_ORIGIN: !1\n });\n 0 === window.location.href.indexOf(constants_CONSTANTS.FILE_PROTOCOL) && (CONFIG.ALLOW_POSTMESSAGE_POPUP = !0);\n var _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(obj) {\n return typeof obj;\n } : function(obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n function stringifyError(err) {\n var level = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;\n if (level >= 3) return \"stringifyError stack overflow\";\n try {\n if (!err) return \"\";\n if (\"string\" == typeof err) return err;\n if (err instanceof Error) {\n var stack = err && err.stack, message = err && err.message;\n if (stack && message) return -1 !== stack.indexOf(message) ? stack : message + \"\\n\" + stack;\n if (stack) return stack;\n if (message) return message;\n }\n return \"function\" == typeof err.toString ? err.toString() : Object.prototype.toString.call(err);\n } catch (newErr) {\n return \"Error while stringifying error: \" + stringifyError(newErr, level + 1);\n }\n }\n var once = function(method) {\n if (!method) return method;\n var called = !1;\n return function() {\n if (!called) {\n called = !0;\n return method.apply(this, arguments);\n }\n };\n };\n function lib_util_noop() {}\n function uniqueID() {\n var chars = \"0123456789abcdef\";\n return \"xxxxxxxxxx\".replace(/./g, function() {\n return chars.charAt(Math.floor(Math.random() * chars.length));\n });\n }\n function replaceObject(item, callback) {\n var depth = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;\n if (depth >= 100) throw new Error(\"Self-referential object passed, or object contained too many layers\");\n var newobj = void 0;\n if (\"object\" !== (void 0 === item ? \"undefined\" : _typeof(item)) || null === item || Array.isArray(item)) {\n if (!Array.isArray(item)) throw new TypeError(\"Invalid type: \" + (void 0 === item ? \"undefined\" : _typeof(item)));\n newobj = [];\n } else newobj = {};\n !function(item, callback) {\n Array.isArray(item) ? function(item, callback) {\n for (var i = 0; i < item.length; i++) callback(item[i], i);\n }(item, callback) : \"object\" === (void 0 === item ? \"undefined\" : _typeof(item)) && null !== item && function(item, callback) {\n for (var _key in item) item.hasOwnProperty(_key) && callback(item[_key], _key);\n }(item, callback);\n }(item, function(childItem, key) {\n var result = callback(childItem, key);\n void 0 !== result ? newobj[key] = result : \"object\" === (void 0 === childItem ? \"undefined\" : _typeof(childItem)) && null !== childItem ? newobj[key] = replaceObject(childItem, callback, depth + 1) : newobj[key] = childItem;\n });\n return newobj;\n }\n function util_isRegex(item) {\n return \"[object RegExp]\" === Object.prototype.toString.call(item);\n }\n function utils_isPromise(item) {\n try {\n if (!item) return !1;\n if (\"undefined\" != typeof Promise && item instanceof Promise) return !0;\n if (\"undefined\" != typeof window && \"function\" == typeof window.Window && item instanceof window.Window) return !1;\n if (\"undefined\" != typeof window && \"function\" == typeof window.constructor && item instanceof window.constructor) return !1;\n var _toString = {}.toString;\n if (_toString) {\n var name = _toString.call(item);\n if (\"[object Window]\" === name || \"[object global]\" === name || \"[object DOMWindow]\" === name) return !1;\n }\n if (\"function\" == typeof item.then) return !0;\n } catch (err) {\n return !1;\n }\n return !1;\n }\n var dispatchedErrors = [], possiblyUnhandledPromiseHandlers = [], activeCount = 0, flushPromise = void 0;\n function flushActive() {\n if (!activeCount && flushPromise) {\n var promise = flushPromise;\n flushPromise = null;\n promise.resolve();\n }\n }\n function startActive() {\n activeCount += 1;\n }\n function endActive() {\n activeCount -= 1;\n flushActive();\n }\n var promise_ZalgoPromise = function() {\n function ZalgoPromise(handler) {\n var _this = this;\n !function(instance, Constructor) {\n if (!(instance instanceof ZalgoPromise)) throw new TypeError(\"Cannot call a class as a function\");\n }(this);\n this.resolved = !1;\n this.rejected = !1;\n this.errorHandled = !1;\n this.handlers = [];\n if (handler) {\n var _result = void 0, _error = void 0, resolved = !1, rejected = !1, isAsync = !1;\n startActive();\n try {\n handler(function(res) {\n if (isAsync) _this.resolve(res); else {\n resolved = !0;\n _result = res;\n }\n }, function(err) {\n if (isAsync) _this.reject(err); else {\n rejected = !0;\n _error = err;\n }\n });\n } catch (err) {\n endActive();\n this.reject(err);\n return;\n }\n endActive();\n isAsync = !0;\n resolved ? this.resolve(_result) : rejected && this.reject(_error);\n }\n }\n ZalgoPromise.prototype.resolve = function(result) {\n if (this.resolved || this.rejected) return this;\n if (utils_isPromise(result)) throw new Error(\"Can not resolve promise with another promise\");\n this.resolved = !0;\n this.value = result;\n this.dispatch();\n return this;\n };\n ZalgoPromise.prototype.reject = function(error) {\n var _this2 = this;\n if (this.resolved || this.rejected) return this;\n if (utils_isPromise(error)) throw new Error(\"Can not reject promise with another promise\");\n if (!error) {\n var _err = error && \"function\" == typeof error.toString ? error.toString() : Object.prototype.toString.call(error);\n error = new Error(\"Expected reject to be called with Error, got \" + _err);\n }\n this.rejected = !0;\n this.error = error;\n this.errorHandled || setTimeout(function() {\n _this2.errorHandled || function(err, promise) {\n if (-1 === dispatchedErrors.indexOf(err)) {\n dispatchedErrors.push(err);\n setTimeout(function() {\n throw err;\n }, 1);\n for (var j = 0; j < possiblyUnhandledPromiseHandlers.length; j++) possiblyUnhandledPromiseHandlers[j](err, promise);\n }\n }(error, _this2);\n }, 1);\n this.dispatch();\n return this;\n };\n ZalgoPromise.prototype.asyncReject = function(error) {\n this.errorHandled = !0;\n this.reject(error);\n return this;\n };\n ZalgoPromise.prototype.dispatch = function() {\n var dispatching = this.dispatching, resolved = this.resolved, rejected = this.rejected, handlers = this.handlers;\n if (!dispatching && (resolved || rejected)) {\n this.dispatching = !0;\n startActive();\n for (var chain = function(firstPromise, secondPromise) {\n return firstPromise.then(function(res) {\n secondPromise.resolve(res);\n }, function(err) {\n secondPromise.reject(err);\n });\n }, i = 0; i < handlers.length; i++) {\n var _handlers$i = handlers[i], _onSuccess = _handlers$i.onSuccess, _onError = _handlers$i.onError, _promise = _handlers$i.promise, _result2 = void 0;\n if (resolved) try {\n _result2 = _onSuccess ? _onSuccess(this.value) : this.value;\n } catch (err) {\n _promise.reject(err);\n continue;\n } else if (rejected) {\n if (!_onError) {\n _promise.reject(this.error);\n continue;\n }\n try {\n _result2 = _onError(this.error);\n } catch (err) {\n _promise.reject(err);\n continue;\n }\n }\n if (_result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected)) {\n _result2.resolved ? _promise.resolve(_result2.value) : _promise.reject(_result2.error);\n _result2.errorHandled = !0;\n } else utils_isPromise(_result2) ? _result2 instanceof ZalgoPromise && (_result2.resolved || _result2.rejected) ? _result2.resolved ? _promise.resolve(_result2.value) : _promise.reject(_result2.error) : chain(_result2, _promise) : _promise.resolve(_result2);\n }\n handlers.length = 0;\n this.dispatching = !1;\n endActive();\n }\n };\n ZalgoPromise.prototype.then = function(onSuccess, onError) {\n if (onSuccess && \"function\" != typeof onSuccess && !onSuccess.call) throw new Error(\"Promise.then expected a function for success handler\");\n if (onError && \"function\" != typeof onError && !onError.call) throw new Error(\"Promise.then expected a function for error handler\");\n var promise = new ZalgoPromise();\n this.handlers.push({\n promise: promise,\n onSuccess: onSuccess,\n onError: onError\n });\n this.errorHandled = !0;\n this.dispatch();\n return promise;\n };\n ZalgoPromise.prototype.catch = function(onError) {\n return this.then(void 0, onError);\n };\n ZalgoPromise.prototype.finally = function(onFinally) {\n if (onFinally && \"function\" != typeof onFinally && !onFinally.call) throw new Error(\"Promise.finally expected a function\");\n return this.then(function(result) {\n return ZalgoPromise.try(onFinally).then(function() {\n return result;\n });\n }, function(err) {\n return ZalgoPromise.try(onFinally).then(function() {\n throw err;\n });\n });\n };\n ZalgoPromise.prototype.timeout = function(time, err) {\n var _this3 = this;\n if (this.resolved || this.rejected) return this;\n var timeout = setTimeout(function() {\n _this3.resolved || _this3.rejected || _this3.reject(err || new Error(\"Promise timed out after \" + time + \"ms\"));\n }, time);\n return this.then(function(result) {\n clearTimeout(timeout);\n return result;\n });\n };\n ZalgoPromise.prototype.toPromise = function() {\n if (\"undefined\" == typeof Promise) throw new TypeError(\"Could not find Promise\");\n return Promise.resolve(this);\n };\n ZalgoPromise.resolve = function(value) {\n return value instanceof ZalgoPromise ? value : utils_isPromise(value) ? new ZalgoPromise(function(resolve, reject) {\n return value.then(resolve, reject);\n }) : new ZalgoPromise().resolve(value);\n };\n ZalgoPromise.reject = function(error) {\n return new ZalgoPromise().reject(error);\n };\n ZalgoPromise.asyncReject = function(error) {\n return new ZalgoPromise().asyncReject(error);\n };\n ZalgoPromise.all = function(promises) {\n var promise = new ZalgoPromise(), count = promises.length, results = [];\n if (!count) {\n promise.resolve(results);\n return promise;\n }\n for (var chain = function(i, firstPromise, secondPromise) {\n return firstPromise.then(function(res) {\n results[i] = res;\n 0 == (count -= 1) && promise.resolve(results);\n }, function(err) {\n secondPromise.reject(err);\n });\n }, i = 0; i < promises.length; i++) {\n var prom = promises[i];\n if (prom instanceof ZalgoPromise) {\n if (prom.resolved) {\n results[i] = prom.value;\n count -= 1;\n continue;\n }\n } else if (!utils_isPromise(prom)) {\n results[i] = prom;\n count -= 1;\n continue;\n }\n chain(i, ZalgoPromise.resolve(prom), promise);\n }\n 0 === count && promise.resolve(results);\n return promise;\n };\n ZalgoPromise.hash = function(promises) {\n var result = {};\n return ZalgoPromise.all(Object.keys(promises).map(function(key) {\n return ZalgoPromise.resolve(promises[key]).then(function(value) {\n result[key] = value;\n });\n })).then(function() {\n return result;\n });\n };\n ZalgoPromise.map = function(items, method) {\n return ZalgoPromise.all(items.map(method));\n };\n ZalgoPromise.onPossiblyUnhandledException = function(handler) {\n return function(handler) {\n possiblyUnhandledPromiseHandlers.push(handler);\n return {\n cancel: function() {\n possiblyUnhandledPromiseHandlers.splice(possiblyUnhandledPromiseHandlers.indexOf(handler), 1);\n }\n };\n }(handler);\n };\n ZalgoPromise.try = function(method, context, args) {\n if (method && \"function\" != typeof method && !method.call) throw new Error(\"Promise.try expected a function\");\n var result = void 0;\n startActive();\n try {\n result = method.apply(context, args || []);\n } catch (err) {\n endActive();\n return ZalgoPromise.reject(err);\n }\n endActive();\n return ZalgoPromise.resolve(result);\n };\n ZalgoPromise.delay = function(_delay) {\n return new ZalgoPromise(function(resolve) {\n setTimeout(resolve, _delay);\n });\n };\n ZalgoPromise.isPromise = function(value) {\n return !!(value && value instanceof ZalgoPromise) || utils_isPromise(value);\n };\n ZalgoPromise.flush = function() {\n return function(Zalgo) {\n var promise = flushPromise = flushPromise || new ZalgoPromise();\n flushActive();\n return promise;\n }();\n };\n return ZalgoPromise;\n }(), global = window[constants_CONSTANTS.WINDOW_PROPS.POSTROBOT] = window[constants_CONSTANTS.WINDOW_PROPS.POSTROBOT] || {};\n global.registerSelf = function() {};\n var serialize__typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(obj) {\n return typeof obj;\n } : function(obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n global.methods = global.methods || new weakmap_CrossDomainSafeWeakMap();\n var listenForMethods = once(function() {\n global.on(constants_CONSTANTS.POST_MESSAGE_NAMES.METHOD, {\n origin: constants_CONSTANTS.WILDCARD\n }, function(_ref) {\n var source = _ref.source, origin = _ref.origin, data = _ref.data, methods = global.methods.get(source);\n if (!methods) throw new Error(\"Could not find any methods this window has privileges to call\");\n var meth = methods[data.id];\n if (!meth) throw new Error(\"Could not find method with id: \" + data.id);\n if (!matchDomain(meth.domain, origin)) throw new Error(\"Method domain \" + meth.domain + \" does not match origin \" + origin);\n return promise_ZalgoPromise.try(function() {\n return meth.method.apply({\n source: source,\n origin: origin,\n data: data\n }, data.args);\n }).then(function(result) {\n return {\n result: result,\n id: data.id,\n name: data.name\n };\n });\n });\n });\n function isSerialized(item, type) {\n return \"object\" === (void 0 === item ? \"undefined\" : serialize__typeof(item)) && null !== item && item.__type__ === type;\n }\n function serializeMethod(destination, domain, method, name) {\n var id = uniqueID(), methods = global.methods.get(destination);\n if (!methods) {\n methods = {};\n global.methods.set(destination, methods);\n }\n methods[id] = {\n domain: domain,\n method: method\n };\n return {\n __type__: constants_CONSTANTS.SERIALIZATION_TYPES.METHOD,\n __id__: id,\n __name__: name\n };\n }\n function deserializeMethod(source, origin, obj) {\n function wrapper() {\n var args = Array.prototype.slice.call(arguments);\n return global.send(source, constants_CONSTANTS.POST_MESSAGE_NAMES.METHOD, {\n id: obj.__id__,\n name: obj.__name__,\n args: args\n }, {\n domain: origin,\n timeout: -1\n }).then(function(_ref2) {\n return _ref2.data.result;\n }, function(err) {\n throw err;\n });\n }\n wrapper.__name__ = obj.__name__;\n wrapper.__xdomain__ = !0;\n wrapper.source = source;\n wrapper.origin = origin;\n return wrapper;\n }\n function deserializeZalgoPromise(source, origin, prom) {\n return new promise_ZalgoPromise(function(resolve, reject) {\n return deserializeMethod(source, origin, prom.__then__)(resolve, reject);\n });\n }\n global.readyPromises = global.readyPromises || new weakmap_CrossDomainSafeWeakMap();\n function sayHello(win) {\n return global.send(win, constants_CONSTANTS.POST_MESSAGE_NAMES.HELLO, {}, {\n domain: constants_CONSTANTS.WILDCARD,\n timeout: -1\n }).then(function(_ref2) {\n return {\n origin: _ref2.origin\n };\n });\n }\n var SEND_MESSAGE_STRATEGIES = {};\n SEND_MESSAGE_STRATEGIES[constants_CONSTANTS.SEND_STRATEGIES.POST_MESSAGE] = function(win, serializedMessage, domain) {\n (Array.isArray(domain) ? domain : \"string\" == typeof domain ? [ domain ] : [ constants_CONSTANTS.WILDCARD ]).map(function(dom) {\n if (0 === dom.indexOf(constants_CONSTANTS.MOCK_PROTOCOL)) {\n if (window.location.protocol === constants_CONSTANTS.FILE_PROTOCOL) return constants_CONSTANTS.WILDCARD;\n if (!isActuallySameDomain(win)) throw new Error(\"Attempting to send messsage to mock domain \" + dom + \", but window is actually cross-domain\");\n return getActualDomain(win);\n }\n return 0 === dom.indexOf(constants_CONSTANTS.FILE_PROTOCOL) ? constants_CONSTANTS.WILDCARD : dom;\n }).forEach(function(dom) {\n return win.postMessage(serializedMessage, dom);\n });\n };\n var _extends = Object.assign || function(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);\n }\n return target;\n };\n function sendMessage(win, message, domain) {\n return promise_ZalgoPromise.try(function() {\n var _jsonStringify;\n message = function(win, message) {\n var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, id = uniqueID(), type = function() {\n var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window;\n return Boolean(getOpener(win));\n }() ? constants_CONSTANTS.WINDOW_TYPES.POPUP : function() {\n var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window;\n return Boolean(getParent(win));\n }() ? constants_CONSTANTS.WINDOW_TYPES.IFRAME : constants_CONSTANTS.WINDOW_TYPES.FULLPAGE, sourceDomain = utils_getDomain(window);\n return _extends({}, message, options, {\n sourceDomain: sourceDomain,\n id: message.id || id,\n windowType: type\n });\n }(win, message, {\n data: function(destination, domain, obj) {\n return replaceObject({\n obj: message.data\n }, function(item, key) {\n return \"function\" == typeof item ? serializeMethod(destination, domain, item, key.toString()) : item instanceof Error ? (err = item, \n {\n __type__: constants_CONSTANTS.SERIALIZATION_TYPES.ERROR,\n __message__: stringifyError(err),\n __code__: err.code\n }) : window.Promise && item instanceof window.Promise ? function(destination, domain, promise, name) {\n return {\n __type__: constants_CONSTANTS.SERIALIZATION_TYPES.PROMISE,\n __then__: serializeMethod(destination, domain, function(resolve, reject) {\n return promise.then(resolve, reject);\n }, name + \".then\")\n };\n }(destination, domain, item, key.toString()) : promise_ZalgoPromise.isPromise(item) ? function(destination, domain, promise, name) {\n return {\n __type__: constants_CONSTANTS.SERIALIZATION_TYPES.ZALGO_PROMISE,\n __then__: serializeMethod(destination, domain, function(resolve, reject) {\n return promise.then(resolve, reject);\n }, name + \".then\")\n };\n }(destination, domain, item, key.toString()) : util_isRegex(item) ? (regex = item, \n {\n __type__: constants_CONSTANTS.SERIALIZATION_TYPES.REGEX,\n __source__: regex.source\n }) : void 0;\n var err, regex;\n }).obj;\n }(win, domain),\n domain: domain\n });\n if (win === window && !CONFIG.ALLOW_SAME_ORIGIN) throw new Error(\"Attemping to send message to self\");\n if (isWindowClosed(win)) throw new Error(\"Window is closed\");\n var messages = [], serializedMessage = function(obj, replacer, indent) {\n var objectToJSON = void 0, arrayToJSON = void 0;\n try {\n if (\"{}\" !== JSON.stringify({})) {\n objectToJSON = Object.prototype.toJSON;\n delete Object.prototype.toJSON;\n }\n if (\"{}\" !== JSON.stringify({})) throw new Error(\"Can not correctly serialize JSON objects\");\n if (\"[]\" !== JSON.stringify([])) {\n arrayToJSON = Array.prototype.toJSON;\n delete Array.prototype.toJSON;\n }\n if (\"[]\" !== JSON.stringify([])) throw new Error(\"Can not correctly serialize JSON objects\");\n } catch (err) {\n throw new Error(\"Can not repair JSON.stringify: \" + err.message);\n }\n var result = JSON.stringify.call(this, obj, null, 2);\n try {\n objectToJSON && (Object.prototype.toJSON = objectToJSON);\n arrayToJSON && (Array.prototype.toJSON = arrayToJSON);\n } catch (err) {\n throw new Error(\"Can not repair JSON.stringify: \" + err.message);\n }\n return result;\n }(((_jsonStringify = {})[constants_CONSTANTS.WINDOW_PROPS.POSTROBOT] = message, \n _jsonStringify));\n return promise_ZalgoPromise.map(Object.keys(SEND_MESSAGE_STRATEGIES), function(strategyName) {\n return promise_ZalgoPromise.try(function() {\n if (!CONFIG.ALLOWED_POST_MESSAGE_METHODS[strategyName]) throw new Error(\"Strategy disallowed: \" + strategyName);\n return SEND_MESSAGE_STRATEGIES[strategyName](win, serializedMessage, domain);\n }).then(function() {\n messages.push(strategyName + \": success\");\n return !0;\n }, function(err) {\n messages.push(strategyName + \": \" + stringifyError(err) + \"\\n\");\n return !1;\n });\n }).then(function(results) {\n var success = results.some(Boolean), status = message.type + \" \" + message.name + \" \" + (success ? \"success\" : \"error\") + \":\\n - \" + messages.join(\"\\n - \") + \"\\n\";\n if (!success) throw new Error(status);\n });\n });\n }\n global.responseListeners = global.responseListeners || {};\n global.requestListeners = global.requestListeners || {};\n global.WINDOW_WILDCARD = global.WINDOW_WILDCARD || new function() {}();\n global.erroredResponseListeners = global.erroredResponseListeners || {};\n var _RECEIVE_MESSAGE_TYPE, __DOMAIN_REGEX__ = \"__domain_regex__\";\n function getResponseListener(hash) {\n return global.responseListeners[hash];\n }\n function deleteResponseListener(hash) {\n delete global.responseListeners[hash];\n }\n function isResponseListenerErrored(hash) {\n return Boolean(global.erroredResponseListeners[hash]);\n }\n function getRequestListener(_ref) {\n var name = _ref.name, win = _ref.win, domain = _ref.domain;\n win === constants_CONSTANTS.WILDCARD && (win = null);\n domain === constants_CONSTANTS.WILDCARD && (domain = null);\n if (!name) throw new Error(\"Name required to get request listener\");\n var nameListeners = global.requestListeners[name];\n if (nameListeners) for (var _i2 = 0, _ref3 = [ win, global.WINDOW_WILDCARD ], _length2 = null == _ref3 ? 0 : _ref3.length; _i2 < _length2; _i2++) {\n var winQualifier = _ref3[_i2], winListeners = winQualifier && nameListeners.get(winQualifier);\n if (winListeners) {\n if (domain && \"string\" == typeof domain) {\n if (winListeners[domain]) return winListeners[domain];\n if (winListeners[__DOMAIN_REGEX__]) for (var _i4 = 0, _winListeners$__DOMAI2 = winListeners[__DOMAIN_REGEX__], _length4 = null == _winListeners$__DOMAI2 ? 0 : _winListeners$__DOMAI2.length; _i4 < _length4; _i4++) {\n var _ref5 = _winListeners$__DOMAI2[_i4], regex = _ref5.regex, listener = _ref5.listener;\n if (matchDomain(regex, domain)) return listener;\n }\n }\n if (winListeners[constants_CONSTANTS.WILDCARD]) return winListeners[constants_CONSTANTS.WILDCARD];\n }\n }\n }\n var types__extends = Object.assign || function(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);\n }\n return target;\n }, RECEIVE_MESSAGE_TYPES = ((_RECEIVE_MESSAGE_TYPE = {})[constants_CONSTANTS.POST_MESSAGE_TYPE.ACK] = function(source, origin, message) {\n if (!isResponseListenerErrored(message.hash)) {\n var options = getResponseListener(message.hash);\n if (!options) throw new Error(\"No handler found for post message ack for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n if (!matchDomain(options.domain, origin)) throw new Error(\"Ack origin \" + origin + \" does not match domain \" + options.domain.toString());\n options.ack = !0;\n }\n }, _RECEIVE_MESSAGE_TYPE[constants_CONSTANTS.POST_MESSAGE_TYPE.REQUEST] = function(source, origin, message) {\n var options = getRequestListener({\n name: message.name,\n win: source,\n domain: origin\n });\n function respond(data) {\n return message.fireAndForget || isWindowClosed(source) ? promise_ZalgoPromise.resolve() : sendMessage(source, types__extends({\n target: message.originalSource,\n hash: message.hash,\n name: message.name\n }, data), origin);\n }\n return promise_ZalgoPromise.all([ respond({\n type: constants_CONSTANTS.POST_MESSAGE_TYPE.ACK\n }), promise_ZalgoPromise.try(function() {\n if (!options) throw new Error(\"No handler found for post message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n if (!matchDomain(options.domain, origin)) throw new Error(\"Request origin \" + origin + \" does not match domain \" + options.domain.toString());\n var data = message.data;\n return options.handler({\n source: source,\n origin: origin,\n data: data\n });\n }).then(function(data) {\n return respond({\n type: constants_CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,\n ack: constants_CONSTANTS.POST_MESSAGE_ACK.SUCCESS,\n data: data\n });\n }, function(err) {\n var error = stringifyError(err).replace(/^Error: /, \"\"), code = err.code;\n return respond({\n type: constants_CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,\n ack: constants_CONSTANTS.POST_MESSAGE_ACK.ERROR,\n error: error,\n code: code\n });\n }) ]).then(lib_util_noop).catch(function(err) {\n if (options && options.handleError) return options.handleError(err);\n throw err;\n });\n }, _RECEIVE_MESSAGE_TYPE[constants_CONSTANTS.POST_MESSAGE_TYPE.RESPONSE] = function(source, origin, message) {\n if (!isResponseListenerErrored(message.hash)) {\n var pattern, options = getResponseListener(message.hash);\n if (!options) throw new Error(\"No handler found for post message response for message: \" + message.name + \" from \" + origin + \" in \" + window.location.protocol + \"//\" + window.location.host + window.location.pathname);\n if (!matchDomain(options.domain, origin)) throw new Error(\"Response origin \" + origin + \" does not match domain \" + (pattern = options.domain, \n Array.isArray(pattern) ? \"(\" + pattern.join(\" | \") + \")\" : isRegex(pattern) ? \"RegExp(\" + pattern.toString() : pattern.toString()));\n deleteResponseListener(message.hash);\n if (message.ack === constants_CONSTANTS.POST_MESSAGE_ACK.ERROR) {\n var err = new Error(message.error);\n message.code && (err.code = message.code);\n return options.respond(err, null);\n }\n if (message.ack === constants_CONSTANTS.POST_MESSAGE_ACK.SUCCESS) {\n var data = message.data || message.response;\n return options.respond(null, {\n source: source,\n origin: origin,\n data: data\n });\n }\n }\n }, _RECEIVE_MESSAGE_TYPE), receive__typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(obj) {\n return typeof obj;\n } : function(obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n global.receivedMessages = global.receivedMessages || [];\n function receiveMessage(event) {\n if (window && !window.closed) {\n try {\n if (!event.source) return;\n } catch (err) {\n return;\n }\n var source = event.source, origin = event.origin, message = function(message) {\n var item, parsedMessage = void 0;\n try {\n parsedMessage = (item = message, JSON.parse(item));\n } catch (err) {\n return;\n }\n if (parsedMessage && \"object\" === (void 0 === parsedMessage ? \"undefined\" : receive__typeof(parsedMessage)) && null !== parsedMessage && (parsedMessage = parsedMessage[constants_CONSTANTS.WINDOW_PROPS.POSTROBOT]) && \"object\" === (void 0 === parsedMessage ? \"undefined\" : receive__typeof(parsedMessage)) && null !== parsedMessage && parsedMessage.type && \"string\" == typeof parsedMessage.type && RECEIVE_MESSAGE_TYPES[parsedMessage.type]) return parsedMessage;\n }(event.data);\n if (message) {\n if (!message.sourceDomain || \"string\" != typeof message.sourceDomain) throw new Error(\"Expected message to have sourceDomain\");\n 0 !== message.sourceDomain.indexOf(constants_CONSTANTS.MOCK_PROTOCOL) && 0 !== message.sourceDomain.indexOf(constants_CONSTANTS.FILE_PROTOCOL) || (origin = message.sourceDomain);\n if (-1 === global.receivedMessages.indexOf(message.id)) {\n global.receivedMessages.push(message.id);\n if (!isWindowClosed(source) || message.fireAndForget) {\n message.data && (message.data = function(source, origin, obj) {\n return replaceObject({\n obj: message.data\n }, function(item) {\n if (\"object\" === (void 0 === item ? \"undefined\" : serialize__typeof(item)) && null !== item) return isSerialized(item, constants_CONSTANTS.SERIALIZATION_TYPES.METHOD) ? deserializeMethod(source, origin, item) : isSerialized(item, constants_CONSTANTS.SERIALIZATION_TYPES.ERROR) ? function(source, origin, obj) {\n var err = new Error(obj.__message__);\n obj.__code__ && (err.code = obj.__code__);\n return err;\n }(0, 0, item) : isSerialized(item, constants_CONSTANTS.SERIALIZATION_TYPES.PROMISE) ? function(source, origin, prom) {\n return window.Promise ? new window.Promise(function(resolve, reject) {\n return deserializeMethod(source, origin, prom.__then__)(resolve, reject);\n }) : deserializeZalgoPromise(source, origin, prom);\n }(source, origin, item) : isSerialized(item, constants_CONSTANTS.SERIALIZATION_TYPES.ZALGO_PROMISE) ? deserializeZalgoPromise(source, origin, item) : isSerialized(item, constants_CONSTANTS.SERIALIZATION_TYPES.REGEX) ? function(source, origin, item) {\n return new RegExp(item.__source__);\n }(0, 0, item) : void 0;\n }).obj;\n }(source, origin));\n RECEIVE_MESSAGE_TYPES[message.type](source, origin, message);\n }\n }\n }\n }\n }\n function messageListener(event) {\n try {\n event.source;\n } catch (err) {\n return;\n }\n receiveMessage({\n source: event.source || event.sourceElement,\n origin: event.origin || event.originalEvent && event.originalEvent.origin,\n data: event.data\n });\n }\n global.receiveMessage = receiveMessage;\n global.requestPromises = global.requestPromises || new weakmap_CrossDomainSafeWeakMap();\n function request(options) {\n return promise_ZalgoPromise.try(function() {\n if (!options.name) throw new Error(\"Expected options.name\");\n var name = options.name, targetWindow = void 0, domain = void 0;\n if (\"string\" == typeof options.window) {\n var el = document.getElementById(options.window);\n if (!el) throw new Error(\"Expected options.window \" + Object.prototype.toString.call(options.window) + \" to be a valid element id\");\n if (\"iframe\" !== el.tagName.toLowerCase()) throw new Error(\"Expected options.window \" + Object.prototype.toString.call(options.window) + \" to be an iframe\");\n if (!el.contentWindow) throw new Error(\"Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.\");\n targetWindow = el.contentWindow;\n } else if (options.window instanceof HTMLIFrameElement) {\n if (\"iframe\" !== options.window.tagName.toLowerCase()) throw new Error(\"Expected options.window \" + Object.prototype.toString.call(options.window) + \" to be an iframe\");\n if (options.window && !options.window.contentWindow) throw new Error(\"Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.\");\n options.window && options.window.contentWindow && (targetWindow = options.window.contentWindow);\n } else targetWindow = options.window;\n if (!targetWindow) throw new Error(\"Expected options.window to be a window object, iframe, or iframe element id.\");\n var win = targetWindow;\n domain = options.domain || constants_CONSTANTS.WILDCARD;\n var hash = options.name + \"_\" + uniqueID();\n if (isWindowClosed(win)) throw new Error(\"Target window is closed\");\n var hasResult = !1, requestPromises = global.requestPromises.get(win);\n if (!requestPromises) {\n requestPromises = [];\n global.requestPromises.set(win, requestPromises);\n }\n var requestPromise = promise_ZalgoPromise.try(function() {\n if (function(parent, child) {\n var actualParent = getAncestor(child);\n if (actualParent) return actualParent === parent;\n if (child === parent) return !1;\n if (function() {\n var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window;\n try {\n if (win.top) return win.top;\n } catch (err) {}\n if (getParent(win) === win) return win;\n try {\n if (isAncestorParent(window, win) && window.top) return window.top;\n } catch (err) {}\n try {\n if (isAncestorParent(win, window) && window.top) return window.top;\n } catch (err) {}\n for (var _i7 = 0, _getAllChildFrames4 = function getAllChildFrames(win) {\n for (var result = [], _i3 = 0, _getFrames2 = getFrames(win), _length2 = null == _getFrames2 ? 0 : _getFrames2.length; _i3 < _length2; _i3++) {\n var frame = _getFrames2[_i3];\n result.push(frame);\n for (var _i5 = 0, _getAllChildFrames2 = getAllChildFrames(frame), _length4 = null == _getAllChildFrames2 ? 0 : _getAllChildFrames2.length; _i5 < _length4; _i5++) {\n var childFrame = _getAllChildFrames2[_i5];\n result.push(childFrame);\n }\n }\n return result;\n }(win), _length6 = null == _getAllChildFrames4 ? 0 : _getAllChildFrames4.length; _i7 < _length6; _i7++) {\n var frame = _getAllChildFrames4[_i7];\n try {\n if (frame.top) return frame.top;\n } catch (err) {}\n if (getParent(frame) === frame) return frame;\n }\n }(child) === child) return !1;\n for (var _i15 = 0, _getFrames8 = getFrames(parent), _length14 = null == _getFrames8 ? 0 : _getFrames8.length; _i15 < _length14; _i15++) if (_getFrames8[_i15] === child) return !0;\n return !1;\n }(window, win)) return function(win) {\n var timeout = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 5e3, name = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : \"Window\", promise = global.readyPromises.get(win);\n if (promise) return promise;\n promise = new promise_ZalgoPromise();\n global.readyPromises.set(win, promise);\n -1 !== timeout && setTimeout(function() {\n return promise.reject(new Error(name + \" did not load after \" + timeout + \"ms\"));\n }, timeout);\n return promise;\n }(win, options.timeout || CONFIG.CHILD_WINDOW_TIMEOUT);\n }).then(function() {\n var origin = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).origin;\n if (util_isRegex(domain) && !origin) return sayHello(win);\n }).then(function() {\n var origin = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).origin;\n if (util_isRegex(domain)) {\n if (!matchDomain(domain, origin)) throw new Error(\"Remote window domain \" + origin + \" does not match regex: \" + domain.toString());\n domain = origin;\n }\n if (\"string\" != typeof domain && !Array.isArray(domain)) throw new TypeError(\"Expected domain to be a string or array\");\n var actualDomain = domain;\n return new promise_ZalgoPromise(function(resolve, reject) {\n var responseListener = void 0;\n options.fireAndForget || function(hash, listener) {\n global.responseListeners[hash] = listener;\n }(hash, responseListener = {\n name: name,\n window: win,\n domain: actualDomain,\n respond: function(err, result) {\n if (!err) {\n hasResult = !0;\n requestPromises.splice(requestPromises.indexOf(requestPromise, 1));\n }\n err ? reject(err) : resolve(result);\n }\n });\n sendMessage(win, {\n type: constants_CONSTANTS.POST_MESSAGE_TYPE.REQUEST,\n hash: hash,\n name: name,\n data: options.data,\n fireAndForget: options.fireAndForget\n }, actualDomain).catch(reject);\n if (options.fireAndForget) return resolve();\n var ackTimeout = CONFIG.ACK_TIMEOUT, resTimeout = options.timeout || CONFIG.RES_TIMEOUT, cycleTime = 100;\n setTimeout(function cycle() {\n if (!hasResult) {\n if (isWindowClosed(win)) return responseListener.ack ? reject(new Error(\"Window closed for \" + name + \" before response\")) : reject(new Error(\"Window closed for \" + name + \" before ack\"));\n ackTimeout = Math.max(ackTimeout - cycleTime, 0);\n -1 !== resTimeout && (resTimeout = Math.max(resTimeout - cycleTime, 0));\n if (responseListener.ack) {\n if (-1 === resTimeout) return;\n cycleTime = Math.min(resTimeout, 2e3);\n } else {\n if (0 === ackTimeout) return reject(new Error(\"No ack for postMessage \" + name + \" in \" + utils_getDomain() + \" in \" + CONFIG.ACK_TIMEOUT + \"ms\"));\n if (0 === resTimeout) return reject(new Error(\"No response for postMessage \" + name + \" in \" + utils_getDomain() + \" in \" + (options.timeout || CONFIG.RES_TIMEOUT) + \"ms\"));\n }\n setTimeout(cycle, cycleTime);\n }\n }, cycleTime);\n });\n });\n requestPromise.catch(function() {\n !function(hash) {\n global.erroredResponseListeners[hash] = !0;\n }(hash);\n deleteResponseListener(hash);\n });\n requestPromises.push(requestPromise);\n return requestPromise;\n });\n }\n function _send(window, name, data, options) {\n (options = options || {}).window = window;\n options.name = name;\n options.data = data;\n return request(options);\n }\n function sendToParent(name, data, options) {\n var win = getAncestor();\n return win ? _send(win, name, data, options) : new promise_ZalgoPromise(function(resolve, reject) {\n return reject(new Error(\"Window does not have a parent\"));\n });\n }\n function client() {\n var options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};\n if (!options.window) throw new Error(\"Expected options.window\");\n var win = options.window;\n return {\n send: function(name, data) {\n return _send(win, name, data, options);\n }\n };\n }\n global.send = _send;\n var server__typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(obj) {\n return typeof obj;\n } : function(obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n function listen(options) {\n if (!options.name) throw new Error(\"Expected options.name\");\n if (!options.handler) throw new Error(\"Expected options.handler\");\n var name = options.name, win = options.window, domain = options.domain, listenerOptions = {\n handler: options.handler,\n handleError: options.errorHandler || function(err) {\n throw err;\n },\n window: win,\n domain: domain || constants_CONSTANTS.WILDCARD,\n name: name\n }, requestListener = function addRequestListener(_ref6, listener) {\n var name = _ref6.name, win = _ref6.win, domain = _ref6.domain;\n if (!name || \"string\" != typeof name) throw new Error(\"Name required to add request listener\");\n if (Array.isArray(win)) {\n for (var listenersCollection = [], _i6 = 0, _win2 = win, _length6 = null == _win2 ? 0 : _win2.length; _i6 < _length6; _i6++) {\n var item = _win2[_i6];\n listenersCollection.push(addRequestListener({\n name: name,\n domain: domain,\n win: item\n }, listener));\n }\n return {\n cancel: function() {\n for (var _i8 = 0, _length8 = null == listenersCollection ? 0 : listenersCollection.length; _i8 < _length8; _i8++) listenersCollection[_i8].cancel();\n }\n };\n }\n if (Array.isArray(domain)) {\n for (var _listenersCollection = [], _i10 = 0, _domain2 = domain, _length10 = null == _domain2 ? 0 : _domain2.length; _i10 < _length10; _i10++) {\n var _item = _domain2[_i10];\n _listenersCollection.push(addRequestListener({\n name: name,\n win: win,\n domain: _item\n }, listener));\n }\n return {\n cancel: function() {\n for (var _i12 = 0, _length12 = null == _listenersCollection ? 0 : _listenersCollection.length; _i12 < _length12; _i12++) _listenersCollection[_i12].cancel();\n }\n };\n }\n var existingListener = getRequestListener({\n name: name,\n win: win,\n domain: domain\n });\n win && win !== constants_CONSTANTS.WILDCARD || (win = global.WINDOW_WILDCARD);\n domain = domain || constants_CONSTANTS.WILDCARD;\n if (existingListener) throw win && domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString() + \" for \" + (win === global.WINDOW_WILDCARD ? \"wildcard\" : \"specified\") + \" window\") : win ? new Error(\"Request listener already exists for \" + name + \" for \" + (win === global.WINDOW_WILDCARD ? \"wildcard\" : \"specified\") + \" window\") : domain ? new Error(\"Request listener already exists for \" + name + \" on domain \" + domain.toString()) : new Error(\"Request listener already exists for \" + name);\n var requestListeners = global.requestListeners, nameListeners = requestListeners[name];\n if (!nameListeners) {\n nameListeners = new weakmap_CrossDomainSafeWeakMap();\n requestListeners[name] = nameListeners;\n }\n var winListeners = nameListeners.get(win);\n if (!winListeners) {\n winListeners = {};\n nameListeners.set(win, winListeners);\n }\n var strDomain = domain.toString(), regexListeners = winListeners[__DOMAIN_REGEX__], regexListener = void 0;\n if (util_isRegex(domain)) {\n if (!regexListeners) {\n regexListeners = [];\n winListeners[__DOMAIN_REGEX__] = regexListeners;\n }\n regexListener = {\n regex: domain,\n listener: listener\n };\n regexListeners.push(regexListener);\n } else winListeners[strDomain] = listener;\n return {\n cancel: function() {\n if (winListeners) {\n delete winListeners[strDomain];\n win && 0 === Object.keys(winListeners).length && nameListeners.delete(win);\n regexListener && regexListeners.splice(regexListeners.indexOf(regexListener, 1));\n }\n }\n };\n }({\n name: name,\n win: win,\n domain: domain\n }, listenerOptions);\n if (options.once) {\n var _handler = listenerOptions.handler;\n listenerOptions.handler = once(function() {\n requestListener.cancel();\n return _handler.apply(this, arguments);\n });\n }\n if (listenerOptions.window && options.errorOnClose) var interval = function(method, time) {\n var timeout = void 0;\n timeout = setTimeout(function runInterval() {\n timeout = setTimeout(runInterval, 50);\n (function() {\n if (win && \"object\" === (void 0 === win ? \"undefined\" : server__typeof(win)) && isWindowClosed(win)) {\n interval.cancel();\n listenerOptions.handleError(new Error(\"Post message target window is closed\"));\n }\n }).call();\n }, 50);\n return {\n cancel: function() {\n clearTimeout(timeout);\n }\n };\n }();\n return {\n cancel: function() {\n requestListener.cancel();\n }\n };\n }\n function _on(name, options, handler) {\n if (\"function\" == typeof options) {\n handler = options;\n options = {};\n }\n (options = options || {}).name = name;\n options.handler = handler || options.handler;\n return listen(options);\n }\n function server_once(name) {\n var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, handler = arguments[2];\n if (\"function\" == typeof options) {\n handler = options;\n options = {};\n }\n options = options || {};\n handler = handler || options.handler;\n var errorHandler = options.errorHandler, promise = new promise_ZalgoPromise(function(resolve, reject) {\n (options = options || {}).name = name;\n options.once = !0;\n options.handler = function(event) {\n resolve(event);\n if (handler) return handler(event);\n };\n options.errorHandler = function(err) {\n reject(err);\n if (errorHandler) return errorHandler(err);\n };\n }), onceListener = listen(options);\n promise.cancel = onceListener.cancel;\n return promise;\n }\n function server_listener() {\n var options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};\n return {\n on: function(name, handler) {\n return _on(name, options, handler);\n }\n };\n }\n global.on = _on;\n function disable() {\n delete window[constants_CONSTANTS.WINDOW_PROPS.POSTROBOT];\n window.removeEventListener(\"message\", messageListener);\n }\n var public_parent = getAncestor();\n function cleanUpWindow(win) {\n var requestPromises = global.requestPromises.get(win);\n if (requestPromises) for (var _i2 = 0, _length2 = null == requestPromises ? 0 : requestPromises.length; _i2 < _length2; _i2++) requestPromises[_i2].reject(new Error(\"No response from window - cleaned up\"));\n global.popupWindowsByWin && global.popupWindowsByWin.delete(win);\n global.remoteWindows && global.remoteWindows.delete(win);\n global.requestPromises.delete(win);\n global.methods.delete(win);\n global.readyPromises.delete(win);\n }\n var bridge = null;\n function init() {\n if (!global.initialized) {\n handler = messageListener, (obj = window).addEventListener ? obj.addEventListener(\"message\", handler) : obj.attachEvent(\"onmessage\", handler);\n !function() {\n handler = function(_ref3) {\n var source = _ref3.source, origin = _ref3.origin, promise = global.readyPromises.get(source) || new promise_ZalgoPromise();\n promise.resolve({\n origin: origin\n });\n global.readyPromises.set(source, promise);\n }, global.on(constants_CONSTANTS.POST_MESSAGE_NAMES.HELLO, {\n domain: constants_CONSTANTS.WILDCARD\n }, function(_ref) {\n var source = _ref.source, origin = _ref.origin;\n return handler({\n source: source,\n origin: origin\n });\n });\n var handler, parent = getAncestor();\n parent && sayHello(parent).catch(lib_util_noop);\n }();\n listenForMethods({\n on: _on,\n send: _send\n });\n }\n var obj, handler;\n global.initialized = !0;\n }\n init();\n __webpack_require__.d(__webpack_exports__, \"cleanUpWindow\", function() {\n return cleanUpWindow;\n });\n __webpack_require__.d(__webpack_exports__, \"Promise\", function() {\n return promise_ZalgoPromise;\n });\n __webpack_require__.d(__webpack_exports__, \"bridge\", function() {\n return bridge;\n });\n __webpack_require__.d(__webpack_exports__, \"init\", function() {\n return init;\n });\n __webpack_require__.d(__webpack_exports__, \"parent\", function() {\n return public_parent;\n });\n __webpack_require__.d(__webpack_exports__, \"send\", function() {\n return _send;\n });\n __webpack_require__.d(__webpack_exports__, \"request\", function() {\n return request;\n });\n __webpack_require__.d(__webpack_exports__, \"sendToParent\", function() {\n return sendToParent;\n });\n __webpack_require__.d(__webpack_exports__, \"client\", function() {\n return client;\n });\n __webpack_require__.d(__webpack_exports__, \"on\", function() {\n return _on;\n });\n __webpack_require__.d(__webpack_exports__, \"listen\", function() {\n return listen;\n });\n __webpack_require__.d(__webpack_exports__, \"once\", function() {\n return server_once;\n });\n __webpack_require__.d(__webpack_exports__, \"listener\", function() {\n return server_listener;\n });\n __webpack_require__.d(__webpack_exports__, \"CONFIG\", function() {\n return CONFIG;\n });\n __webpack_require__.d(__webpack_exports__, \"CONSTANTS\", function() {\n return constants_CONSTANTS;\n });\n __webpack_require__.d(__webpack_exports__, \"disable\", function() {\n return disable;\n });\n __webpack_exports__.default = interface_namespaceObject;\n }\n });\n});\n//# sourceMappingURL=post-robot.js.map","/* @flow */\n\n// eslint-disable-next-line import/no-commonjs\nmodule.exports = require('./dist/post-robot');\n\n// eslint-disable-next-line import/no-commonjs\nmodule.exports.default = module.exports;\n","import EventEmitter from \"wolfy87-eventemitter\";\nimport { IAssetSidebarInitData, setAssetDto } from \"./types\";\nimport postRobot from \"post-robot\";\nimport Asset from \"./stack/api/asset\";\nimport { Asset as AssetType } from \"./types/stack.types\";\nimport { GenericObjectType } from \"./types/common.types\";\n\n/** Class representing an Asset Sidebar UI Location from Contentstack UI. */\n\nclass AssetSidebarWidget {\n /**\n * @hideconstructor\n */\n\n currentAsset: AssetType;\n _emitter: EventEmitter;\n _connection: typeof postRobot;\n _changedData?: GenericObjectType;\n\n constructor(\n initializationData: IAssetSidebarInitData,\n connection: typeof postRobot,\n emitter: EventEmitter\n ) {\n /**\n * Gets the content type of the current asset.\n * @type {Object}\n */\n\n this.currentAsset = initializationData.currentAsset;\n\n this._emitter = emitter;\n\n this._connection = connection;\n\n const thisAsset = this;\n\n this._emitter.on(\"assetSave\", (event: { data: AssetType }) => {\n thisAsset.currentAsset = event.data;\n });\n\n this._emitter.on(\"assetChange\", (event: { data: AssetType }) => {\n thisAsset._changedData = event.data;\n });\n\n this.getData = this.getData.bind(this);\n this.setData = this.setData.bind(this);\n this.syncAsset = this.syncAsset.bind(this);\n this.updateWidth = this.updateWidth.bind(this);\n this.onSave = this.onSave.bind(this);\n this.onChange = this.onChange.bind(this);\n this.onPublish = this.onPublish.bind(this);\n this.onUnPublish = this.onUnPublish.bind(this);\n this.replaceAsset = this.replaceAsset.bind(this);\n }\n\n /**\n * Get the current asset data.\n * @returns {AssetData} The current asset data.\n */\n getData(): AssetType {\n return this.currentAsset;\n }\n\n /**\n * Set data for the asset.\n * @param {Partial} asset - The partial asset data to set.\n * @returns {Promise} A promise that resolves when the data is set successfully.\n */\n async setData(asset: Partial): Promise {\n await this._connection.sendToParent(\"setData\", asset);\n }\n\n /**\n * Synchronize the asset with the parent application in the Contentstack UI.\n * @returns {Promise} A promise that resolves when the synchronization is complete.\n */\n async syncAsset(): Promise {\n await this._connection.sendToParent(\"syncAsset\");\n }\n\n /**\n * Update the width of the Asset Sidebar widget in the Contentstack UI.\n * @param {number} width - The new width of the asset sidebar.\n * @throws {Error} Throws an error if the width parameter is not a number.\n * @returns {Promise} A promise that resolves when the width is updated successfully.\n */\n async updateWidth(width: number): Promise {\n if (typeof width !== \"number\") {\n throw new Error(\"Width must be a number\");\n }\n await this._connection.sendToParent(\n \"updateAssetSidebarWidth\",\n width as any\n );\n }\n\n /**\n * Replace the current asset with a new file.\n * @param {File} file - The file to be used as the replacement asset.\n * @returns {Promise} A promise that resolves when the replacement is complete.\n */\n async replaceAsset(file: File): Promise {\n const asset = Asset(this._emitter);\n await asset.handleUpload([file], \"replace\");\n }\n\n /**\n * Executes the provided callback function every time an asset is saved.\n * @param {function} callback - The function to be called when an asset is saved.\n * @param {AssetType} arg0 - The asset data passed as an argument to the callback function when an asset is saved.\n */\n onSave(callback: (arg0: AssetType) => void) {\n const assetObj = this;\n if (callback && typeof callback === \"function\") {\n assetObj._emitter.on(\"assetSave\", (event: { data: any }) => {\n callback(event.data);\n });\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n\n /**\n * Registers a callback function to be executed whenever there is a change made to the Asset.\n * @param {function} callback - The function to be called when the asset is edited or changed.\n * @param {AssetType} arg0 - The asset data passed as an argument to the callback function when the asset is edited or changed.\n */\n onChange(callback: (arg0: AssetType) => void) {\n const assetObj = this;\n if (callback && typeof callback === \"function\") {\n assetObj._emitter.on(\n \"assetChange\",\n (event: { data: AssetType }) => {\n callback(event.data);\n }\n );\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n\n /**\n * The onPublish() function executes the callback function every time an asset has been published with the respective payload.\n * @param {function} callback - The function to be called when an asset is published.\n * @param {AssetType} arg0 - The data of the published asset passed as an argument to the callback function.\n */\n onPublish(callback: (arg0: AssetType) => void) {\n const assetObj = this;\n if (callback && typeof callback === \"function\") {\n assetObj._emitter.on(\n \"assetPublish\",\n (event: { data: AssetType }) => {\n callback(event.data);\n }\n );\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n\n /**\n * The `onUnPublish()` function executes the provided callback every time an asset is unpublished.\n * @param {function} callback - The function to be called when an asset is unpublished.\n * @param {AssetType} arg0 - The data of the unpublished asset passed as an argument to the callback function.\n */\n onUnPublish(callback: (arg0: AssetType) => void) {\n const assetObj = this;\n if (callback && typeof callback === \"function\") {\n assetObj._emitter.on(\n \"assetUnPublish\",\n (event: { data: AssetType }) => {\n callback(event.data);\n }\n );\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n}\n\nexport default AssetSidebarWidget;\n","import {\n IConfigCallback,\n IContainerMetaData,\n IOnFunction,\n IPluginMetaData,\n IRteParam,\n IConfig,\n} from \"./types\";\n\nexport class RTEPlugin {\n private pluginMetaData: IPluginMetaData = {\n registry: {\n title: \"\",\n toolbar: {\n inMainToolbar: true,\n inHoveringToolbar: true,\n },\n isContentstackElement: true,\n },\n meta: {\n id: \"\",\n elementType: null,\n editorCallbacks: {},\n isDependent: false,\n },\n };\n private isContainer: boolean = false;\n private containerMetaData: IContainerMetaData = {\n registry: {\n id: this.pluginMetaData.meta.id,\n title: this.pluginMetaData.registry.title,\n rootCategory: false,\n toolbar: {\n ...this.pluginMetaData.registry.toolbar,\n },\n },\n meta: {\n id: this.pluginMetaData.meta.id,\n dependentPlugins: [],\n },\n };\n\n constructor(id: string, private configCallback: IConfigCallback) {\n this.pluginMetaData.meta.id = id;\n }\n\n addPlugins = (...plugins: RTEPlugin[]) => {\n // convert to dropdown if not already\n if (this.pluginMetaData.meta.isDependent)\n throw Error(\"cannot have another container inside\");\n\n this.isContainer = true;\n\n // clean pluginMetaData\n\n plugins.forEach((plugin) => {\n // make sure that this plugin is not another dropdown\n if (plugin.isContainer) {\n throw Error(\"cannot have another container inside\");\n }\n\n plugin.pluginMetaData.registry.category =\n this.pluginMetaData.meta.id;\n this.containerMetaData.meta.dependentPlugins.push(plugin);\n plugin.pluginMetaData.meta.isDependent = true;\n });\n };\n\n on = (\n type: Type,\n callback: IOnFunction[Type]\n ) => {\n switch (type) {\n case \"beforeChildRender\": {\n this.pluginMetaData.registry.beforeChildrenRender = callback;\n break;\n }\n\n case \"beforeRender\": {\n this.pluginMetaData.registry.beforeElementRender = callback;\n break;\n }\n\n case \"exec\": {\n this.pluginMetaData.registry.handleMouseDown = callback;\n break;\n }\n\n case \"keydown\": {\n this.pluginMetaData.meta.editorCallbacks[\"keydown\"] = callback;\n break;\n }\n\n case \"paste\":\n case \"deleteBackward\":\n case \"deleteForward\":\n case \"insertBreak\":\n case \"normalize\":\n default: {\n this.pluginMetaData.meta.editorCallbacks[type] = callback;\n break;\n }\n }\n };\n\n get = async (rte: IRteParam | void) => {\n const config = await this.configCallback(rte);\n\n Object.entries(config).forEach(\n //@ts-ignore\n ([key, value]: [Key, any]) => {\n switch (key) {\n case \"title\": {\n this.pluginMetaData.registry.title = value;\n break;\n }\n case \"icon\": {\n this.pluginMetaData.registry.iconName = value;\n this.containerMetaData.registry.iconName = value;\n break;\n }\n case \"display\": {\n // make every other options false\n this.pluginMetaData.registry.toolbar = {\n inHoveringToolbar: false,\n inMainToolbar: false,\n };\n\n if (typeof value === \"string\") {\n switch (value) {\n case \"toolbar\": {\n this.pluginMetaData.registry.toolbar.inMainToolbar =\n true;\n break;\n }\n case \"hoveringToolbar\": {\n this.pluginMetaData.registry.toolbar.inHoveringToolbar =\n true;\n break;\n }\n }\n } else if (Array.isArray(value)) {\n value.forEach((display) => {\n switch (display) {\n case \"toolbar\": {\n this.pluginMetaData.registry.toolbar.inMainToolbar =\n true;\n break;\n }\n case \"hoveringToolbar\": {\n this.pluginMetaData.registry.toolbar.inHoveringToolbar =\n true;\n break;\n }\n }\n });\n }\n break;\n }\n\n case \"elementType\": {\n const isInline =\n (typeof value === \"string\" && value === \"inline\") ||\n (Array.isArray(value) && value.includes(\"inline\"));\n if (isInline) {\n let dndOptions =\n this.pluginMetaData[\"registry\"][\"dndOptions\"];\n if (!dndOptions) {\n this.pluginMetaData[\"registry\"][\"dndOptions\"] =\n {};\n dndOptions =\n this.pluginMetaData[\"registry\"][\n \"dndOptions\"\n ];\n }\n dndOptions[\"DisableDND\"] = true;\n dndOptions[\"DisableSelectionHalo\"] = true;\n }\n this.pluginMetaData.meta.elementType = value;\n break;\n }\n\n case \"render\": {\n this.pluginMetaData.registry.Component = value;\n break;\n }\n\n case \"shouldOverride\": {\n this.pluginMetaData.registry.shouldOverride = value;\n }\n }\n }\n );\n\n const containerMeta = this.containerMetaData.meta;\n this.containerMetaData = {\n registry: {\n ...this.containerMetaData.registry,\n id: this.pluginMetaData.meta.id,\n title: this.pluginMetaData.registry.title,\n rootCategory: false,\n toolbar: {\n ...this.pluginMetaData.registry.toolbar,\n },\n },\n meta: {\n ...containerMeta,\n id: this.pluginMetaData.meta.id,\n },\n };\n\n return this.isContainer ? this.containerMetaData : this.pluginMetaData;\n };\n}\n\nexport const rtePluginInitializer = (\n id: string,\n configCallback: IConfigCallback\n) => {\n if (!(id && configCallback))\n throw Error('Please provide value \"id\" and \"configCallback\"');\n\n return new RTEPlugin(id, configCallback);\n};\n","import postRobot from \"post-robot\";\n\nimport Stack from \"../stack\";\nimport {\n IInstallationData,\n ValidationOptions,\n IAppConfigInitData,\n} from \"../types\";\nimport generateErrorMessages, { ERROR_MESSAGES } from \"../utils/errorMessages\";\nimport { onData, onError } from \"../utils/utils\";\n\nexport declare interface AppConfigAdditionalData {\n currentBranch: string;\n}\n\n/**\n * Class representing the current stack in Contentstack UI.\n */\n\nexport class AppConfig {\n _data: IAppConfigInitData;\n _connection: typeof postRobot;\n _emitter: EventEmitter;\n private _additionalData: AppConfigAdditionalData;\n\n constructor(\n data: IAppConfigInitData,\n connection: typeof postRobot,\n emitter: EventEmitter,\n additionalData: AppConfigAdditionalData\n ) {\n this._data = data;\n this._connection = connection;\n this._emitter = emitter;\n this._additionalData = additionalData;\n\n this.setValidity = this.setValidity.bind(this);\n }\n\n stack = () => {\n return new Stack(this._data.stack, this._connection, {\n currentBranch: this._additionalData.currentBranch,\n });\n };\n\n setInstallationData = (\n installationData: IInstallationData\n ): Promise => {\n return this._connection\n .sendToParent(\n \"setInstallationData\",\n installationData\n )\n .then(onData)\n .catch(onError);\n };\n\n getInstallationData = (): Promise => {\n return this._connection\n .sendToParent(\"getInstallationData\")\n .then(onData)\n .catch(onError);\n };\n\n /**\n * Sets the validation state of the app. If the validation is false, the Contentstack App Config\n * will not allow saving the configuration. The message will be displayed if provided.\n * @param {boolean} isValid - The validation state of the app.\n * @param {ValidationOptions} options - Additional options to be sent to the parent.\n * @returns {Promise} - A promise that resolves to void.\n */\n async setValidity(\n isValid: boolean,\n options?: ValidationOptions\n ): Promise {\n if (typeof isValid !== \"boolean\") {\n throw new TypeError(\n generateErrorMessages(\n ERROR_MESSAGES.configPage.setValidity.isValidTypeBoolean\n )\n );\n }\n\n if (options?.message && typeof options.message !== \"string\") {\n throw new TypeError(\n generateErrorMessages(\n ERROR_MESSAGES.configPage.setValidity.messageTypeString\n )\n );\n }\n\n await this._connection\n .sendToParent(\"setValidity\", { isValid, options })\n .then(onData)\n .catch(onError);\n }\n}\n","import EventEmitter from \"wolfy87-eventemitter\";\nimport postRobot from \"post-robot\";\n\nimport Field from \"./field\";\nimport {\n IFieldInitData,\n IFieldModifierLocationInitData,\n ISidebarInitData,\n} from \"./types\";\nimport { Entry as EntryType } from \"../src/types/entry.types\";\nimport {\n IEntryOptions,\n IGetFieldOptions,\n IOnEntryChangeCallback,\n} from \"./types/entry.types\";\nimport { ContentType, PublishDetails, Schema } from \"./types/stack.types\";\nimport { GenericObjectType } from \"./types/common.types\";\n\n/** Class representing an entry from Contentstack UI. Not available for Dashboard UI Location. */\n\nclass Entry {\n /**\n * @hideconstructor\n */\n\n content_type: ContentType;\n _data: EntryType;\n locale: string;\n _connection: typeof postRobot;\n _emitter: EventEmitter;\n _changedData?: GenericObjectType;\n _options: IEntryOptions;\n\n constructor(\n initializationData:\n | IFieldInitData\n | ISidebarInitData\n | IFieldModifierLocationInitData,\n connection: typeof postRobot,\n emitter: EventEmitter,\n options?: IEntryOptions\n ) {\n /**\n * Gets the content type of the current entry.\n * @type {Object}\n */\n this.content_type = initializationData.content_type;\n\n this._data = initializationData.entry;\n\n if (\n (initializationData as IFieldModifierLocationInitData).changedData\n ) {\n this._changedData = (\n initializationData as IFieldModifierLocationInitData\n ).changedData;\n }\n\n /**\n * Gets the locale of the current entry.\n * @type {string}\n */\n this.locale = initializationData.locale;\n\n this._connection = connection;\n\n this._emitter = emitter;\n\n this._options = options || {};\n\n const thisEntry = this;\n\n this._emitter.on(\"entrySave\", (event: { data: EntryType }) => {\n thisEntry._data = event.data;\n });\n\n this._emitter.on(\"entryChange\", (event: { data: EntryType }) => {\n thisEntry._changedData = event.data;\n });\n }\n\n /**\n * Gets data of the current entry.\n * @return {Object} Returns entry data.\n */\n\n getData() {\n return this._data;\n }\n\n /**\n * Gets the field object for the saved data, which allows you to interact with the field.\n * This object will have all the same methods and properties of appSDK.location.CustomField.field.\n * Note: For fields initialized using the getFields function, the setData function currently works only for the following fields: as single_line, multi_line, RTE, markdown, select, number, boolean, date, link, and Custom Field UI Location of data type text, number, boolean, and date.\n * @example\n * var field = entry.getField('field_uid');\n * var fieldSchema = field.schema;\n * var fieldUid = field.uid;\n * var fieldData = field.getData();\n * @param {string} uid Unique ID of the field\n * @param {boolean} options.useUnsavedSchema If set to true, the field will get the unsaved field\n * @return {Object} Field object\n */\n\n getField(uid: string, options?: IGetFieldOptions): Field {\n const { useUnsavedSchema = false } = options || {};\n const { FieldInstance = Field } = this._options._internalFlags || {};\n\n const path = uid.split(\".\");\n let value = useUnsavedSchema\n ? this._changedData || this._data\n : this._data;\n let schema: Schema[0] = this.content_type.schema;\n\n const isDataEmpty = Object.keys(value).length === 0;\n\n if (isDataEmpty) {\n throw new Error(\n \"The data is unsaved. Save the data before requesting the field.\"\n );\n }\n\n try {\n let skipNext = false;\n let skipNextTwo = false;\n path.forEach((key: string | number, index: number) => {\n if (skipNext) {\n if (skipNextTwo) {\n skipNextTwo = false;\n } else {\n skipNext = false;\n }\n return;\n }\n\n schema = schema.find((x: { uid: any }) => x.uid === key);\n if (!schema) {\n throw Error(\"schema not found\");\n }\n\n value = value[key];\n\n if (\n (schema.data_type === \"group\" ||\n schema.data_type === \"global_field\") &&\n schema.multiple === false &&\n path.length !== index + 1\n ) {\n schema = schema.schema;\n } else if (\n (schema.data_type === \"group\" ||\n schema.data_type === \"global_field\") &&\n schema.multiple === true &&\n path.length !== index + 1\n ) {\n schema = schema.schema;\n value = value[path[index + 1]];\n skipNext = true;\n } else if (\n schema.data_type === \"blocks\" &&\n path.length !== index + 1\n ) {\n const blockId = Object.keys(value[path[index + 1]])[0];\n schema = schema.blocks.find(\n (block: { uid: string }) => block.uid === blockId\n );\n if (path.length === index + 2) {\n // complete block value with uid\n value = value[path[index + 1]];\n } else {\n // block value without uid\n value = value[path[index + 1]][blockId];\n schema = schema.schema;\n }\n\n skipNext = true;\n skipNextTwo = true;\n }\n });\n } catch (e) {\n throw Error(\"Invalid uid, Field not found\");\n }\n const fieldInitializationDataObject = {\n uid,\n value,\n schema,\n data_type: schema.data_type,\n };\n\n //@ts-ignore\n const fieldObject = new FieldInstance(\n fieldInitializationDataObject,\n this._connection,\n this._emitter\n );\n delete fieldObject.onChange;\n return fieldObject;\n }\n\n /**\n * This function executes the callback function every time an entry is saved.\n * @param {function} callback The function to be called when an entry is saved.\n */\n\n onSave(callback: (arg0: EntryType) => void) {\n const entryObj = this;\n if (callback && typeof callback === \"function\") {\n entryObj._emitter.on(\"entrySave\", (event: { data: EntryType }) => {\n callback(event.data);\n });\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n\n /**\n * The onChange() function executes the provided callback function whenever an entry is updated.\n * @param {function} callback - The function to be called when the entry is edited or changed.\n */\n\n onChange(callback: IOnEntryChangeCallback) {\n const entryObj = this;\n if (callback && typeof callback === \"function\") {\n entryObj._emitter.on(\n \"entryChange\",\n (event: {\n data: EntryType;\n resolvedData: GenericObjectType;\n }) => {\n callback(event.data, event.resolvedData);\n }\n );\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n\n /**\n * The onPublish() function executes the callback function every time an entry has been published with the respective payload.\n * @param {function} callback The function to be called when an entry is published.\n */\n\n onPublish(callback: (arg0: PublishDetails) => void) {\n const entryObj = this;\n if (callback && typeof callback === \"function\") {\n entryObj._emitter.on(\n \"entryPublish\",\n (event: { data: PublishDetails }) => {\n callback(event.data);\n }\n );\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n\n /**\n * The onUnPublish() function executes the callback function every time an entry has been unpublished with the respective payload.\n * @param {function} callback The function to be called when an entry is un published.\n */\n\n onUnPublish(callback: (arg0: PublishDetails) => void) {\n const entryObj = this;\n if (callback && typeof callback === \"function\") {\n entryObj._emitter.on(\n \"entryUnPublish\",\n (event: { data: PublishDetails }) => {\n callback(event.data);\n }\n );\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n}\nexport default Entry;\n","import EventEmitter from \"wolfy87-eventemitter\";\nimport postRobot from \"post-robot\";\nimport { IFieldInitData, IFieldModifierLocationInitData } from \"./types\";\nimport { GenericObjectType } from \"./types/common.types\";\nimport { Schema } from \"./types/stack.types\";\nimport { Entry as EntryType } from \"../src/types/entry.types\";\n\nconst excludedDataTypesForSetField = [\n \"file\",\n \"reference\",\n \"blocks\",\n \"group\",\n \"global_field\",\n];\n\nfunction separateResolvedData(field: Field, value: GenericObjectType) {\n let resolvedData = value;\n let unResolvedData = value;\n if (field.data_type === \"file\") {\n if (value) {\n resolvedData = value;\n unResolvedData =\n field.schema.multiple === true\n ? value.map((file: any) => file.uid)\n : value.uid;\n } else if (field.schema.multiple === true) {\n resolvedData = [];\n unResolvedData = [];\n }\n }\n return { resolvedData, unResolvedData };\n}\n\n/** Class representing a field from Contentstack UI. Only available for Custom Field and Field Modifier UI Location */\nclass Field {\n /**\n * @hideconstructor\n */\n\n uid: string;\n data_type: string;\n schema: Schema;\n _emitter: EventEmitter;\n _data: GenericObjectType;\n _resolvedData: GenericObjectType;\n _self: boolean;\n _connection: typeof postRobot;\n\n constructor(\n fieldDataObject: IFieldInitData | IFieldModifierLocationInitData,\n connection: typeof postRobot,\n emitter: EventEmitter\n ) {\n /**\n * The UID of the current field is defined in the content type of the entry.\n * @type {string}\n */\n this.uid = fieldDataObject.uid;\n /**\n * The data type of the current field is set using this method.\n * @type {string}\n */\n this.data_type = fieldDataObject.schema.data_type;\n /**\n * The schema of the current field (schema of fields such as ‘Single Line Textbox’, ‘Number’,\n * and so on) is set using this method.\n * @type {Object}\n */\n this.schema = fieldDataObject.schema;\n this._emitter = emitter;\n\n const separatedData = separateResolvedData(this, fieldDataObject.value);\n\n this._data = separatedData.unResolvedData;\n\n this._resolvedData = separatedData.resolvedData;\n\n this._connection = connection;\n\n this._self = fieldDataObject.self || false;\n\n const fieldObj = this;\n\n emitter.on(\"updateFields\", (event: GenericObjectType) => {\n const schemaPath =\n this._self && \"$uid\" in fieldObj.schema\n ? fieldObj.schema.$uid\n : fieldObj.uid;\n const path = schemaPath.split(\".\");\n let value = event.data;\n\n path.forEach((key) => {\n if (value) {\n value = value[key];\n }\n });\n\n if (fieldObj._data !== value) {\n fieldObj._data = value;\n }\n });\n }\n\n /**\n * Sets the data for the current field.\n * @param {Object|string|number} data Data to be set on the field\n * @return {external:Promise} A promise object which is resolved when data is set for a field. Note: The data set by this function will only be saved when user saves the entry.\n */\n\n setData(data: any): Promise {\n const currentFieldObj = this;\n const dataObj = {\n data,\n uid: currentFieldObj.uid,\n self: currentFieldObj._self,\n };\n\n if (\n !currentFieldObj._self &&\n (excludedDataTypesForSetField.indexOf(currentFieldObj.data_type) !==\n -1 ||\n !currentFieldObj.data_type)\n ) {\n return Promise.reject(\n new Error(\"Cannot call set data for current field type\")\n );\n }\n\n return this._connection\n .sendToParent(\"setData\", dataObj)\n .then(() => {\n this._data = data;\n return Promise.resolve(currentFieldObj);\n })\n .catch((e: Error) => {\n return Promise.reject(e);\n });\n }\n\n /**\n * Gets the data of the current field\n * @param {Object} options Options object for get Data method.\n * @param {boolean} options.resolved If the resolved parameter is set to true for the File field, then the method will return a resolved asset object along with all the field metadata, e.g. 'field.getData({resolved:true})'.\n * @return {Object|string|number} Returns the field data.\n */\n getData({ resolved = false } = {}) {\n return resolved ? this._resolvedData : this._data;\n }\n\n /**\n * Sets the focus for a field when an App is being used. This method shows user presence and highlights the App's Custom Field that the user is currently accessing in Contentstack UI.\n * @return {Promise} A promise object which is resolved when Contentstack UI returns an acknowledgement of the focused state.\n */\n async setFocus(): Promise {\n await this._connection.sendToParent(\"focus\");\n }\n\n /**\n * The `onChange` function is triggered when another extension or app programmatically modifies the data of this field using the `field.setData()` function.\n * It is specifically designed for App's Custom Fields of data types text, number, boolean, or date.\n * @param {function} callback The function to be called when a field has been updated.\n */\n onChange?(callback: (data: any) => any) {\n const fieldObj = this;\n if (callback && typeof callback === \"function\") {\n fieldObj._emitter.on(\"extensionFieldChange\", (event: any) => {\n this._data = event.data;\n this._resolvedData = event.data;\n callback(event.data);\n });\n } else {\n throw Error(\"Callback must be a function\");\n }\n }\n}\n\nexport default Field;\n","import postRobot from \"post-robot\";\n\nimport Entry from \"../entry\";\nimport { IFieldModifierLocationInitData } from \"../types\";\nimport { IGetTagsOptions } from \"../types/entry.types\";\nimport generateErrorMessages, { ERROR_MESSAGES } from \"../utils/errorMessages\";\nimport Field from \"./field\";\n\nclass FieldModifierLocationEntry extends Entry {\n constructor(\n initializationData: IFieldModifierLocationInitData,\n connection: typeof postRobot,\n emitter: EventEmitter\n ) {\n super(initializationData, connection, emitter, {\n _internalFlags: {\n FieldInstance: Field as any,\n },\n });\n }\n\n /**\n * Returns the value of the tags associated with the entry.\n * @returns {string[]} Returns an array of tags associated with the entry.\n */\n getTags(options?: IGetTagsOptions): Array {\n const { useUnsavedSchema = false } = options || {};\n\n if (useUnsavedSchema) {\n return this._changedData?.tags || this._data.tags;\n } else {\n return this._data.tags;\n }\n }\n\n /**\n * Sets the tags on the entry.\n * @param tags tags to be set on the entry\n * @returns {string[]} Returns an array of tags associated with the entry.\n */\n async setTags(tags: Array): Promise> {\n /**\n * Validate if the tags are array of strings\n * @param {Array} tags\n * @returns {boolean} Returns true if the tags are array of strings\n */\n function areTagsValid(tags: Array): tags is Array {\n return (\n Array.isArray(tags) &&\n tags.every((tag) => typeof tag === \"string\")\n );\n }\n\n if (tags === undefined) {\n throw new Error(\n generateErrorMessages(\n ERROR_MESSAGES.entryField.entry.tagsShouldNotBeBlank\n )\n );\n }\n\n if (!areTagsValid(tags)) {\n throw new Error(\n generateErrorMessages(\n ERROR_MESSAGES.entryField.entry.tagsShouldBeArrayOfStrings\n )\n );\n }\n\n await this._connection.sendToParent(\"setTags\", { tags });\n\n if (!this._changedData) {\n this._changedData = {};\n }\n\n this._changedData.tags = tags;\n\n return tags;\n }\n}\n\nexport default FieldModifierLocationEntry;\n","import EventEmitter from \"wolfy87-eventemitter\";\nimport postRobot from \"post-robot\";\n\nimport { IFieldInitData, IFieldModifierLocationInitData } from \"../types\";\nimport { GenericObjectType } from \"../types/common.types\";\nimport { Schema } from \"../types/stack.types\";\n\nconst excludedDataTypesForSetField = [\n \"file\",\n \"reference\",\n \"blocks\",\n \"group\",\n \"global_field\",\n];\n\nfunction separateResolvedData(\n field: FieldModifierLocationField,\n value: GenericObjectType\n) {\n let resolvedData = value;\n let unResolvedData = value;\n if (field.data_type === \"file\") {\n if (value) {\n resolvedData = value;\n unResolvedData =\n field.schema.multiple === true\n ? value.map((file: any) => file.uid)\n : value.uid;\n } else if (field.schema.multiple === true) {\n resolvedData = [];\n unResolvedData = [];\n }\n }\n return { resolvedData, unResolvedData };\n}\n\n/** Class representing a field from Contentstack UI. */\nclass FieldModifierLocationField {\n /**\n * @hideconstructor\n */\n\n uid: string;\n data_type: string;\n schema: Schema;\n _emitter: EventEmitter;\n _data: GenericObjectType;\n _resolvedData: GenericObjectType;\n _self: boolean;\n _connection: typeof postRobot;\n\n constructor(\n fieldDataObject: IFieldInitData | IFieldModifierLocationInitData,\n connection: typeof postRobot,\n emitter: EventEmitter\n ) {\n /**\n * The UID of the current field is defined in the content type of the entry.\n * @type {string}\n */\n this.uid = fieldDataObject.uid;\n /**\n * The data type of the current field is set using this method.\n * @type {string}\n */\n this.data_type = fieldDataObject.schema.data_type;\n /**\n * The schema of the current field (schema of fields such as ‘Single Line Textbox’, ‘Number’,\n * and so on) is set using this method.\n * @type {Object}\n */\n this.schema = fieldDataObject.schema;\n this._emitter = emitter;\n\n const separatedData = separateResolvedData(this, fieldDataObject.value);\n\n this._data = separatedData.unResolvedData;\n\n this._resolvedData = separatedData.resolvedData;\n\n this._connection = connection;\n\n this._self = fieldDataObject.self || false;\n\n const fieldObj = this;\n\n emitter.on(\"updateFields\", (event: any) => {\n const schemaPath =\n this._self && \"$uid\" in fieldObj.schema\n ? fieldObj.schema.$uid\n : fieldObj.uid;\n const path = schemaPath.split(\".\");\n let value = event.data;\n\n path.forEach((key) => {\n if (value) {\n value = value[key];\n }\n });\n\n if (fieldObj._data !== value) {\n fieldObj._data = value;\n }\n });\n }\n\n /**\n * Sets the data for the current field.\n * @param {Object|string|number} data Data to be set on the field\n * @return {external:Promise} A promise object which is resolved when data is set for a field.\n * Note: The data set by this function will only be saved when user saves the entry.\n */\n async setData(data: any): Promise {\n const currentFieldObj = this;\n const dataObj = {\n data,\n uid: currentFieldObj.uid,\n self: currentFieldObj._self,\n };\n\n if (\n !currentFieldObj._self &&\n (excludedDataTypesForSetField.indexOf(currentFieldObj.data_type) !==\n -1 ||\n !currentFieldObj.data_type)\n ) {\n return Promise.reject(\n new Error(\"Cannot call set data for current field type\")\n );\n }\n\n return this._connection\n .sendToParent(\"setData\", dataObj)\n .then(() => {\n this._data = data;\n return Promise.resolve(currentFieldObj);\n })\n .catch((e: Error) => {\n return Promise.reject(e);\n });\n }\n\n /**\n * Gets the data of the current field\n * @param {Object} options Options object for get Data method.\n * @param {boolean} options.resolved If the resolved parameter is set to true for the File field, then the method will return a resolved asset object along with all the field metadata, e.g. 'field.getData({resolved:true})'.\n * @return {Object|string|number} Returns the field data.\n */\n getData({ resolved = false } = {}): GenericObjectType {\n return resolved ? this._resolvedData : this._data;\n }\n}\n\nexport default FieldModifierLocationField;\n","import EventEmitter from \"wolfy87-eventemitter\";\nimport postRobot from \"post-robot\";\n\nimport { ERROR_MESSAGES } from \"../utils/errorMessages\";\n\n/**\n * Class representing an iframe window from Contentstack UI. Not available for Custom Widgets.\n */\n\nclass FieldModifierLocationFrame {\n /**\n * @hideconstructor\n */\n\n _connection: typeof postRobot;\n _autoResizingEnabled = false;\n _emitter: EventEmitter;\n _height?: number;\n _width?: number;\n\n private observer: MutationObserver | undefined;\n\n constructor(connection: typeof postRobot, emitter: EventEmitter) {\n this._connection = connection || postRobot;\n this._autoResizingEnabled = false;\n this._emitter = emitter;\n\n this.updateDimension = this.updateDimension.bind(this);\n this.enableAutoResizing = this.enableAutoResizing.bind(this);\n this.disableAutoResizing = this.disableAutoResizing.bind(this);\n this.closeModal = this.closeModal.bind(this);\n\n /**\n * The auto resizing should be enabled by default.\n */\n this.enableAutoResizing();\n }\n\n /**\n * This method updates the UI location height and width on Contentstack UI.\n * If the value is not passed, it will update the height and width of the\n * UI location with the current height and width of the UI location.\n * @param {dimension: {height: number, width: number}} dimension Desired height and width of the iframe window\n */\n async updateDimension(dimension?: {\n height?: number;\n width?: number;\n }): Promise {\n const { height, width } = dimension || {};\n\n if (height === undefined && width === undefined) {\n this._height = Math.ceil(\n document.documentElement.getBoundingClientRect().height\n );\n\n this._width = Math.ceil(\n document.documentElement.getBoundingClientRect().width\n );\n\n await this._connection.sendToParent(\"resize\", {\n height: this._height,\n width: this._width,\n });\n return;\n }\n\n const dimensionBody = {};\n\n if (height !== undefined && typeof height !== \"number\") {\n throw new Error(\n ERROR_MESSAGES.entryField.frame.dimensionHeightShouldBeNumber\n );\n }\n\n if (this._height !== height) {\n this._height = height;\n dimensionBody[\"height\"] = this._height;\n }\n\n if (width !== undefined && typeof width !== \"number\") {\n throw new Error(\n ERROR_MESSAGES.entryField.frame.dimensionWidthShouldBeNumber\n );\n }\n\n if (this._width !== width) {\n this._width = width;\n dimensionBody[\"width\"] = this._width;\n }\n\n if (Object.keys(dimensionBody).length !== 0) {\n await this._connection.sendToParent(\"resize\", dimensionBody);\n }\n }\n\n /**\n * Prevent user from accidently closing the app by clicking outside the frame\n * if the app is performing some active task.\n */\n async preventFrameClose(state: boolean): Promise {\n await this._connection.sendToParent(\"preventFrameClose\", {\n state,\n });\n }\n\n /**\n * This method enables auto resizing of the UI Location height.\n * @return {FieldModifierLocationFrame}.\n */\n enableAutoResizing(): FieldModifierLocationFrame {\n if (this._autoResizingEnabled) {\n return this;\n }\n this._autoResizingEnabled = true;\n\n this.observer = new MutationObserver(\n async () => await this.updateDimension()\n );\n\n const mutationObserverConfig = {\n attributes: true,\n childList: true,\n subtree: true,\n };\n\n this.observer.observe(window.document.body, mutationObserverConfig);\n return this;\n }\n\n /**\n * This method disables auto resizing of the UI location height.\n * @return {FieldModifierLocationFrame}.\n */\n disableAutoResizing(): FieldModifierLocationFrame {\n if (!this._autoResizingEnabled) {\n return this;\n }\n this._autoResizingEnabled = false;\n this.observer?.disconnect();\n return this;\n }\n\n /**\n * It closes the app modal.\n * @returns {Promise}\n */\n async closeModal(): Promise {\n await this._connection.sendToParent(\"closeModal\");\n }\n}\n\nexport default FieldModifierLocationFrame;\n","import postRobot from \"post-robot\";\n\nimport UiLocation from \"./uiLocation\";\nimport { version } from \"../package.json\";\nimport { InitializationData } from \"./types\";\n\npostRobot.CONFIG.LOG_LEVEL = \"error\";\n\n/**\n * Class to initialize the App on Contentstack UI.\n * Import Contentstack App SDK and then call ContentstackAppSDK.init in your code base\n *\n * @example Custom Field UI Location\n * ContentstackAppSDK.init().then(function (sdk) {\n * const customField = sdk.location.CustomField;\n * })\n * @example Dashboard UI Location\n * ContentstackAppSDK.init().then(function (sdk) {\n * const dashboardUILocation = sdk.location.DashboardWidget;\n * })\n * @return {Promise} A promise object which will be resolved with an instance of the {@link UiLocation} class.\n * @hideconstructor\n */\n\nclass ContentstackAppSDK {\n /**\n * A static variable that stores the instance of {@link UiLocation} class after initialization\n */\n static _uiLocation: UiLocation;\n\n /**\n * Initializes the App SDK and returns an instance of {@link UiLocation} class\n */\n static init(): Promise {\n if (this._uiLocation) {\n return Promise.resolve(this._uiLocation);\n }\n return UiLocation.initialize(version)\n .then((initializationData: InitializationData) => {\n this._uiLocation = new UiLocation(initializationData);\n return Promise.resolve(this._uiLocation);\n })\n .catch((e: Error) => Promise.reject(e));\n }\n\n /**\n * Version of Contentstack App SDK.\n */\n static get SDK_VERSION() {\n return version;\n }\n}\n\nexport default ContentstackAppSDK;\nmodule.exports = ContentstackAppSDK;\n","import postRobot from \"post-robot\";\n\nimport { GenericObjectType } from \"./types/common.types\";\nimport { onData, onError } from \"./utils/utils\";\n\nexport declare interface IMetadata {\n api_key: string;\n _content_type_uid?: string;\n entity_uid: string;\n extension_uid?: string;\n locale?: string;\n scope?: string;\n type: \"asset\" | \"entry\";\n uid: string;\n [key: string]: any;\n}\n\nexport declare interface IMetadataCreateDto {\n entity_uid: string;\n _content_type_uid: string;\n type: \"asset\" | \"entry\";\n extension_uid: string;\n [key: string]: any;\n}\n\nexport declare interface IMetadataUpdateDto {\n uid: string;\n [key: string]: any;\n}\n\nexport declare interface IMetadataRetrieveDto {\n uid: string;\n}\n\nexport declare interface IMetadataDeleteDto {\n uid: string;\n}\n\nconst metadataActionTypes = {\n creteMetadata: \"createMetadata\",\n retrieveMetadata: \"getMetadata\",\n retrieveAllMetadata: \"getAllMetadata\",\n updateMetadata: \"updateMetadata\",\n deleteMetadata: \"deleteMetadata\",\n} as const;\n\n/**\n * The Metadata class provides methods for creating, retrieving, updating, and deleting metadata.\n */\nclass Metadata {\n constructor(private _connection: typeof postRobot) {}\n\n /**\n * Creates a new Metadata record.\n * @param {IMetadataCreateDto} metadataConfig The metadata configuration data required to create the metadata.\n * @returns {Promise<{ metadata: IMetadata }>} A promise that resolves to the newly created metadata record.\n */\n createMetaData(\n metadataConfig: IMetadataCreateDto\n ): Promise<{ metadata: IMetadata }> {\n const { entity_uid, type = \"asset\", ...otherMetaData } = metadataConfig;\n\n const data = {\n action: metadataActionTypes.creteMetadata,\n payload: {\n metadata: {\n entity_uid,\n type,\n ...otherMetaData,\n },\n },\n };\n\n return this._connection\n .sendToParent<{ metadata: IMetadata }>(\"stackQuery\", data)\n .then(onData)\n .catch(onError);\n }\n\n /**\n * Retrieves a metadata record by its ID.\n * @param {IMetadataRetrieveDto} metadataConfig The metadata configuration containing its uid.\n * @returns {Promise<{ metadata: IMetadata }> } A promise that resolves to the metadata record with the specified ID.\n */\n retrieveMetaData(\n metadataConfig: IMetadataRetrieveDto\n ): Promise<{ metadata: IMetadata }> {\n const { uid } = metadataConfig;\n\n const data = {\n uid,\n action: metadataActionTypes.retrieveMetadata,\n payload: {\n metadata: {\n uid,\n },\n },\n };\n\n return this._connection\n .sendToParent<{ metadata: IMetadata }>(\"stackQuery\", data)\n .then(onData)\n .catch(onError);\n }\n\n /**\n * Retrieves all metadata records.\n * @param {GenericObjectType} params Optional parameters for the query.\n * @returns {Promise<{ metadata: IMetadata[] }>} A promise that resolves to an array of all metadata records.\n */\n retrieveAllMetaData(\n params: GenericObjectType = {}\n ): Promise<{ metadata: IMetadata[] }> {\n const data = {\n action: metadataActionTypes.retrieveAllMetadata,\n params,\n };\n\n return this._connection\n .sendToParent<{ metadata: IMetadata[] }>(\"stackQuery\", data)\n .then(onData)\n .catch(onError);\n }\n\n /**\n * Updates a metadata record.\n * @param {IMetadataUpdateDto} metadataConfig The metadata configuration that needs to be updated.\n * @returns {Promise<{ metadata: IMetadata }>} A promise that resolves to the metadata record that has been updated.\n */\n updateMetaData(\n metadataConfig: IMetadataUpdateDto\n ): Promise<{ metadata: IMetadata }> {\n const { uid, ...otherMetaData } = metadataConfig;\n\n const data = {\n uid,\n action: metadataActionTypes.updateMetadata,\n payload: {\n metadata: {\n uid,\n ...otherMetaData,\n },\n },\n };\n\n return this._connection\n .sendToParent<{ metadata: IMetadata }>(\"stackQuery\", data)\n .then(onData)\n .catch(onError);\n }\n\n /**\n * Deletes a metadata record.\n * @param {IMetadataDeleteDto} metadataConfig The metadata configuration.\n * @returns {Promise<{ notice: string }>} A promise that resolves with a message upon successful deletion of the metadata record.\n */\n deleteMetaData(\n metadataConfig: IMetadataDeleteDto\n ): Promise<{ notice: string }> {\n const { uid } = metadataConfig;\n\n const data = {\n uid,\n action: metadataActionTypes.deleteMetadata,\n payload: {\n metadata: {\n uid,\n },\n },\n };\n return this._connection\n .sendToParent<{ notice: string }>(\"stackQuery\", data)\n .then(onData)\n .catch(onError);\n }\n}\nexport default Metadata;\n","import { getPreferredBodyElement } from \"./utils/utils\";\n\nclass Modal {\n constructor() {\n if (!Object.prototype.hasOwnProperty.call(window, \"iframeRef\")) {\n const rootElement = getPreferredBodyElement(\n document?.body?.children\n );\n window[\"iframeRef\"] = rootElement;\n }\n }\n\n setBackgroundElement(element: HTMLElement) {\n window[\"iframeRef\"] = element;\n }\n}\n\nexport default Modal;\n","import postRobot from \"post-robot\";\n\nimport Base from \"../base\";\nimport { getReferences, language, environment } from \"../../utils\";\nimport { GenericObjectType } from \"../../../types/common.types\";\n\nlet connection: any = {};\n\n/**\n * @summary Creates an instance of `Asset`.\n * @description An initializer is responsible for creating an Asset object.\n * @param {String} uid - uid of the asset\n * @example\n * const Asset = appSDK.stack.Asset('bltsomething123');\n * @returns {Asset}\n * @ignore\n */\nfunction onData(data) {\n if (typeof data.data === \"string\") {\n return Promise.reject(data.data);\n }\n return Promise.resolve(data.data);\n}\n\nfunction onError(error) {\n return Promise.reject(error);\n}\n\nclass Asset extends Base {\n getReferences: any;\n environment: any;\n constructor(uid) {\n super(uid);\n this.getReferences = getReferences;\n this.environment = environment;\n return this;\n }\n\n /**\n * @function\n * @name Stack#Asset.Query\n * @description This static method instantiates the query module for assets. To see the list of methods that can be used for querying assets, refer the {@link Query} module.\n * @example\n * let assetQuery = appSDK.stack.Asset.Query();\n * assetQuery.where(\"title\": \"main.js\").limit(10).skip(10).find().then(...).catch(...);\n * @return {Query}\n */\n\n static Query() {\n const entryQuery = super.Query();\n Object.assign(entryQuery, {\n language,\n environment,\n });\n return entryQuery;\n }\n\n static module(plural = false) {\n return plural ? \"Assets\" : \"Asset\";\n }\n\n static get connection() {\n return connection;\n }\n\n /**\n * @function\n * @name Stack#Asset.getRteAssets\n * @description This static method retrieves comprehensive information on all assets uploaded through the Rich Text Editor field.\n * @return {external:Promise}\n */\n\n static getRteAssets() {\n return this.connection\n .sendToParent(\"stackQuery\", { action: \"getRteAssets\" })\n .then(onData)\n .catch(onError);\n }\n\n /**\n * @function\n * @name Stack#Asset.getAssetsOfSpecificTypes\n * @description This static method retrieves assets that are either image or video files, based on the request query.\n * @param {String} assetType Type of asset to be received for e.g., ‘image/png’\n * @return {external:Promise}\n */\n static getAssetsOfSpecificTypes(assetType) {\n if (!assetType || typeof assetType !== \"string\") {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n return this.connection\n .sendToParent(\"stackQuery\", {\n action: \"getAssetsOfSpecificTypes\",\n asset_type: assetType,\n })\n .then(onData)\n .catch(onError);\n }\n\n /**\n * @name Stack#Asset#only\n * @function\n * @description This method is used to show the selected fields of the assets in the result set.\n * @param {String} [key=BASE] - Single field of an asset\n * @param {Array} values - Array of fields to be shown in the result set\n * @example\n * Only with the field UID \n * appSDK.stack.Asset('bltsomething123').only('title').fetch();\n * @example\n * Only with the field UID \n * appSDK.stack.Asset('bltsomething123').only('BASE','title').fetch();\n * @example\n * Only with the field UIDs(array) \n * appSDK.stack.Asset('bltsomething123').only(['title','description']).fetch();\n * @returns {Stack#Asset}\n */\n\n /**\n * @name Stack#Asset#except\n * @function\n * @description This method is used to hide the selected fields of the assets in result set.\n * @param {String} [key=BASE] - Single field of an asset\n * @param {Array} values - Array of fields to be hidden in the result set\n * @example\n * .Except with the field UID \n * appSDK.stack.Asset('bltsomething123').except('title').fetch();\n * @example\n * .Except with the field UID \n * appSDK.stack.Asset('bltsomething123').except('BASE','title').fetch();\n * @example\n * .Except with the field UIDs(array) \n * appSDK.stack.Asset('bltsomething123').except(['title','description']).fetch();\n * @returns {Stack#Asset}\n */\n\n /**\n * @function\n * @name Stack#Asset#environment\n * @description This method is used to set the environment name of which you want to retrieve the data.\n * @param {String} environment_uid - UID/Name of environment\n * @example appSDK.stack.Asset('bltsomething123').environment('development').fetch()\n * @returns {Stack#Asset}\n */\n\n /**\n This method includes a query parameter in your query.\n @name Stack#Asset#addParam\n @function\n @example appSDK.stack.Asset('uid').addParam('key', 'value').fetch().then().catch();\n @param {string} key - Key of the parammeter\n @param {string} value - Value of the parammeter\n @return {Stack#Asset}\n */\n\n /**\n This method includes a query parameter in your query.\n @name Stack#Asset#addQuery\n @function\n @example appSDK.stack.Asset('uid').addQuery('key', 'value').fetch().then().catch();\n @param {string} key - Key of the parammeter\n @param {string} value - Value of the parammeter\n @return {Stack#Asset}\n */\n\n /**\n This method will fetch the details of the entries and the assets in which the specified asset is referenced.\n @see {@link\n https://www.contentstack.com/docs/apis/content-management-api/#get-all-references-of-asset|\n Asset References}\n @name Stack#Asset#getReferences\n @function\n @example appSDK.stack.Asset('uid').getReferences().then().catch();\n @return {external:Promise}\n */\n\n /**\n This method deletes an existing asset.\n @see {@link\n https://www.contentstack.com/docs/apis/content-management-api/#delete-an-asset|\n Delete Asset}\n @name Stack#Asset#delete\n @function\n @example appSDK.stack.Asset('uid').delete().then().catch();\n @return {external:Promise}\n */\n\n /**\n * @name Stack#Asset#publish\n * @function\n * @description This method allows you to publish the asset either immediately or schedule the publish for a later date/time.\n * @param {object} payload - Payload for the request.\n * @example appSDK.stack.Asset('bltsomething123')\n .publish(\n {\n \"asset\": {\n \"locales\": [\n \"en-us\"\n ],\n \"environments\": [\n \"development\"\n ]\n },\n \"version\": 1,\n \"scheduled_at\": \"2019-02-08T18:30:00.000Z\"\n });\n * @return {external:Promise}\n */\n publish(payload) {\n if (\n !payload ||\n typeof payload !== \"object\" ||\n payload instanceof Array\n ) {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n return this.fetch(\"publishAsset\", payload);\n }\n\n /**\n * @function\n * @name Stack#Asset#unpublish\n * @description This method will instantly unpublish the asset, and also give you the provision to automatically unpublish the asset at a later date/time.\n * @param {object} payload - Payload for the request.\n * @example appSDK.stack.Asset('bltsomething123')\n .unpublish({\n \"asset\": {\n \"locales\": [\n \"en-us\"\n ],\n \"environments\": [\n \"development\"\n ]\n },\n \"version\": 1,\n \"scheduled_at\": \"2019-02-08T18:30:00.000Z\"\n });\n * @return {external:Promise}\n */\n unpublish(payload) {\n if (\n !payload ||\n typeof payload !== \"object\" ||\n payload instanceof Array\n ) {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n return this.fetch(\"unpublishAsset\", payload);\n }\n\n static async handleUpload(\n _files,\n type,\n options?: {\n parentFolderUid?: string;\n customUploadHandler?: GenericObjectType;\n }\n ): Promise> {\n if (!_files || !_files.length) {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n const files: File[] = [];\n Array.from(_files).forEach((_) => {\n // @ts-ignore\n const file = new File([_], _.name, { type: _.type });\n files.push(file);\n });\n const uid = new Date().getUTCMilliseconds();\n return (async function () {\n try {\n const uploadReadyListener = postRobot.on(\n `uploadReady_${uid}`,\n function () {\n window.parent.postMessage(\n {\n type: `upload_${uid}`,\n upload_type: type,\n files,\n parentFolderUid: options?.parentFolderUid,\n customUploadHandler:\n options?.customUploadHandler,\n },\n \"*\"\n );\n\n uploadReadyListener.cancel();\n return Promise.resolve({});\n }\n );\n //@ts-ignore\n await postRobot.sendToParent(\"stackOptionsQuery\", {\n action: `upload_${uid}`,\n uid,\n });\n //@ts-ignore\n return postRobot.sendToParent(`upload_${uid}`, {});\n } catch (err) {\n return Promise.reject(err);\n }\n })();\n }\n\n static uploadAsset(files, options?: { parentFolderUid?: string }) {\n return Asset.handleUpload(files, \"upload\", options);\n }\n}\n\nexport default (uiConnection) => {\n connection = uiConnection;\n return new Proxy(Asset, {\n apply(Target, thisArg, argumentsList) {\n //@ts-ignore\n return new Target(...argumentsList);\n },\n });\n};\n","//@ts-nocheck\n\nimport Query from './query';\nimport { transform, addParam } from '../utils';\n\n\nfunction onData(data: { data: any; }) {\n if (typeof (data.data) === 'string') { return Promise.reject(data.data); }\n return Promise.resolve(data.data);\n}\n\nfunction onError(error: any) {\n return Promise.reject(error);\n}\n/**\n * This is Base class, it holds all the methods required for Modle instance,\n * eg ContentType('uid').delete() or Asset('uid').update({...})\n * @ignore\n */\nexport default class Base {\n\n\n uid: string\n _query: { [key: string]: any }\n only: any\n except: any\n addParam: any\n\n static connection: any\n static contentTypeUid: string\n\n constructor(uid: string) {\n if (!uid) { throw new Error('uid is required'); }\n this.uid = uid;\n this._query = {};\n this.only = transform('only');\n this.except = transform('except');\n this.addParam = addParam;\n }\n\n static Query() {\n //@ts-ignore\n return new Query(this.connection, this.module(true), this.contentTypeUid);\n }\n\n\n static create(payload: { [key: string]: any }) {\n const options = { payload, content_type_uid: this.contentTypeUid, action: `create${this.module()}` };\n return this.connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n update(payload: { [key: string]: any }) {\n if (!payload || (typeof payload !== 'object') || (payload instanceof Array)) {\n return Promise.reject(new Error('Kindly provide valid parameters'));\n }\n return this.fetch(`update${this.constructor.module()}`, payload);\n }\n\n delete() {\n return this.fetch(`delete${this.constructor.module()}`);\n }\n\n fetch(action: string, payload?: { [key: string]: any }) {\n const options = {\n payload,\n content_type_uid: this.constructor.contentTypeUid,\n uid: this.uid,\n params: this._query,\n action: action || `get${this.constructor.module()}`\n };\n\n if (!payload) { delete options.payload; }\n if (!this.constructor.contentTypeUid) { delete options.content_type_uid; }\n return this.constructor.connection.sendToParent('stackQuery', options)\n .then(onData).catch(onError);\n }\n}\n","import Base from \"../base\";\nimport {\n getReferences,\n addQuery,\n language,\n environment,\n includeOwner,\n includeContentType,\n includeSchema,\n includeReference,\n} from \"../../utils\";\n\nlet connection = {};\nlet contentTypeUid = \"\";\n\nclass Entry extends Base {\n constructor(uid: string) {\n super(uid);\n this._query = {};\n return this;\n }\n\n /**\n * @function\n * @name Stack#ContentType#Entry.Query\n * @description This static method instantiates the query module for entries. To see the list of methods that can be used for querying entries, refer the {@link Query} module.\n * @example\n * let entryQuery = appSDK.stack.ContentType('content_type_uid').Entry.Query();\n * entryQuery.where(\"field_uid\": \"10\").limit(10).skip(10).find().then(...).catch(...);\n * @return {Query}\n */\n\n static Query() {\n const entryQuery = super.Query();\n Object.assign(entryQuery, {\n language,\n environment,\n includeOwner,\n includeContentType,\n includeSchema,\n includeReference,\n });\n return entryQuery;\n }\n\n static get connection() {\n return connection;\n }\n\n static get contentTypeUid() {\n return contentTypeUid;\n }\n\n static module(plural = false) {\n return plural ? \"Entries\" : \"Entry\";\n }\n /**\n This method creates a new entry.\n @see {@link\n https://www.contentstack.com/docs/apis/content-management-api/#create-a-an-entry|\n Create Entry}\n @name Stack#ContentType#Entry.create\n @function\n @example appSDK.stack.ContentType('content_type_uid').Entry.create({\n \"entry\": {\n \"title\": \"example\",\n \"url\": \"/example\"\n }\n }).then(...).catch(...);\n @param {Object} payload Data to create an entry\n @return {external:Promise}\n Required data if resolved successfully\n */\n\n /**\n * @name Stack#ContentType#Entry#only\n * @function\n * @description This method is used to show the selected fields of an entry in the result set.\n * @param {String} [key=BASE] - Single field of an entry\n * @param {Array} values - Array of fields to be shown in the result set\n * @example\n * Only with field UID \n * appSDK.stack.ContentType('content_type_uid').Entry('bltsomething123').only('title').fetch();\n * @example\n * Only with field UID \n * appSDK.stack.ContentType('content_type_uid').Entry('bltsomething123').only('BASE','title').fetch();\n * @example\n * Only with field UIDs(array) \n * appSDK.stack.ContentType('content_type_uid').Entry('bltsomething123').only(['title','description']).fetch();\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * @name Stack#ContentType#Entry#except\n * @function\n * @description This method is used to hide the selected fields of an entry in the result set.\n * @param {String} [key=BASE] - Single field of an entry\n * @param {Array} values - Array of fields to be hidden in the result set\n * @example\n * Except with field uid \n * appSDK.stack.ContentType('content_type_uid').Entry('bltsomething123').except('title').fetch();\n * @example\n * Except with field uid \n * appSDK.stack.ContentType('content_type_uid').Entry('bltsomething123').except('BASE','title').fetch();\n * @example\n * Except with field uids(array) \n * appSDK.stack.ContentType('content_type_uid').Entry('bltsomething123').except(['title','description']).fetch();\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * This method includes a query parameter in your query.\n * @name Stack#ContentType#Entry#addParam\n * @function\n * @example appSDK.stack.ContentType('content_type_uid').Entry('uid').addParam('include_count', 'true').fetch().then().catch();\n * @param {string} key - Key of the parameter\n * @param {string} value - Value of the parameter\n * @return {Stack#ContentType#Entry} Returns\n */\n\n /**\n This method will fetch all the entries in which the current entry is referenced.\n @see {@link\n https://www.contentstack.com/docs/apis/content-management-api/#get-all-references-of-an-entry|\n Entry References}\n @name Stack#ContentType#Entry#getReferences\n @function\n @example appSDK.stack.ContentType('content_type_uid').Entry('uid').getReferences().then().catch();\n @return {external:Promise}\n Required data if resolved successfully\n */\n\n /**\n @example appSDK.stack.ContentType('content_type_uid').Entry('uid').update({\"entry\" : {...}}).then().catch();\n @param {Object} payload Data to be update exsisting entry\n @return {external:Promise}\n Required data if resolved successfully\n */\n\n /**\n This method deletes an existing entry.\n @see {@link\n https://www.contentstack.com/docs/apis/content-management-api/#delete-an-entry|\n Delete Entry}\n @name Stack#ContentType#Entry#delete\n @function\n @example appSDK.stack.ContentType('content_type_uid').Entry('uid').delete().then().catch();\n @return {external:Promise}\n Required data if resolved successfully\n */\n\n /**\n This method fetches information of a specific entry.\n @see {@link\n https://www.contentstack.com/docs/apis/content-management-api/#get-a-single-an-entry|\n Get A Single Entry}\n @name Stack#ContentType#Entry#fetch\n @function\n @example appSDK.stack.ContentType('content_type_uid').Entry('uid').fetch().then().catch();\n @return {external:Promise}\n Required data if resolved successfully\n */\n\n /**\n * @function\n * @name Stack#ContentType#Entry#includeReference\n * @description This method is used to include referenced entries from other content types.\n * @example\n * .includeReference with reference_field_uids as array \n * stack.ContentType('contenttype_uid').Entry('bltsomething123').includeReference(['category', 'author']).fetch()\n * @example\n * .includeReference with reference_field_uids \n * stack.ContentType('contenttype_uid').Entry('bltsomething123').includeReference('category', 'author').fetch()\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * @function\n * @name Stack#ContentType#Entry#language\n * @description This method is used to set the language code of which you want to retrieve the data.\n * @param {String} languageCode - Language code, for e.g. 'en-us', 'ja-jp', and so on\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').language('en-us').fetch()\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * @function\n * @name Stack#ContentType#Entry#environment\n * @description This method is used to set the environment name of which you want to retrieve the data.\n * @param {String} environment_uid - UID/Name of environment\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').environment('development').fetch()\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * @function\n * @name Stack#ContentType#Entry#addQuery\n * @description This method is used to add a query to an entry object.\n * @param {String} key - Key of the query\n * @param {String} value - Value of the query\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').addQuery('include_schema',true).fetch()\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * @function\n * @name Stack#ContentType#Entry#includeSchema\n * @description This method is used to include the schema of the current contenttype in result set along with the entry/entries.\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').includeSchema().fetch()\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * @function\n * @name Stack#ContentType#Entry#includeContentType\n * @description This method is used to include the current content type in the result set along with the entry(ies).\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').includeContentType().fetch()\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * @function\n * @name Stack#ContentType#Entry#includeOwner\n * @description This method is used to include the owner of the entry(ies) in the result set.\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').includeOwner().fetch()\n * @returns {Stack#ContentType#Entry}\n */\n\n /**\n * @function\n * @name Stack#ContentType#Entry#getLanguages\n * @description This method returns the details of all the languages that an entry is localized in.\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').getLanguages()\n * @return {external:Promise}\n */\n getLanguages() {\n return this.fetch(\"getEntryLanguages\");\n }\n\n /**\n * @function\n * @name Stack#ContentType#Entry#unlocalize\n * @description This method is used to unlocalize an entry\n * @param {string} locale Locale in which the entry has to be unlocalized\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').unlocalize('fr-fr').then(...).catch(...);\n * @return {external:Promise}\n */\n unlocalize(locale: string) {\n if (!locale || typeof locale !== \"string\") {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n this._query.locale = locale;\n return this.fetch(\"unlocalizeEntry\");\n }\n\n /**\n * @function\n * @name Stack#ContentType#Entry#publish\n * @description This method lets you publish an entry either immediately or schedule it to be published automatically at a later date/time.\n * @param {object} payload - Payload for the request\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').publish({\n \"entry\": {\n \"environments\": [\"development\"],\n \"locales\": [\"en-us\"]\n },\n \"locale\": \"en-us\",\n \"version\": 1,\n \"scheduled_at\": \"2019-02-14T18:30:00.000Z\"\n }).then(...).catch(...);\n * @return {external:Promise}\n */\n publish(payload: { [key: string]: any }) {\n if (\n !payload ||\n typeof payload !== \"object\" ||\n payload instanceof Array\n ) {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n this._query = {};\n return this.fetch(\"publishEntry\", payload);\n }\n\n /**\n * @function\n * @name Stack#ContentType#Entry#unpublish\n * @description This method lets you publish an entry either immediately or schedule it to be published automatically at a later date/time.\n * @param {object} payload - Payload for the request\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').unpublish({\n \"entry\": {\n \"environments\": [\"development\"],\n \"locales\": [\"en-us\"]\n },\n \"locale\": \"en-us\",\n \"version\": 1,\n \"scheduled_at\": \"2019-02-14T18:30:00.000Z\"\n }).then(...).catch(...);\n * @return {external:Promise}\n */\n unpublish(payload: { [key: string]: any }) {\n if (\n !payload ||\n typeof payload !== \"object\" ||\n payload instanceof Array\n ) {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n this._query = {};\n return this.fetch(\"unpublishEntry\", payload);\n }\n\n /**\n * @function\n * @name Stack#ContentType#Entry#setWorkflowStage\n * @description This method allows you to either set a particular workflow stage or update the workflow stage details of an entry.\n * @param {object} payload - Payload for the request\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').setWorkflowStage({\n \"workflow\": {\n \"workflow_stage\": {\n \"comment\": \"Test Comment\",\n \"due_date\": \"Thu Dec 01 2018\",\n \"notify\": false,\n \"uid\": \"blt9f52a2cd5e0014fb\",\n \"assigned_to\": [{\n \"uid\": \"blt296a22e28cc0c63c\",\n \"name\": \"John Doe\",\n \"email\": \"john.doe@contentstack.com\"\n }],\n \"assigned_by_roles\": [{\n \"uid\": \"blt5b74c24c7ae25d94\",\n \"name\": \"Content Manager\"\n }]\n }\n }\n }).then(...).catch(...);\n * @return {external:Promise}\n */\n setWorkflowStage(payload: { [key: string]: any }) {\n if (\n !payload ||\n typeof payload !== \"object\" ||\n payload instanceof Array\n ) {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n return this.fetch(\"setWorkflowStageEntry\", payload);\n }\n\n /**\n * @see {@link https://www.contentstack.com/docs/apis/content-management-api/#update-an-entry| Update Entry}\n * @name Stack#ContentType#Entry#update\n * @function\n * @description This call allows you to update entry content.\n * @param {object} payload - Payload for the request\n * @param {string} [locale] - Passing the ‘locale’ parameter will localize the entry in the specified locale\n * to be localized in the specified locale.\n * @example appSDK.stack.ContentType('contenttype_uid').Entry('bltsomething123').update(\n {\n \"entry\": {\n \"title\": \"example\",\n \"url\": \"/example\"\n }\n }).then(...).catch(...);\n * @return {external:Promise}\n */\n //@ts-ignore\n update(payload: { [key: string]: any }, locale: string) {\n if (\n !payload ||\n typeof payload !== \"object\" ||\n payload instanceof Array\n ) {\n return Promise.reject(new Error(\"Kindly provide valid parameters\"));\n }\n this._query.locale = locale;\n return this.fetch(\"updateEntry\", payload);\n }\n}\n\nexport default (uiConnection: any, contentType: string) => {\n connection = uiConnection;\n contentTypeUid = contentType;\n return new Proxy(Entry, {\n apply(Target: any, thisArg, argumentsList: any[]) {\n const entryTarget = new Target(...argumentsList);\n Object.assign(entryTarget, {\n getReferences,\n addQuery,\n language,\n environment,\n includeOwner,\n includeContentType,\n includeSchema,\n includeReference,\n });\n return entryTarget;\n },\n });\n};\n","import Entry from './entry';\nimport Base from '../base';\n\nlet connection = {};\n\n\nclass ContentType extends Base {\n\n Entry: typeof Entry\n\n constructor(uid: string) {\n super(uid);\n /**\n * @constructor\n * @hideconstructor\n * @name Stack#ContentType#Entry\n * @desc An entry is the actual piece of content created using one of the defined content types\n * @see {@link https://www.contentstack.com/docs/apis/content-management-api/#entries| Entries}\n */\n\n // @ts-ignore\n this.Entry = Entry(this.constructor.connection, this.uid);\n return this;\n }\n\n // static module(plural = false) {\n // return plural ? 'ContentTypes' : 'ContentType';\n // }\n static get connection() {\n return connection;\n }\n}\nexport default (uiConnection: any) => {\n connection = uiConnection;\n return new Proxy(ContentType, {\n // target = Foo\n apply(Target: any, thisArg, argumentsList: any[]) {\n return new Target(...argumentsList);\n }\n });\n};\n","import * as Utils from \"../utils\";\n\nfunction onData(data) {\n if (typeof data.data === \"string\") {\n return Promise.reject(data.data);\n }\n return Promise.resolve(data.data);\n}\n\nfunction onError(error) {\n return Promise.reject(error);\n}\n\nconst _extend = {\n compare(type) {\n return function (key, value) {\n if (\n key &&\n value &&\n typeof key === \"string\" &&\n typeof value !== \"undefined\"\n ) {\n this._query.query[key] = this._query.query.file_size || {};\n this._query.query[key][type] = value;\n return this;\n }\n throw Error(\"Kindly provide valid parameters.\");\n };\n },\n contained(bool) {\n const type = bool ? \"$in\" : \"$nin\";\n return function (key, value) {\n if (\n key &&\n value &&\n typeof key === \"string\" &&\n Array.isArray(value)\n ) {\n this._query.query[key] = this._query.query[key] || {};\n this._query.query[key][type] =\n this._query.query[key][type] || [];\n this._query.query[key][type] =\n this._query.query[key][type].concat(value);\n return this;\n }\n throw Error(\"Kindly provide valid parameters.\");\n };\n },\n exists(bool) {\n return function (key) {\n if (key && typeof key === \"string\") {\n this._query.query[key] = this._query.query[key] || {};\n this._query.query[key].$exists = bool;\n return this;\n }\n throw Error(\"Kindly provide valid parameters.\");\n };\n },\n logical(type) {\n return function () {\n const _query: any[] = [];\n for (let i = 0, _i = arguments.length; i < _i; i += 1) {\n if (\n arguments[i] instanceof Query &&\n arguments[i]._query.query\n ) {\n _query.push(arguments[i]._query.query);\n } else if (typeof arguments[i] === \"object\") {\n _query.push(arguments[i]);\n }\n }\n if (this._query.query[type]) {\n this._query.query[type] =\n this._query.query[type].concat(_query);\n } else {\n this._query.query[type] = _query;\n }\n return this;\n };\n },\n sort(type) {\n return function (key) {\n if (key && typeof key === \"string\") {\n this._query[type] = key;\n return this;\n }\n throw Error(\"Argument should be a string.\");\n };\n },\n pagination(type) {\n return function (value) {\n if (typeof value === \"number\") {\n this._query[type] = value;\n return this;\n }\n throw Error(\"Argument should be a number.\");\n };\n },\n};\n\n/**\n * Creates an instance of the query\n * @hideconstructor\n */\nclass Query {\n module: any;\n _connection: any;\n _query: { [key: string]: any };\n contentTypeUid: string;\n only: any;\n except: any;\n addQuery: any;\n lessThan: any;\n lessThanOrEqualTo: any;\n greaterThan: any;\n greaterThanOrEqualTo: any;\n notEqualTo: any;\n containedIn: any;\n notContainedIn: any;\n exists: any;\n notExists: any;\n ascending: ReturnType;\n descending: ReturnType;\n beforeUid: ReturnType;\n afterUid: ReturnType;\n skip: ReturnType;\n limit: ReturnType;\n or: ReturnType;\n and: ReturnType;\n addParam: ReturnType;\n singleEntry: any;\n\n constructor(connection, module, contentTypeUid) {\n this.module = module;\n this._connection = connection;\n this._query = {};\n this._query.query = this._query.query || {};\n this.contentTypeUid = contentTypeUid;\n\n /**\n * @name Query#only\n * @function\n * @description This method is used to show the selected fields of an entry in the result set.\n * @param {String} [key=BASE] - Single field of an entry\n * @param {Array} values - Array of fields to be shown in the result set\n * @example\n * Only with field UID \n * appSDK.stack.ContentType('content_type_uid').Entry.Query().only('title').find();\n * @example\n * Only with field UID \n * appSDK.stack.ContentType('content_type_uid').Entry.Query().only('BASE','title').find();\n * @example\n * Only with field UIDs(array) \n * appSDK.stack.ContentType('content_type_uid').Entry.Query().only(['title','description']).find();\n * @returns {Query}\n */\n\n this.only = Utils.transform(\"only\");\n\n /**\n * @name Query#except\n * @function\n * @description This method is used to hide the selected fields of an entry in the result set.\n * @param {String} [key=BASE] - Single field of an entry\n * @param {Array} values - Array of fields to be hidden in the result set\n * @example\n * Except with field uid \n * appSDK.stack.ContentType('content_type_uid').Entry.Query().except('title').find();\n * @example\n * Except with field uid \n * appSDK.stack.ContentType('content_type_uid').Entry.Query().except('BASE','title').find();\n * @example\n * Except with field uids(array) \n * appSDK.stack.ContentType('content_type_uid').Entry.Query().except(['title','description']).find();\n * @returns {Query}\n */\n\n this.except = Utils.transform(\"except\");\n /**\n This method includes a query parameter in your query.\n @name Query#addQuery\n @function\n @example appSDK.stack.ContentType('content_type_uid').Entry.Query().addQuery('key', 'value').find().then().catch();\n @param {string} key - Key of the parammeter\n @param {string} value - Value of the parammeter\n @return {Query}\n */\n this.addQuery = Utils.addQuery;\n\n /**\n * @name Query#lessThan\n * @description This method provides only the entries with values less than the specified value for a field.\n * @param {String} key - UID of the field\n * @param {*} value - The value used to match or compare\n * @example appSDK.stack.ContentType('blog').lessThan('created_at','2015-06-22')\n * @returns {Query}\n */\n this.lessThan = _extend.compare(\"$lt\");\n\n /**\n * @name Query#lessThanOrEqualTo\n * @description This method provides only the entries with values less than or equal to the specified value for a field.\n * @param {String} key - UID of the field\n * @param {*} value - The value used to match or compare\n * @example appSDK.stack.ContentType('blog').lessThanOrEqualTo('created_at','2015-03-12')\n * @returns {Query}\n */\n this.lessThanOrEqualTo = _extend.compare(\"$lte\");\n /**\n * @function\n * @name Query#greaterThan\n * @description This method provides only the entrieswith values\n * greater than the specified value for a field.\n * @param {String} key - UID of the field\n * @param {*} value - The value used to match or compare\n * @example appSDK.stack.ContentType('blog').greaterThan('created_at','2015-03-12')\n * @returns {Query}\n */\n this.greaterThan = _extend.compare(\"$gt\");\n\n /**\n * @function\n * @name Query#greaterThanOrEqualTo\n * @description This method provides only the entries with values greater than or equal to the specified value for a field.\n * @param {String} key - UID of the field\n * @param {*} value - The value used to match or compare\n * @example appSDK.stack.ContentType('blog').greaterThanOrEqualTo('created_at', '2015-06-22')\n * @returns {Query}\n */\n this.greaterThanOrEqualTo = _extend.compare(\"$gte\");\n\n /**\n * @function\n * @name Query#notEqualTo\n * @description This method provides only the entries with values not equal to the specified value for a field.\n * @param {String} key - UID of the field\n * @param {*} value - The value used to match or compare\n * @example appSDK.stack.ContentType('blog').notEqualTo('title','Demo')\n * @returns {Query}\n */\n this.notEqualTo = _extend.compare(\"$ne\");\n\n /**\n * @function\n * @name Query#containedIn\n * @description This method provides only the entries with values matching the specified values for a field.\n * @param {String} key - UID of the field\n * @param {*} value - An array of values that are to be used to match or compare\n * @example appSDK.stack.ContentType('blog').containedIn('title', ['Demo', 'Welcome'])\n * @returns {Query}\n */\n this.containedIn = _extend.contained(true);\n\n /**\n * @function\n * @name Query#notContainedIn\n * @description This method provides only the entries that do not contain values matching the specified values for a field.\n * @param {String} key - UID of the field\n * @param {Array} value - An array of values that are to be used to match or compare\n * @example appSDK.stack.ContentType('blog').notContainedIn('title', ['Demo', 'Welcome'])\n * @returns {Query}\n */\n this.notContainedIn = _extend.contained(false);\n\n /**\n * @function\n * @name Query#exists\n * @description This method provides only the entries that contains the field matching the specified field UID.\n * @param {String} key - UID of the field\n * @example appSDK.stack.ContentType('blog').exists('featured')\n * @returns {Query}\n */\n this.exists = _extend.exists(true);\n\n /**\n * @function\n * @name Query#notExists\n * @description This method provides only the entries that do not contain the field matching the specified field UID.\n * @param {String} key - UID of the field\n * @example appSDK.stack.ContentType('blog').notExists('featured')\n * @returns {Query}\n */\n this.notExists = _extend.exists(false);\n\n /**\n * @function\n * @name Query#ascending\n * @description This parameter sorts the entries in ascending order on the basis of the value of the specified field.\n * @param {String} key - Field UID to be used for sorting.\n * @example appSDK.stack.ContentType('blog').ascending('created_at')\n * @returns {Query}\n */\n this.ascending = _extend.sort(\"asc\");\n\n /**\n * @function\n * @name Query#descending\n * @description This method sorts the entries in descending order on the basis of the specified field.\n * @param {String} key - Field UID to be used for sorting\n * @example appSDK.stack.ContentType('blog').descending('created_at')\n * @returns {Query}\n */\n this.descending = _extend.sort(\"desc\");\n\n /**\n * @function\n * @name Query#beforeUid\n * @description This method provides only the entries that are placed before the specified entry ID.\n * @param {String} uid - UID of the entry\n * @example appSDK.stack.ContentType('blog').beforeUid('blt1234567890abcdef')\n * @returns {Query}\n * @ignore\n */\n this.beforeUid = _extend.sort(\"before_uid\");\n\n /**\n * @function\n * @name Query#afterUid\n * @description This method provides only the entries that are placed after the specified entry ID.\n * @param {String} uid - UID of the entry\n * @example appSDK.stack.ContentType('blog').afterUid('blt1234567890abcdef')\n * @returns {Query}\n * @ignore\n */\n this.afterUid = _extend.sort(\"after_uid\");\n\n /**\n * @function\n * @name Query#skip\n * @description This method skips the specified number of entries.\n * @param {Number} skip - Number of entries to be skipped\n * @example appSDK.stack.ContentType('blog').skip(5)\n * @returns {Query}\n */\n this.skip = _extend.pagination(\"skip\");\n\n /**\n * @function\n * @name Query#limit\n * @description This method limits the response by providing only the specified number of entries.\n * @param {Number} limit - Maximum number of entries to be returned in the result.\n * @example appSDK.stack.ContentType('blog').limit(10)\n * @returns {Query}\n */\n this.limit = _extend.pagination(\"limit\");\n\n /**\n * @function\n * @name Query#or\n * @description This method performs the OR operation on the specified query objects and provides only the matching entries.\n * @param {object} Array of query objects/raw queries\n * to be taken into consideration\n * @example\n * OR with query instances\n * let Query1 = appSDK.stack.ContentType('blog').Entry.Query().where('title', 'Demo')\n * let Query2 = appSDK.stack.ContentType('blog').Entry.Query().lessThan('comments', 10)\n * let blogQuery = appSDK.stack.ContentType('blog').or(Query1, Query2)\n * @example\n * OR with query instances\n * let Query1 = appSDK.stack.ContentType('blog').Entry.Query().where('title', 'Demo').getQuery()\n * let Query2 = appSDK.stack.ContentType('blog').Entry.Query().lessThan('comments', 10).getQuery()\n * let blogQuery = appSDK.stack.ContentType('blog').or(Query1, Query2)\n * @returns {Query}\n */\n this.or = _extend.logical(\"$or\");\n\n /**\n * @function\n * @name Query#and\n * @description This method performs the AND operation on the specified query objects and provides only the matching entries.\n * @param {object} Array of query objects/raw queries to be taken into consideration\n * @example\n * AND with raw queries\n * let Query1 = appSDK.stack.ContentType('blog').Entry.Query().where('title', 'Demo');\n * let Query2 = appSDK.stack.ContentType('blog').Entry.Query().lessThan('comments', 10);\n * let blogQuery = appSDK.stack.ContentType('blog').and(Query1, Query2)\n * @example\n * .and with raw queries\n * let Query1 = appSDK.stack.ContentType('blog').Entry.Query().where('title', 'Demo').getQuery();\n * let Query2 = appSDK.stack.ContentType('blog').Entry.Query().lessThan('comments', 10).getQuery();\n * let blogQuery = appSDK.stack.ContentType('blog').and(Query1, Query2)\n * @returns {Query}\n */\n this.and = _extend.logical(\"$and\");\n /**\n This method includes a query parameter in your query.\n @name Query#addParam\n @function\n @example appSDK.stack.ContentType('content_type_uid').Entry.Query().addParam('key', 'value').find().then().catch();\n @param {string} key - Key of the parammeter\n @param {string} value - Value of the parammeter\n @return {Query}\n */\n this.addParam = Utils.addParam;\n }\n\n // -------------------------------------Entry Queries--------------------------------------------------\n /**\n * @function\n * @name Query#includeReference\n * @description This method is used to include referenced entries from other content types. Note: This method is only valid for querying {@link Stack#ContentType#Entry}.\n * @example\n * .includeReference with reference_field_uids as array \n * stack.ContentType('contenttype_uid').Entry.Query().includeReference(['category', 'author']).find()\n * @example\n * .includeReference with reference_field_uids \n * stack.ContentType('contenttype_uid').Entry.Query().includeReference('category', 'author').find()\n * @returns {Query}\n */\n\n /**\n * @function\n * @name Query#includeSchema\n * @description This method is used to include the schema of the current contenttype in result set along with the entry/entries. Note: This method is only valid for querying {@link Stack#ContentType#Entry}.\n * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().includeSchema().find()\n * @returns {Query}\n */\n\n /**\n * @function\n * @name Query#language\n * @description This method is used to set the language code of which you want to retrieve the data. Note: This method is only valid for querying {@link Stack#ContentType#Entry}.\n * @param {String} languageCode - Language code, for e.g. 'en-us', 'ja-jp', and so on\n * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().language('en-us').find()\n * @returns {Query}\n */\n\n /**\n * @function\n * @name Query#includeContentType\n * @description This method is used to include the current content type in the result set along with the entry(ies). Note: This method is only valid for querying {@link Stack#ContentType#Entry}.\n * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().includeContentType().find()\n * @returns {Query}\n */\n\n /**\n * @function\n * @name Query#includeOwner\n * @description This method is used to include the owner of the entry(ies) in the result set. Note: This method is only valid for querying {@link Stack#ContentType#Entry}.\n * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().includeOwner().find()\n * @returns {Query}\n */\n // -----------------------------------------Entry Queries End------------------------------------------------------\n\n /**\n * @function\n * @name Query#environment\n * @description This method is used to set the environment name of which you want to retrieve the data.\n * @param {String} environment_uid - UID/Name of environment\n * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().environment('development').find()\n * @returns {Query}\n */\n\n /**\n * @description This method provides only the entries containing field values matching the specified condition.\n * @param {String} key - UID of the field\n * @param {*} value - The value used to match or compare\n * @example appSDK.stack.ContentType('blog').where('title','Demo')\n * @returns {Query}\n */\n equalTo(key, value) {\n if (key && typeof key === \"string\") {\n this._query.query[key] = value;\n\n return this;\n }\n throw Error(\"Kindly provide valid parameters.\");\n }\n\n where(key, value) {\n if (key && typeof key === \"string\") {\n this._query.query[key] = value;\n return this;\n }\n throw Error(\"Kindly provide valid parameters.\");\n }\n\n /**\n * @description This method provides only the number of entries matching the specified filters.\n * @example appSDK.stack.ContentType('blog').count()\n * @returns {Query}\n */\n count() {\n this._query.count = true;\n const options = {\n content_type_uid: this.contentTypeUid,\n params: this._query,\n action: `get${this.module}`,\n };\n return this._connection\n .sendToParent(\"stackQuery\", options)\n .then(onData)\n .catch(onError);\n }\n\n /**\n * @description This method is used to set raw queries on the Query instance.\n * @param {object} query - Raw{json} queries to filter the entries in the result set.\n * @returns {Query}\n */\n query(query) {\n if (typeof query === \"object\") {\n this._query.query = Utils.mergeDeep(this._query.query, query);\n return this;\n }\n throw Error(\"Kindly provide valid parameters\");\n }\n\n /**\n * @description The ’tags’ parameter allows you to specify an array of tags to search for objects.\n * @param {Array} values - Tags\n * @example appSDK.stack.ContentType('blog').tags(['technology', 'business'])\n * @returns {Query}\n */\n tags(values) {\n if (Array.isArray(values)) {\n this._query.tags = values;\n return this;\n }\n throw Error(\"Kindly provide valid parameters\");\n }\n\n /**\n * @description This method also includes the total number of entries returned in the response.\n * @example appSDK.stack.ContentType('blog').includeCount()\n * @returns {Query}\n */\n includeCount() {\n this._query.include_count = true;\n return this;\n }\n\n /**\n * @summary returns Returns the raw query which can be used for further calls (.and/.or).\n * @description This method provides raw{json} queries based on the filters applied on the Query object.\n * @example appSDK.stack.ContentType('blog').where('title','Demo').getQuery()\n * @returns {Query}\n */\n getQuery() {\n return this._query.query;\n }\n\n /**\n * @description This method provides only the entries matching the regular expression for the specified field.\n * @param {String} key - UID of the field\n * @param {*} value - The value used to match or compare\n * @param {String} [options] - Match or compare a value in the entry\n * @example\n * .regex without options\n * let blogQuery = appSDK.stack.ContentType('blog').regex('title','^Demo')\n * @example\n * .regex with options\n * let blogQuery = appSDK.stack.ContentType('blog').regex('title','^Demo', 'i')\n * @returns {Query}\n */\n regex(key, value, options) {\n if (\n key &&\n value &&\n typeof key === \"string\" &&\n typeof value === \"string\"\n ) {\n this._query.query[key] = {\n $regex: value,\n };\n if (options) this._query.query[key].$options = options;\n return this;\n }\n throw Error(\"Kindly provide valid parameters.\");\n }\n\n /**\n * @description This method is used to search data in entries.\n * @param {string} value - Value to search in the entries.\n * @example appSDK.stack.ContentType('blog').search('Welcome to demo')\n * @returns {Query}\n */\n search(value) {\n if (value && typeof value === \"string\") {\n this._query.typeahead = value;\n return this;\n }\n throw Error(\"Kindly provide valid parameters.\");\n }\n\n /**\n * @description This method provides all the entries which satisfy the specified query.\n * @example\n * let blogQuery = appSDK.stack.ContentType('blog').find()\n */\n find() {\n const options = {\n content_type_uid: this.contentTypeUid,\n params: this._query,\n action: `get${this.module}`,\n };\n return this._connection\n .sendToParent(\"stackQuery\", options)\n .then(onData)\n .catch(onError);\n }\n\n /**\n * @description This method provides a single entry from the result set.\n * @example\n * let blogQuery = appSDK.stack.ContentType('blog').findOne()\n */\n findOne() {\n this.singleEntry = true;\n this._query.limit = 1;\n const options = {\n content_type_uid: this.contentTypeUid,\n params: this._query,\n action: `get${this.module}`,\n };\n return this._connection\n .sendToParent(\"stackQuery\", options)\n .then(onData)\n .catch(onError);\n }\n}\n\nexport default Query;\n","import Asset from './api/asset/index';\nimport ContentType from './api/content-type/index';\nimport { onData, onError } from \"../utils/utils\";\nimport { BranchDetail, GetAllStacksOptions, StackAdditionalData, StackDetail, StackSearchQuery } from '../types/stack.types';\nimport { IManagementTokenDetails } from '../types';\n\n\n/**\n * Class representing the current stack in Contentstack UI.\n */\n\nclass Stack {\n /**\n * @hideconstructor\n */\n\n _connection: any\n _data: StackDetail\n ContentType: any \n Asset: any \n private _currentBranch: BranchDetail | null = null;\n\n\n constructor(data: StackDetail = {} as StackDetail, connection: any, additionalData: StackAdditionalData) {\n this._connection = connection;\n this._data = data;\n /**\n * @constructor\n * @hideconstructor\n * @desc Content type defines the structure or schema of a page or a section of your web or mobile property\n * @see {@link https://www.contentstack.com/docs/apis/content-management-api/#content-types| ContentType}\n * @param {string} uid - Uid of contenttype.\n * @example appSDK.stack.ContentType('content_type_uid')\n * */\n this.ContentType = ContentType(connection);\n /**\n * @constructor\n * @hideconstructor\n * @desc An initializer is responsible for creating an Asset object.\n * @see {@link https://www.contentstack.com/docs/apis/content-management-api/#assets| Asset}\n * @param {string} uid - UID of the asset.\n * @example appSDK.stack.Asset('asset_uid')\n * */\n this.Asset = Asset(connection);\n\n const currentBranch = additionalData.currentBranch || \"\"\n\n if (currentBranch) {\n this._currentBranch =\n (data.branches || []).find(\n (branch) => branch.uid === additionalData.currentBranch\n ) || null;\n }\n\n }\n\n\n /**\n * This method returns the data of the current stack.\n * @return Returns stack data.\n */\n\n getData(): StackDetail {\n return this._data;\n }\n\n\n /**\n * This method returns all the stacks in the current organization.\n * @param query asks for organization UID and query params to get all stacks\n * @returns Stacks within current organization\n */\n async getAllStacks({orgUid = \"\", params = {}}: GetAllStacksOptions = {}): Promise {\n \n // validation\n if (typeof orgUid !== 'string') {\n throw new TypeError('orgUid must be a string');\n }\n\n const options = {\n action: \"getStacks\",\n headers: { organization_uid: orgUid || this._data.org_uid },\n skip_api_key: true,\n params\n };\n return this._connection\n .sendToParent(\"stackQuery\", options)\n .then(onData)\n .then((data) => data.stacks || [])\n .catch(onError);\n\n }\n\n /**\n * Get the details of all the management tokens of the stack.\n * Note: This API does not return the token value.\n * @see {@link https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-management-tokens | Get all management tokens}\n * @returns Details of all the management token of the stack\n */\n async getManagementTokens(): Promise {\n const options = { action: \"getManagementTokens\" };\n return this._connection\n .sendToParent(\"stackQuery\", options)\n .then(async (response) => {\n const data = await onData<{tokens: IManagementTokenDetails[]}>(response);\n return data.tokens || [];\n })\n .catch(onError);\n }\n\n /**\n * Gets the results of the search based on user query\n * @param queries Array of key value pair of query parameters\n * @param apiKey API key of the stack\n * @returns Result of the query\n */\n search(queries: StackSearchQuery, apiKey: string | null = this._data.api_key) {\n const options = { params: queries, api_key: apiKey, action: \"search\" };\n return this._connection\n .sendToParent(\"stackQuery\", options)\n .then(onData)\n .catch(onError);\n }\n\n\n /**\n * This API allows you to retrieve data of a content type of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-single-content-type| Content Type API} requests. This method returns a Promise object.\n * @param {string} uid Uid of the desired content type\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A promise object which will be resolved with content type details.\n */\n getContentType(uid: string, params = {}): Promise<{ [key: string]: any }> {\n if (!uid) {\n return Promise.reject(new Error('uid is required'));\n }\n const options = { uid, params, action: 'getContentType' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrieve data of a content types of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-all-content-types| Content Types API} requests. This method returns a Promise object.\n * @param {Object} query Query for the GET call\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A promise object which will be resolved with details of the content type.\n */\n getContentTypes(query = {}, params: { [key: string]: any } = {}): Promise<{ [key: string]: any }> {\n const optionParams = params;\n optionParams.query = query;\n const options = { params: optionParams, action: 'getContentTypes' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrieve environment details of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-single-environment| Environment API} requests. This method returns a Promise object.\n * @param {string} name Name of the desired environment\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A promise object which will be resolved with environment details.\n */\n getEnvironment(name: string, params = {}) {\n if (!name) {\n return Promise.reject(new Error('name is required'));\n }\n const options = { name, params, action: 'getEnvironment' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrieve details of environments of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-all-environments| Environments API} requests. This method returns a Promise object.\n * @param {Object} query Query for the GET call\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A Promise object which will be resolved with details of the environments.\n */\n getEnvironments(query = {}, params = {}) {\n const optionParams: { [key: string]: any } = params;\n optionParams.query = query;\n const options = { params: optionParams, action: 'getEnvironments' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrieve details of releases of a stack using the {@link https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-releases| Releases API} requests. This method returns a Promise object.\n * @param {Object} query Query for the GET call\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A Promise object which will be resolved with details of the releases.\n */\n getReleases(query = {}, params = {}) {\n const optionParams: { [key: string]: any } = params;\n optionParams.query = query;\n const options = { params: optionParams, action: 'getReleases' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrieve details of publish queue of a stack using the {@link https://www.contentstack.com/docs/developers/apis/content-management-api/#get-publish-queue| Publish Queue API} requests. This method returns a Promise object.\n * @param {Object} query Query for the GET call\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A Promise object which will be resolved with details of the publish queue.\n */\n getPublishes(query = {}, params = {}) {\n const optionParams: { [key: string]: any } = params;\n optionParams.query = query;\n const options = { params: optionParams, action: 'getPublishes' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrive a locale of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-language| Language API} requests. Method returns a Promise object.\n * @param {string} code Code of the desired locale\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A promise object which will be resolved with locale details.\n */\n getLocale(code: string, params = {}) {\n if (!code) {\n return Promise.reject(new Error('code is required'));\n }\n const options = { code, params, action: 'getLocale' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrive the locales of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-all-content-types| Languages API} requests. Method returns a Promise object.\n * @param {Object} query Query for the GET call\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A Promise object which will be resolved with details of the locales.\n */\n getLocales(query = {}, params = {}) {\n const optionParams: { [key: string]: any } = params;\n optionParams.query = query;\n const options = { params: optionParams, action: 'getLocales' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrive a workflow of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-workflow| Language API} requests. Method returns a Promise object.\n * @param {string} code Code of the desired locale\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A promise object which will be resolved with locale details.\n */\n getWorkflow(uid: string, params = {}) {\n if (!uid) {\n return Promise.reject(new Error('workflow uid is required'));\n }\n const options = { uid, params, action: 'getWorkflow' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n \n /**\n * This API allows you to retrive the locales of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-all-content-types| Languages API} requests. Method returns a Promise object.\n * @param {Object} query Query for the GET call\n * @param {Object} params Optional parameters for the GET call\n * @return {Object} A Promise object which will be resolved with details of the locales.\n */\n getWorkflows(query = {}, params = {}) {\n const optionParams: { [key: string]: any } = params;\n optionParams.query = query;\n const options = { params: optionParams, action: 'getWorkflows' };\n return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError);\n }\n\n /**\n * This API allows you to retrieve all the branches in the current stack\n * @returns All branches of the current stack\n */\n getAllBranches(): BranchDetail[] {\n return this._data.branches || [];\n }\n\n /**\n * Returns the details of the current branch of the stack if available\n * @returns current branch of the current stack if available\n */\n getCurrentBranch(): BranchDetail | null {\n return this._currentBranch;\n }\n}\n\nexport default Stack;\n","export function transform(type) {\n return function () {\n switch (arguments.length) {\n case 1:\n if (\n Array.isArray(arguments[0]) ||\n typeof arguments[0] === \"string\"\n ) {\n let query = this._query[`${type}[BASE]`] || [];\n query = query.concat(arguments[0]);\n this._query[`${type}[BASE]`] = query;\n return this;\n }\n throw Error(\"Kindly provide valid parameters\");\n\n case 2:\n if (\n typeof arguments[0] === \"string\" &&\n (Array.isArray(arguments[1]) ||\n typeof arguments[1] === \"string\")\n ) {\n let query = this._query[`${type}[${arguments[0]}]`] || [];\n query = query.concat(arguments[1]);\n this._query[`${type}[${arguments[0]}]`] = query;\n return this;\n }\n throw Error(\"Kindly provide valid parameters\");\n\n default:\n throw Error(\"Kindly provide valid parameters\");\n }\n };\n}\n\n// merge two objects\nexport function merge(\n target: { [key: string]: any },\n source: { [key: string]: any }\n) {\n const newTraget = target;\n if (target && source) {\n Object.keys(source).forEach((key) => {\n newTraget[key] = source[key];\n });\n }\n return newTraget;\n}\n\n// merge two objects\nexport function mergeDeep(\n oldTarget: { [key: string]: any },\n oldSource: { [key: string]: any }\n) {\n const newTarget = oldTarget;\n const self = this;\n const _mergeRecursive = (anotherTarget, source) => {\n const target = anotherTarget;\n Object.keys(source).forEach((key) => {\n if (\n self._type(source[key]) === \"object\" &&\n self._type(target[key]) === self._type(source[key])\n ) {\n _mergeRecursive(target[key], source[key]);\n } else if (\n self._type(source[key]) === \"array\" &&\n self._type(target[key]) === self._type(source[key])\n ) {\n target[key] = target[key].concat(source[key]);\n } else {\n target[key] = source[key];\n }\n });\n };\n _mergeRecursive(newTarget, oldSource);\n return newTarget;\n}\n\nexport function _type(val) {\n let __typeof = typeof val;\n if (__typeof === \"object\" && Array.isArray(val)) {\n //@ts-ignore\n __typeof = \"array\";\n }\n return __typeof;\n}\n\nexport function addParam(key, value) {\n if (key && typeof key === \"string\" && value && typeof value === \"string\") {\n this._query[key] = value;\n return this;\n }\n throw Error(\"Kindly provide valid parameters.\");\n}\n\nexport function addQuery(key, value) {\n if (key && value && typeof key === \"string\") {\n this._query[key] = value;\n return this;\n }\n throw Error(\"First argument should be a String.\");\n}\n\nexport function language(languageCode) {\n if (languageCode && typeof languageCode === \"string\") {\n this._query.locale = languageCode;\n return this;\n }\n throw Error(\"Argument should be a String.\");\n}\n\nexport function environment(environmentCode) {\n if (environmentCode && typeof environmentCode === \"string\") {\n this._query.environment = environmentCode;\n return this;\n }\n throw Error(\"Argument should be a String.\");\n}\n\nexport function includeOwner() {\n this._query.include_owner = true;\n return this;\n}\n\nexport function includeContentType() {\n this._query.include_content_type = true;\n return this;\n}\n\nexport function includeSchema() {\n this._query.include_schema = true;\n return this;\n}\n\nexport function includeReference(val) {\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i += 1) {\n this._query[\"include[]\"] = this._query[\"include[]\"] || [];\n this._query[\"include[]\"] = this._query[\"include[]\"].concat(val[i]);\n }\n } else if (typeof val === \"string\") {\n for (let i = 0; i < arguments.length; i += 1) {\n this._query[\"include[]\"] = this._query[\"include[]\"] || [];\n this._query[\"include[]\"] = this._query[\"include[]\"].concat(\n arguments[i]\n );\n }\n } else {\n throw Error(\"Argument should be a String or an Array.\");\n }\n return this;\n}\n\nexport function getReferences() {\n return this.fetch(`get${this.constructor.module()}References`);\n}\n","import { GenericObjectType } from \"./types/common.types\";\nimport { onError } from \"./utils/utils\";\nimport postRobot from \"post-robot\";\n\n/**\n * Class used by an app to store your data in {@link external:localStorage}.\n * @hideconstructor\n */\nclass Store {\n _connection: typeof postRobot;\n\n constructor(connection: typeof postRobot) {\n this._connection = connection;\n }\n\n /**\n * Retrieves the stored data value associated with the given key.\n * @param {string} key - The key of the stored data.\n * @example\n * appSDK.store.get('key').then((value) => console.log(value)); // Logs the value for the given key\n * @returns {Promise} A Promise that resolves to the value associated with the key.\n */\n get(key: string): Promise {\n if (!key || typeof key !== \"string\") {\n throw new Error(\"Kindly provide valid parameters\");\n }\n return this._connection\n .sendToParent(\"store\", { action: \"get\", key })\n .then((event: { data: GenericObjectType }) =>\n Promise.resolve(event.data)\n )\n .catch(onError);\n }\n\n /**\n * Retrieves an object with all the stored key-value pairs.\n * @example await appSDK.store.getAll(); // Returns a Promise containing the stored data.\n * @return {Promise} A Promise that resolves with the stored key-value pairs as an object.\n */\n getAll(): Promise {\n return this._connection\n .sendToParent(\"store\", { action: \"getAll\" })\n .then(({ data = {} }) => Promise.resolve(data))\n .catch(onError);\n }\n\n /**\n * Sets the value of a key.\n * @param {string} key The key for the stored data.\n * @param {*} value The data to be stored.\n * @example await appSDK.store.set('key', 'value'); // Returns a Promise that resolves with the success status.\n * @return {Promise} A Promise that resolves with the success status (true when the value was set successfully).\n */\n set(key: string, value: any): Promise {\n if (!key || !value || typeof key !== \"string\") {\n throw new Error(\"Kindly provide valid parameters\");\n }\n return this._connection\n .sendToParent(\"store\", { action: \"set\", key, value })\n .then(() => Promise.resolve(true))\n .catch(onError);\n }\n\n /**\n * Removes the value associated with a key from the store.\n * @param {string} key The key whose value needs to be removed.\n * @example await appSDK.store.remove('key'); // Returns a Promise that resolves with the success status.\n * @return {Promise} A Promise that resolves with the success status (true when the value was removed successfully).\n */\n remove(key: string): Promise {\n if (!key || typeof key !== \"string\") {\n throw new Error(\"Kindly provide valid parameters\");\n }\n return this._connection\n .sendToParent(\"store\", { action: \"remove\", key })\n .then(() => Promise.resolve(true))\n .catch(onError);\n }\n\n /**\n * Clears all the stored data of an UI Location.\n * @example await appSDK.store.clear(); // Returns a Promise that resolves with the success status.\n * @returns {Promise} A Promise that resolves with the success status (true when all values are cleared successfully).\n */\n clear(): Promise {\n return this._connection\n .sendToParent(\"store\", { action: \"clear\" })\n .then(() => Promise.resolve(true))\n .catch(onError);\n }\n}\n\nexport default Store;\n","import EntryClass from \"./entry\";\nimport Field from \"./field\";\nimport FieldModifierLocationField from \"./fieldModifierLocation/field\";\nimport FieldModifierLocationFrame from \"./fieldModifierLocation/frame\";\nimport Stack from \"./stack\";\nimport { GenericObjectType } from \"./types/common.types\";\nimport { Entry } from \"./types/entry.types\";\nimport { Asset, ContentType, Schema, StackDetail } from \"./types/stack.types\";\nimport { User } from \"./types/user.types\";\nimport Window from \"./window\";\n\nexport declare interface IDashboardWidget {\n frame: Window;\n stack: Stack;\n}\n\nexport declare interface ICustomField {\n entry: EntryClass;\n field: Field;\n fieldConfig: GenericObjectType;\n frame: Window;\n stack: Stack;\n}\n\nexport declare interface ISidebarWidget {\n entry: EntryClass;\n stack: Stack;\n}\n\nexport declare interface IFieldModifierLocation {\n entry: EntryClass;\n stack: Stack;\n field: FieldModifierLocationField;\n frame: FieldModifierLocationFrame;\n}\n\nexport declare interface IFullPageLocation {\n stack: Stack;\n}\n\nexport declare interface ManifestUser {\n uid: string;\n first_name: string;\n last_name: string;\n}\n\nexport declare interface Manifest {\n created_by: ManifestUser;\n icon: string;\n name: string;\n target_type: string;\n uid: string;\n updated_by: ManifestUser;\n version: number;\n visibility: string;\n}\n\nexport declare interface IAppConfigWidget {\n installation: {\n setInstallationData: (\n installationData: IInstallationData\n ) => Promise;\n getInstallationData: () => Promise;\n setValidity: (isValid: boolean, options?: ValidationOptions) => void;\n stack(): Stack;\n };\n stack: Stack;\n}\n\nexport enum DashboardWidth {\n FULL_WIDTH = \"full_width\",\n HALF_WIDTH = \"half_width\",\n}\n\nexport enum LocationType {\n APP_CONFIG_WIDGET = \"APP_CONFIG_WIDGET\",\n ASSET_SIDEBAR_WIDGET = \"ASSET_SIDEBAR_WIDGET\",\n DASHBOARD = \"DASHBOARD\",\n FIELD = \"FIELD\",\n FIELD_MODIFIER_LOCATION = \"FIELD_MODIFIER_LOCATION\",\n FULL_PAGE_LOCATION = \"FULL_PAGE_LOCATION\",\n RTE = \"RTE\",\n WIDGET = \"WIDGET\",\n}\n\n// Init data\n\ndeclare interface ICommonInitData {\n app_id: string;\n currentBranch: string;\n extension_uid: string;\n installation_uid: string;\n region: string;\n stack: StackDetail;\n type: LocationType;\n user: User;\n manifest?: Manifest;\n}\n\nexport declare interface IDashboardInitData extends ICommonInitData {\n dashboard_width: DashboardWidth;\n config?: GenericObjectType;\n type: LocationType.DASHBOARD;\n}\n\nexport declare interface ISidebarInitData extends ICommonInitData {\n config?: GenericObjectType;\n content_type: ContentType;\n entry: Entry;\n locale: string;\n type: LocationType.WIDGET;\n}\n\nexport declare interface IFieldInitData extends ICommonInitData {\n config?: GenericObjectType;\n content_type: ContentType;\n entry: Entry;\n field_config: GenericObjectType;\n locale: string;\n schema: Schema;\n self: boolean;\n type: LocationType.FIELD;\n uid: string;\n value: any;\n}\n\nexport declare interface IFullPageLocationInitData extends ICommonInitData {\n config?: GenericObjectType;\n type: LocationType.FULL_PAGE_LOCATION;\n}\n\nexport declare interface IRTEInitData extends ICommonInitData {\n config?: GenericObjectType;\n type: LocationType.RTE;\n}\n\nexport declare interface IAppConfigInitData extends ICommonInitData {\n config?: GenericObjectType;\n type: LocationType.APP_CONFIG_WIDGET;\n}\n\nexport declare interface IAssetSidebarInitData extends ICommonInitData {\n config: GenericObjectType;\n currentAsset: Asset;\n type: LocationType.ASSET_SIDEBAR_WIDGET;\n}\n\nexport declare interface IFieldModifierLocationInitData\n extends ICommonInitData {\n changedData: Entry;\n config?: GenericObjectType;\n content_type: ContentType;\n entry: Entry;\n locale: string;\n schema: Schema;\n self: boolean;\n value: any;\n type: LocationType.FIELD_MODIFIER_LOCATION;\n uid: string;\n}\n\nexport declare interface setAssetDto {\n title: string;\n description: string;\n tags: string[];\n}\n\nexport enum StackLocation {\n STACK_CONFIG = \"cs.cm.stack.config\",\n DASHBOARD = \"cs.cm.stack.dashboard\",\n SIDEBAR = \"cs.cm.stack.sidebar\",\n CUSTOM_FIELD = \"cs.cm.stack.custom_field\",\n RTE = \"cs.cm.stack.rte\",\n}\n\nexport enum OrganizationLocation {\n ORG_CONFIG = \"cs.org.config\",\n}\n\nexport type AppLocation = StackLocation | OrganizationLocation;\n\nexport interface Scope {\n content_types: string[];\n}\n\nexport type InitializationData =\n | IAppConfigInitData\n | IAssetSidebarInitData\n | IDashboardInitData\n | IFieldInitData\n | IFieldModifierLocationInitData\n | IFullPageLocationInitData\n | IRTEInitData\n | ISidebarInitData;\n\n/**\n * installation details API response\n */\nexport interface IInstallationData {\n configuration: { [key: string]: any };\n serverConfiguration: { [key: string]: any };\n webhooks?: {\n channels: string[];\n }[];\n uiLocations?: {\n type: AppLocation;\n meta: {\n enabled: boolean;\n scope?: Scope;\n name: string;\n extentionUid: string;\n }[];\n }[];\n}\n// End of Init data\n\nexport declare interface ValidationOptions {\n message?: string;\n}\n\nexport declare interface IManagementTokenDetails {\n uid: string;\n name: string;\n}\n\nexport enum Region {\n UNKNOWN = \"UNKNOWN\",\n NA = \"NA\",\n EU = \"EU\",\n AZURE_NA = \"AZURE_NA\",\n AZURE_EU = \"AZURE_EU\",\n}\n","import postRobot from \"post-robot\";\nimport EventEmitter from \"wolfy87-eventemitter\";\n\nimport AssetSidebarWidget from \"./AssetSidebarWidget\";\nimport { IRTEPluginInitializer } from \"./RTE/types\";\nimport { AppConfig } from \"./appConfig\";\nimport Entry from \"./entry\";\nimport Field from \"./field\";\nimport FieldModifierLocationEntry from \"./fieldModifierLocation/entry\";\nimport FieldModifierLocationField from \"./fieldModifierLocation/field\";\nimport FieldModifierLocationFrame from \"./fieldModifierLocation/frame\";\nimport Metadata from \"./metadata\";\nimport Modal from \"./modal\";\nimport Stack from \"./stack\";\nimport Store from \"./store\";\nimport {\n IAppConfigWidget,\n ICustomField,\n IDashboardWidget,\n IFieldModifierLocation,\n IFullPageLocation,\n ISidebarWidget,\n InitializationData,\n LocationType,\n Manifest,\n Region,\n} from \"./types\";\nimport { GenericObjectType } from \"./types/common.types\";\nimport { User } from \"./types/user.types\";\nimport { formatAppRegion, onData, onError } from \"./utils/utils\";\nimport Window from \"./window\";\n\nconst emitter = new EventEmitter();\n\n/**\n * Class representing an UI Location from Contentstack App SDK.\n * @hideconstructor\n */\n\nclass UiLocation {\n /**\n * This value represents the current app's unique ID.\n */\n appUID: string;\n\n /**\n * This holds the app's installation ID.\n */\n installationUID: string;\n\n /**\n * This object holds details of the current user.\n */\n currentUser: User;\n\n /**\n * The type of UI Location being rendered.\n */\n private type: LocationType;\n\n /**\n * The configuration set for an app.\n */\n private config: GenericObjectType;\n\n /**\n * This holds the instance of Cross-domain communication library for posting messages between windows.\n */\n postRobot: typeof postRobot;\n\n /**\n * This holds the stack instance that allows users to read and manipulate a range of objects in a stack.\n */\n stack: Stack;\n\n /**\n * Store to persist data for the app.\n * Note: Data is stored in the browser's {@link external:localStorage} and will be lost if the {@link external:localStorage} is cleared in the browser.\n */\n store: Store;\n\n /**\n * This holds the instance of the Metadata class used to manage metadata.\n */\n metadata: Metadata;\n\n /**\n * This value represents the current UI location's unique ID. One App may contain multiple UI locations\n */\n locationUID: string;\n\n /**\n * This holds the instance of a helper class used to manage modals in an App.\n */\n modal: Modal;\n\n /**\n * The Contentstack Region on which the app is running.\n */\n readonly region: Region;\n version: number | null;\n\n /**\n * This holds the information of the currently running UI location of an App.\n */\n location: {\n DashboardWidget: IDashboardWidget | null;\n SidebarWidget: ISidebarWidget | null;\n CustomField: ICustomField | null;\n RTEPlugin: IRTEPluginInitializer | null;\n AppConfigWidget: IAppConfigWidget | null;\n AssetSidebarWidget: AssetSidebarWidget | null;\n FullPage: IFullPageLocation | null;\n FieldModifierLocation: IFieldModifierLocation | null;\n };\n\n constructor(initData: InitializationData) {\n const initializationData = initData;\n\n this.postRobot = postRobot;\n\n this.appUID = initializationData.app_id;\n\n this.locationUID = initializationData.extension_uid;\n\n this.installationUID = initializationData.installation_uid;\n\n this.currentUser = initializationData.user;\n\n this.type = initializationData.type;\n\n this.store = new Store(postRobot);\n\n this.stack = new Stack(initializationData.stack, postRobot, {\n currentBranch: initializationData.currentBranch,\n });\n\n this.metadata = new Metadata(postRobot);\n\n this.config = initializationData.config ?? {};\n\n this.location = {\n DashboardWidget: null,\n CustomField: null,\n SidebarWidget: null,\n RTEPlugin: null,\n AppConfigWidget: null,\n AssetSidebarWidget: null,\n FullPage: null,\n FieldModifierLocation: null,\n };\n\n window[\"postRobot\"] = postRobot;\n\n this.modal = new Modal();\n\n this.region = formatAppRegion(initializationData.region);\n\n const stack = new Stack(initializationData.stack, postRobot, {\n currentBranch: initializationData.currentBranch,\n });\n\n this.version = initializationData.manifest?.version || null;\n\n switch (initializationData.type) {\n case LocationType.DASHBOARD: {\n this.location.DashboardWidget = {\n frame: new Window(\n postRobot,\n this.type as LocationType.DASHBOARD,\n emitter,\n initializationData.dashboard_width\n ),\n stack: new Stack(initializationData.stack, postRobot, {\n currentBranch: initializationData.currentBranch,\n }),\n };\n break;\n }\n case LocationType.WIDGET: {\n this.location.SidebarWidget = {\n entry: new Entry(initializationData, postRobot, emitter),\n stack: new Stack(initializationData.stack, postRobot, {\n currentBranch: initializationData.currentBranch,\n }),\n };\n break;\n }\n\n case LocationType.APP_CONFIG_WIDGET: {\n this.location.AppConfigWidget = {\n installation: new AppConfig(\n initializationData,\n postRobot,\n emitter,\n {\n currentBranch: initializationData.currentBranch,\n }\n ),\n stack: new Stack(initializationData.stack, postRobot, {\n currentBranch: initializationData.currentBranch,\n }),\n };\n break;\n }\n\n case LocationType.ASSET_SIDEBAR_WIDGET: {\n this.location.AssetSidebarWidget = new AssetSidebarWidget(\n initializationData,\n postRobot,\n emitter\n );\n break;\n }\n\n case LocationType.RTE: {\n import(\"./RTE\").then(({ rtePluginInitializer }) => {\n this.location.RTEPlugin = rtePluginInitializer;\n });\n break;\n }\n\n case LocationType.FIELD_MODIFIER_LOCATION: {\n initializationData.self = true;\n this.location.FieldModifierLocation = {\n entry: new FieldModifierLocationEntry(\n initializationData,\n postRobot,\n emitter\n ),\n stack: new Stack(initializationData.stack, postRobot, {\n currentBranch: initializationData.currentBranch,\n }),\n field: new FieldModifierLocationField(\n initializationData,\n postRobot,\n emitter\n ),\n frame: new FieldModifierLocationFrame(postRobot, emitter),\n };\n break;\n }\n\n case LocationType.FULL_PAGE_LOCATION: {\n this.location.FullPage = {\n stack: stack,\n };\n break;\n }\n\n case LocationType.FIELD:\n default: {\n initializationData.self = true;\n this.location.CustomField = {\n field: new Field(initializationData, postRobot, emitter),\n fieldConfig: initializationData.field_config,\n entry: new Entry(initializationData, postRobot, emitter),\n stack: new Stack(initializationData.stack, postRobot, {\n currentBranch: initializationData.currentBranch,\n }),\n frame: new Window(\n postRobot,\n this.type as LocationType.FIELD,\n emitter\n ),\n };\n\n break;\n }\n }\n\n try {\n postRobot.on(\"extensionEvent\", async (event) => {\n if (event.data.name === \"entrySave\") {\n emitter.emitEvent(\"entrySave\", [{ data: event.data.data }]);\n emitter.emitEvent(\"updateFields\", [\n { data: event.data.data },\n ]);\n }\n\n if (event.data.name === \"entryChange\") {\n emitter.emitEvent(\"entryChange\", [\n {\n data: event.data.data,\n resolvedData: event.data.otherData.resolvedData,\n },\n ]);\n }\n\n if (event.data.name === \"entryPublish\") {\n emitter.emitEvent(\"entryPublish\", [\n { data: event.data.data },\n ]);\n }\n\n if (event.data.name === \"entryUnPublish\") {\n emitter.emitEvent(\"entryUnPublish\", [\n { data: event.data.data },\n ]);\n }\n\n if (event.data.name === \"assetSave\") {\n emitter.emitEvent(\"assetSave\", [{ data: event.data.data }]);\n emitter.emitEvent(\"updateFields\", [\n { data: event.data.data },\n ]);\n }\n\n if (event.data.name === \"assetChange\") {\n emitter.emitEvent(\"assetChange\", [\n { data: event.data.data },\n ]);\n }\n\n if (event.data.name === \"assetPublish\") {\n emitter.emitEvent(\"assetPublish\", [\n { data: event.data.data },\n ]);\n }\n\n if (event.data.name === \"assetUnPublish\") {\n emitter.emitEvent(\"assetUnPublish\", [\n { data: event.data.data },\n ]);\n }\n\n if (event.data.name === \"dashboardResize\") {\n emitter.emitEvent(\"dashboardResize\", [\n { state: event.data.state },\n ]);\n }\n\n if (event.data.name === \"extensionFieldChange\") {\n emitter.emitEvent(\"extensionFieldChange\", [\n { data: event.data.data },\n ]);\n }\n });\n } catch (err) {\n console.error(\"Extension Event\", err);\n }\n }\n\n pulse = (eventName: string, metadata: GenericObjectType): void => {\n this.postRobot.sendToParent(\"analytics\", { eventName, metadata });\n };\n\n /**\n * Method used to retrieve the configuration set for an app.\n */\n getConfig = (): Promise => {\n if (!this.installationUID) {\n return Promise.resolve(this.config);\n }\n return this.postRobot\n .sendToParent(\"getConfig\")\n .then(onData)\n .catch(onError);\n };\n\n /**\n * Method used to get the type of currently running UI location of the app.\n */\n getCurrentLocation = (): LocationType => {\n return this.type;\n };\n\n /**\n * Conditionally retrieves and returns the app version if not present already\n * @returns version of the app currently running.\n */\n getAppVersion = async (): Promise => {\n if (this.version) {\n return Promise.resolve(this.version);\n }\n if (!this.installationUID) {\n return Promise.resolve(null);\n }\n const orgUid = this.stack._data.org_uid;\n const options = {\n uid: this.installationUID,\n action: \"getAppManifest\",\n headers: { organization_uid: orgUid },\n skip_api_key: true,\n };\n const app: Manifest = await this.postRobot\n .sendToParent(\"stackQuery\", options)\n .then(onData)\n .catch(onError);\n this.version = app.version;\n return this.version;\n };\n\n /**\n * Method used to get the Contentstack Region on which the app is running.\n */\n getCurrentRegion = (): Region => {\n return this.region;\n };\n\n /**\n * Method used to initialize the App SDK.\n * @param version - Version of the app SDK in use.\n */\n static async initialize(version: string): Promise {\n const meta = {\n sdkType: \"app-sdk\",\n };\n const initData = await postRobot.sendToParent(\n \"init\",\n { version, meta }\n );\n return initData.data;\n }\n\n setReady(): Promise {\n return this.postRobot.sendToParent(\"ready\");\n }\n}\n\nexport default UiLocation;\n","export const ERROR_MESSAGES = Object.freeze({\n configPage: {\n setValidity: {\n isValidTypeBoolean: \"isValid should be a boolean\",\n messageTypeString: \"message should be a string\",\n },\n },\n entryField: {\n entry: {\n tagsShouldNotBeBlank: \"Tags cannot be blank\",\n tagsShouldBeArrayOfStrings: \"Tags must be an array of strings\",\n },\n frame: {\n dimensionHeightShouldBeNumber: \"Dimension height must be a number\",\n dimensionWidthShouldBeNumber: \"Dimension width must be a number\",\n },\n },\n});\n\nexport default function generateErrorMessages(message: string) {\n return `Contentstack App SDK: ${message}`;\n}\n","import { Region } from \"../types\";\n\nexport function onData>(data: { data: Data }) {\n if (typeof data.data === \"string\") {\n return Promise.reject(data.data);\n }\n return Promise.resolve(data.data);\n}\n\nexport function onError(error: Error) {\n return Promise.reject(error);\n}\n\nexport function formatAppRegion(region: string): Region {\n switch (region) {\n case \"NA\":\n return Region.NA;\n case \"EU\":\n return Region.EU;\n case \"AZURE_NA\":\n return Region.AZURE_NA;\n case \"AZURE_EU\":\n return Region.AZURE_EU;\n default:\n return Region.UNKNOWN;\n }\n}\n\nexport function getPreferredBodyElement(nodeCollection: HTMLCollection) {\n let rootElementIndex = Infinity;\n let rootElement: Element | undefined;\n const elementPreferenceList = [\n \"HEADER\",\n \"NAV\",\n \"MAIN\",\n \"SECTION\",\n \"ARTICLE\",\n \"ASIDE\",\n \"FOOTER\",\n \"DIV\",\n ];\n const nonRenderingTags = [\"SCRIPT\", \"NOSCRIPT\", \"STYLE\", \"TEMPLATE\"];\n // ? choose higher preference semantic HTML tags\n Array.from(nodeCollection).forEach((el) => {\n const elIndex = elementPreferenceList.indexOf(el.nodeName);\n if (elIndex >= 0 && elIndex < rootElementIndex) {\n rootElementIndex = elIndex;\n rootElement = el;\n }\n });\n // ? choose the first rendering HTML tag found if no semantic tags found\n if (!rootElement) {\n rootElement = Array.from(nodeCollection).find(\n (el) => !nonRenderingTags.includes(el.nodeName)\n );\n }\n return rootElement || nodeCollection[0];\n}\n","import EventEmitter from \"wolfy87-eventemitter\";\nimport postRobot from \"post-robot\";\nimport { DashboardWidth, LocationType } from \"./types\";\n\nconst config = { attributes: true, childList: true, subtree: true };\nlet observer: MutationObserver;\n/**\n * Class representing an iframe window from Contentstack UI. Not available for Custom Widgets.\n */\n\nclass Window {\n /**\n * @hideconstructor\n */\n\n _connection: typeof postRobot;\n _autoResizingEnabled: boolean;\n _resizingEnabled: boolean;\n type: LocationType.DASHBOARD | LocationType.FIELD;\n _emitter: EventEmitter;\n state: DashboardWidth;\n _height?: number;\n\n constructor(\n connection: any,\n type: LocationType.DASHBOARD | LocationType.FIELD,\n emitter: EventEmitter,\n state: DashboardWidth = DashboardWidth.HALF_WIDTH\n ) {\n this._connection = connection || postRobot;\n this._autoResizingEnabled = false;\n this._resizingEnabled = false;\n this.type = type;\n this.state = state;\n this._emitter = emitter;\n }\n\n /**\n * Activates the resize button that allows you to resize the window size of your Dashboard Widget.\n * @return {Promise} A promise that resolves when the resize button becomes visible on the Dashboard Widget.\n */\n async enableResizing(): Promise {\n if (this.type !== LocationType.DASHBOARD) {\n return Promise.resolve();\n }\n this._resizingEnabled = true;\n await this._connection.sendToParent(\"window\", {\n action: \"enableResizing\",\n });\n }\n\n /**\n * This function executes the callback function whenever a Dashboard Widget is maximized or minimized. Only applicable on Dashboard Widgets.\n * @param {function} callback The function to be called when a Dashboard Widget is maximized or minimized.\n * @return {boolean} Returns true if the operation completes successfully without errors.\n */\n onDashboardResize(callback: (event: any) => void) {\n const windowObj = this;\n if (this.type !== LocationType.DASHBOARD) {\n return false;\n }\n if (callback && typeof callback === \"function\") {\n windowObj._emitter.on(\n \"dashboardResize\",\n (event: { state: DashboardWidth }) => {\n windowObj.state = event.state;\n callback(event.state);\n }\n );\n } else {\n throw Error(\"Callback must be a function\");\n }\n return true;\n }\n\n /**\n * Updates the Widget height on Contentstack UI.\n * If the 'height' argument is not provided, it will automatically calculate the scroll height and adjust the widget window height accordingly.\n * @param {number} height The desired height of the iframe window.\n * @return {Promise} A promise that resolves when Contentstack UI acknowledges that the height has been updated.\n */\n async updateHeight(height?: number): Promise {\n if (\n this.type === LocationType.DASHBOARD &&\n this.state === DashboardWidth.HALF_WIDTH\n ) {\n return Promise.resolve();\n }\n if (!height || isNaN(height)) {\n this._height = Math.ceil(\n document.documentElement.getBoundingClientRect().height\n );\n } else if (this._height === height) {\n return Promise.resolve();\n } else {\n this._height = height;\n }\n await this._connection.sendToParent(\"resize\", this._height as any);\n }\n\n /**\n * Enables auto resizing of the Widget height.\n * @return {Window} The context of the Window class.\n */\n enableAutoResizing(): Window {\n if (\n this._autoResizingEnabled ||\n (this.state === DashboardWidth.HALF_WIDTH &&\n this.type === LocationType.DASHBOARD)\n ) {\n return this;\n }\n this._autoResizingEnabled = true;\n //@ts-ignore\n observer = new MutationObserver(this.updateHeight.bind(this));\n observer.observe(window.document.body, config);\n return this;\n }\n\n /**\n * Disables auto resizing of the Widget height.\n * @returns {Window} The context of the Window class.\n */\n disableAutoResizing(): Window {\n if (!this._autoResizingEnabled) {\n return this;\n }\n this._autoResizingEnabled = false;\n observer.disconnect();\n return this;\n }\n\n /**\n * Adds a padding on top of the Dashboard widget.\n * @returns {Promise} A promise that resolves when the padding is added.\n */\n async enablePaddingTop(): Promise {\n await postRobot.sendToParent(\"window\", {\n action: \"dashboardEnableTopPadding\",\n });\n }\n\n /**\n * Removes the padding previously added on top of the Dashboard widget.\n * @returns {Promise} A promise that resolves when the padding is removed.\n */\n async disablePaddingTop(): Promise {\n await postRobot.sendToParent(\"window\", {\n action: \"dashboardDisableTopPadding\",\n });\n }\n}\n\nexport default Window;\n","/*!\n * EventEmitter v5.2.9 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(607);\n"],"names":["root","factory","exports","module","define","amd","this","self","modules","installedModules","moduleId","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","default","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","value","interface_namespaceObject","isRegex","item","toString","cleanUpWindow","promise_ZalgoPromise","bridge","init","public_parent","_send","request","sendToParent","client","_on","listen","server_once","server_listener","CONFIG","constants_CONSTANTS","disable","PROTOCOL","IE_WIN_ACCESS_ERROR","isAboutProtocol","arguments","length","window","location","protocol","getParent","win","parent","err","getOpener","opener","canReadFromWindow","href","getActualDomain","Error","host","utils_getDomain","domain","mockDomain","indexOf","isActuallySameDomain","desc","getOwnPropertyDescriptor","isAncestorParent","child","childParent","result","push","getFrames","frames","len","frame","_i","_frame","iframeWindows","iframeFrames","isWindowClosed","allowMock","closed","message","mockclosed","top","iframeIndex","collection","contentWindow","parentNode","doc","ownerDocument","documentElement","contains","getAncestor","matchDomain","pattern","origin","Array","isArray","Boolean","match","JSON","stringify","some","subpattern","isWindow","obj","Window","__cross_domain_utils_window_check__","util_safeIndexOf","_ALLOWED_POST_MESSAGE","weakmap_CrossDomainSafeWeakMap","CrossDomainSafeWeakMap","instance","Constructor","TypeError","Math","random","WeakMap","freeze","testWeakMap","testKey","set","weakmap","keys","values","_cleanupClosedWindows","delete","splice","isSafeToReadWrite","key","entry","writable","index","has","getOrSet","POST_MESSAGE_TYPE","REQUEST","RESPONSE","ACK","POST_MESSAGE_ACK","SUCCESS","ERROR","POST_MESSAGE_NAMES","METHOD","HELLO","OPEN_TUNNEL","WINDOW_TYPES","FULLPAGE","POPUP","IFRAME","WINDOW_PROPS","POSTROBOT","SERIALIZATION_TYPES","PROMISE","ZALGO_PROMISE","REGEX","SEND_STRATEGIES","POST_MESSAGE","BRIDGE","GLOBAL","MOCK_PROTOCOL","FILE_PROTOCOL","BRIDGE_NAME_PREFIX","POSTROBOT_PROXY","WILDCARD","map","ALLOW_POSTMESSAGE_POPUP","__ALLOW_POSTMESSAGE_POPUP__","BRIDGE_TIMEOUT","CHILD_WINDOW_TIMEOUT","ACK_TIMEOUT","navigator","userAgent","RES_TIMEOUT","ALLOWED_POST_MESSAGE_METHODS","ALLOW_SAME_ORIGIN","_typeof","Symbol","iterator","constructor","stringifyError","level","stack","newErr","once","method","called","apply","lib_util_noop","uniqueID","chars","replace","charAt","floor","replaceObject","callback","depth","newobj","_key","childItem","util_isRegex","utils_isPromise","Promise","_toString","then","dispatchedErrors","possiblyUnhandledPromiseHandlers","activeCount","flushPromise","flushActive","promise","resolve","startActive","endActive","ZalgoPromise","handler","_this","resolved","rejected","errorHandled","handlers","_result","_error","isAsync","res","reject","dispatch","error","_this2","_err","setTimeout","j","asyncReject","dispatching","chain","firstPromise","secondPromise","_handlers$i","_onSuccess","onSuccess","_onError","onError","_promise","_result2","catch","finally","onFinally","try","timeout","time","_this3","clearTimeout","toPromise","all","promises","count","results","prom","hash","items","onPossiblyUnhandledException","cancel","context","args","delay","_delay","isPromise","flush","global","registerSelf","serialize__typeof","methods","listenForMethods","on","_ref","source","data","meth","id","isSerialized","type","__type__","serializeMethod","destination","__id__","__name__","deserializeMethod","wrapper","slice","send","_ref2","__xdomain__","deserializeZalgoPromise","__then__","sayHello","readyPromises","SEND_MESSAGE_STRATEGIES","serializedMessage","dom","forEach","postMessage","_extends","assign","target","sendMessage","_jsonStringify","options","sourceDomain","windowType","__message__","__code__","code","regex","__source__","messages","replacer","indent","objectToJSON","arrayToJSON","toJSON","strategyName","success","status","join","responseListeners","requestListeners","WINDOW_WILDCARD","erroredResponseListeners","_RECEIVE_MESSAGE_TYPE","getResponseListener","deleteResponseListener","isResponseListenerErrored","getRequestListener","nameListeners","_i2","_ref3","_length2","winQualifier","winListeners","_i4","_winListeners$__DOMAI2","_length4","_ref5","listener","types__extends","RECEIVE_MESSAGE_TYPES","pathname","ack","respond","fireAndForget","originalSource","handleError","response","receive__typeof","receiveMessage","event","parsedMessage","parse","receivedMessages","RegExp","messageListener","sourceElement","originalEvent","targetWindow","el","document","getElementById","tagName","toLowerCase","HTMLIFrameElement","hasResult","requestPromises","requestPromise","actualParent","_i7","_getAllChildFrames4","getAllChildFrames","_i3","_getFrames2","_i5","_getAllChildFrames2","childFrame","_length6","_i15","_getFrames8","_length14","actualDomain","responseListener","ackTimeout","resTimeout","cycleTime","cycle","max","min","server__typeof","listenerOptions","errorHandler","requestListener","addRequestListener","_ref6","listenersCollection","_i6","_win2","_i8","_length8","_listenersCollection","_i10","_domain2","_length10","_item","_i12","_length12","existingListener","strDomain","regexListeners","regexListener","_handler","errorOnClose","interval","runInterval","onceListener","removeEventListener","popupWindowsByWin","remoteWindows","initialized","addEventListener","attachEvent","initializationData","connection","emitter","currentAsset","_emitter","_connection","thisAsset","_changedData","getData","bind","setData","syncAsset","updateWidth","onSave","onChange","onPublish","onUnPublish","replaceAsset","asset","width","file","handleUpload","AssetSidebarWidget","configCallback","pluginMetaData","registry","title","toolbar","inMainToolbar","inHoveringToolbar","isContentstackElement","meta","elementType","editorCallbacks","isDependent","isContainer","containerMetaData","rootCategory","dependentPlugins","addPlugins","plugins","plugin","category","beforeChildrenRender","beforeElementRender","handleMouseDown","rte","config","entries","iconName","display","includes","dndOptions","Component","shouldOverride","containerMeta","RTEPlugin","rtePluginInitializer","additionalData","_data","currentBranch","_additionalData","setInstallationData","installationData","onData","getInstallationData","setValidity","isValid","ERROR_MESSAGES","configPage","isValidTypeBoolean","messageTypeString","AppConfig","content_type","changedData","locale","_options","thisEntry","getField","uid","useUnsavedSchema","_internalFlags","FieldInstance","path","split","schema","find","x","data_type","multiple","blocks","block","e","fieldObject","resolvedData","Entry","excludedDataTypesForSetField","fieldDataObject","field","unResolvedData","separatedData","_resolvedData","_self","fieldObj","$uid","currentFieldObj","dataObj","setFocus","Field","getTags","tags","setTags","undefined","entryField","tagsShouldNotBeBlank","every","tag","areTagsValid","tagsShouldBeArrayOfStrings","FieldModifierLocationEntry","FieldModifierLocationField","_autoResizingEnabled","updateDimension","enableAutoResizing","disableAutoResizing","closeModal","dimension","height","_height","ceil","getBoundingClientRect","_width","dimensionBody","dimensionHeightShouldBeNumber","dimensionWidthShouldBeNumber","preventFrameClose","state","observer","MutationObserver","observe","body","attributes","childList","subtree","disconnect","FieldModifierLocationFrame","LOG_LEVEL","_uiLocation","initialize","version","ContentstackAppSDK","createMetaData","metadataConfig","entity_uid","otherMetaData","action","payload","metadata","retrieveMetaData","retrieveAllMetaData","params","updateMetaData","deleteMetaData","Metadata","rootElement","getPreferredBodyElement","children","setBackgroundElement","element","Modal","getReferences","environment","Query","entryQuery","language","plural","getRteAssets","getAssetsOfSpecificTypes","assetType","asset_type","publish","fetch","unpublish","_files","files","from","_","File","Date","getUTCMilliseconds","upload_type","parentFolderUid","customUploadHandler","uploadAsset","Asset","uiConnection","Proxy","Target","thisArg","argumentsList","_query","only","transform","except","addParam","contentTypeUid","create","content_type_uid","update","includeOwner","includeContentType","includeSchema","includeReference","getLanguages","unlocalize","setWorkflowStage","contentType","entryTarget","addQuery","ContentType","_extend","query","file_size","bool","concat","$exists","Utils","lessThan","lessThanOrEqualTo","greaterThan","greaterThanOrEqualTo","notEqualTo","containedIn","notContainedIn","exists","notExists","ascending","descending","beforeUid","afterUid","skip","limit","or","and","equalTo","where","mergeDeep","includeCount","include_count","getQuery","$regex","$options","search","typeahead","findOne","singleEntry","_currentBranch","branches","branch","getAllStacks","orgUid","headers","organization_uid","org_uid","skip_api_key","stacks","getManagementTokens","tokens","queries","apiKey","api_key","getContentType","getContentTypes","optionParams","getEnvironment","getEnvironments","getReleases","getPublishes","getLocale","getLocales","getWorkflow","getWorkflows","getAllBranches","getCurrentBranch","Stack","newTraget","oldTarget","oldSource","newTarget","_mergeRecursive","anotherTarget","_type","val","__typeof","languageCode","environmentCode","include_owner","include_content_type","include_schema","getAll","remove","clear","Store","Region","StackLocation","LocationType","DashboardWidth","OrganizationLocation","initData","pulse","eventName","postRobot","getConfig","installationUID","getCurrentLocation","getAppVersion","app","getCurrentRegion","region","appUID","app_id","locationUID","extension_uid","installation_uid","currentUser","user","store","DashboardWidget","CustomField","SidebarWidget","AppConfigWidget","FullPage","FieldModifierLocation","modal","formatAppRegion","manifest","DASHBOARD","dashboard_width","WIDGET","APP_CONFIG_WIDGET","installation","ASSET_SIDEBAR_WIDGET","RTE","FIELD_MODIFIER_LOCATION","FULL_PAGE_LOCATION","FIELD","fieldConfig","field_config","emitEvent","otherData","console","sdkType","setReady","UiLocation","NA","EU","AZURE_NA","AZURE_EU","UNKNOWN","nodeCollection","rootElementIndex","Infinity","elementPreferenceList","nonRenderingTags","elIndex","nodeName","HALF_WIDTH","_resizingEnabled","enableResizing","onDashboardResize","windowObj","updateHeight","isNaN","enablePaddingTop","disablePaddingTop","EventEmitter","proto","originalGlobalValue","indexOfListener","listeners","alias","isValidListener","getListeners","evt","events","_getEvents","test","flattenListeners","flatListeners","getListenersAsObject","addListener","listenerIsWrapped","addOnceListener","defineEvent","defineEvents","evts","removeListener","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","_events","removeAllListeners","listenersMap","_getOnceReturnValue","trigger","emit","setOnceReturnValue","_onceReturnValue","noConflict","__webpack_module_cache__","__webpack_require__","cachedModule","__webpack_modules__"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/src/AssetSidebarWidget.d.ts b/dist/src/AssetSidebarWidget.d.ts deleted file mode 100644 index 92bcf88..0000000 --- a/dist/src/AssetSidebarWidget.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import EventEmitter from "wolfy87-eventemitter"; -import { IAssetSidebarInitData, setAssetDto } from "./types"; -import postRobot from "post-robot"; -import { Asset as AssetType } from "./types/stack.types"; -import { GenericObjectType } from "./types/common.types"; -/** Class representing an Asset Sidebar UI Location from Contentstack UI. */ -declare class AssetSidebarWidget { - /** - * @hideconstructor - */ - currentAsset: AssetType; - _emitter: EventEmitter; - _connection: typeof postRobot; - _changedData?: GenericObjectType; - constructor(initializationData: IAssetSidebarInitData, connection: typeof postRobot, emitter: EventEmitter); - /** - * Get the current asset data. - * @returns {AssetData} The current asset data. - */ - getData(): AssetType; - /** - * Set data for the asset. - * @param {Partial} asset - The partial asset data to set. - * @returns {Promise} A promise that resolves when the data is set successfully. - */ - setData(asset: Partial): Promise; - /** - * Synchronize the asset with the parent application in the Contentstack UI. - * @returns {Promise} A promise that resolves when the synchronization is complete. - */ - syncAsset(): Promise; - /** - * Update the width of the Asset Sidebar widget in the Contentstack UI. - * @param {number} width - The new width of the asset sidebar. - * @throws {Error} Throws an error if the width parameter is not a number. - * @returns {Promise} A promise that resolves when the width is updated successfully. - */ - updateWidth(width: number): Promise; - /** - * Replace the current asset with a new file. - * @param {File} file - The file to be used as the replacement asset. - * @returns {Promise} A promise that resolves when the replacement is complete. - */ - replaceAsset(file: File): Promise; - /** - * Executes the provided callback function every time an asset is saved. - * @param {function} callback - The function to be called when an asset is saved. - * @param {AssetType} arg0 - The asset data passed as an argument to the callback function when an asset is saved. - */ - onSave(callback: (arg0: AssetType) => void): void; - /** - * Registers a callback function to be executed whenever there is a change made to the Asset. - * @param {function} callback - The function to be called when the asset is edited or changed. - * @param {AssetType} arg0 - The asset data passed as an argument to the callback function when the asset is edited or changed. - */ - onChange(callback: (arg0: AssetType) => void): void; - /** - * The onPublish() function executes the callback function every time an asset has been published with the respective payload. - * @param {function} callback - The function to be called when an asset is published. - * @param {AssetType} arg0 - The data of the published asset passed as an argument to the callback function. - */ - onPublish(callback: (arg0: AssetType) => void): void; - /** - * The `onUnPublish()` function executes the provided callback every time an asset is unpublished. - * @param {function} callback - The function to be called when an asset is unpublished. - * @param {AssetType} arg0 - The data of the unpublished asset passed as an argument to the callback function. - */ - onUnPublish(callback: (arg0: AssetType) => void): void; -} -export default AssetSidebarWidget; -//# sourceMappingURL=AssetSidebarWidget.d.ts.map \ No newline at end of file diff --git a/dist/src/AssetSidebarWidget.d.ts.map b/dist/src/AssetSidebarWidget.d.ts.map deleted file mode 100644 index 43747e7..0000000 --- a/dist/src/AssetSidebarWidget.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AssetSidebarWidget.d.ts","sourceRoot":"","sources":["../../src/AssetSidebarWidget.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CA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a7a31..0000000 --- a/dist/src/RTE/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IConfigCallback, IContainerMetaData, IOnFunction, IPluginMetaData, IRteParam } from "./types"; -export declare class RTEPlugin { - private configCallback; - private pluginMetaData; - private isContainer; - private containerMetaData; - constructor(id: string, configCallback: IConfigCallback); - addPlugins: (...plugins: RTEPlugin[]) => void; - on: (type: Type, callback: IOnFunction[Type]) => void; - get: (rte: IRteParam | void) => Promise; -} -export declare const rtePluginInitializer: (id: string, configCallback: IConfigCallback) => RTEPlugin; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/src/RTE/index.d.ts.map b/dist/src/RTE/index.d.ts.map deleted file mode 100644 index 51487df..0000000 --- a/dist/src/RTE/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/RTE/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,SAAS,EAEZ,MAAM,SAAS,CAAC;AAEjB,qBAAa,SAAS;IAiCM,OAAO,CAAC,cAAc;IAhC9C,OAAO,CAAC,cAAc,CAepB;IACF,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,iBAAiB,CAavB;gBAEU,EAAE,EAAE,MAAM,EAAU,cAAc,EAAE,eAAe;IAI/D,UAAU,eAAgB,SAAS,EAAE,UAoBnC;IAEF,EAAE,oFAmCA;IAEF,GAAG,QAAe,SAAS,GAAG,IAAI,mDA2GhC;CACL;AAED,eAAO,MAAM,oBAAoB,OACzB,MAAM,kBACM,eAAe,cAMlC,CAAC"} \ No newline at end of file diff --git a/dist/src/RTE/test/rte.test.d.ts b/dist/src/RTE/test/rte.test.d.ts deleted file mode 100644 index 616481f..0000000 --- a/dist/src/RTE/test/rte.test.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=rte.test.d.ts.map \ No newline at end of file diff --git a/dist/src/RTE/test/rte.test.d.ts.map b/dist/src/RTE/test/rte.test.d.ts.map deleted file mode 100644 index 1e9dffb..0000000 --- a/dist/src/RTE/test/rte.test.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rte.test.d.ts","sourceRoot":"","sources":["../../../../src/RTE/test/rte.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/src/RTE/types.d.ts b/dist/src/RTE/types.d.ts deleted file mode 100644 index 60a158c..0000000 --- a/dist/src/RTE/types.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -import React, { ReactElement } from "react"; -import { Location, NodeEntry, Path, Point, Node, ElementEntry, Transforms, Editor, Span, NodeMatch } from "slate"; -import { RTEPlugin } from "./index"; -declare interface TransformOptions { - at?: Location; - match?: (node: Node) => boolean; - mode?: "highest" | "lowest" | "all"; - hanging?: boolean; - split?: boolean; - voids?: boolean; -} -export declare interface IRteParam { - selection: { - get: () => Range | null; - set: (selection: Location) => void; - isSelected: () => boolean; - isFocused: () => boolean; - getEnd: () => Point; - before: (at: Location, options?: { - distance?: number; - unit?: "character" | "word" | "line" | "block" | "offset"; - }) => Point | undefined; - after: (at: Location, options?: { - distance?: number; - unit?: "offset" | "character" | "word" | "line" | "block"; - voids?: boolean; - }) => Point | undefined; - isPointEqual: (point: Point, another: Point) => boolean; - }; - generators: { - elements: (root?: Node, options?: { - from?: Path; - to?: Path; - reverse?: boolean; - pass?: (node: NodeEntry) => boolean; - }) => Generator; - nodes: (options?: { - at?: Location | Span; - match?: Node; - mode?: "all" | "highest" | "lowest"; - universal?: boolean; - reverse?: boolean; - voids?: boolean; - }) => Generator; - }; - _adv: { - editor: Editor; - Transforms: typeof Transforms; - Editor: Editor; - }; - getPath: (node: Node) => Path; - setAttrs: (props: Partial & { - attrs?: { - [key: string]: any; - }; - }, options?: TransformOptions) => void; - isNodeOfType: (type: string) => boolean; - getNode: (at: Location, options?: { - depth?: number; - edge?: "start" | "end"; - }) => NodeEntry; - getNodes: (options?: { - at?: Location; - match?: NodeMatch; - }) => Generator, void, undefined>; - string: (at: Location) => string; - addMark: (key: string, value: any) => void; - removeMark: (key: string) => void; - hasMark: (key: string) => boolean; - insertText: (text: string, at: Location) => void; - getText: () => string; - deleteText: () => void; - updateNode: (type: string, attrs: { - [key: string]: any; - }, options: TransformOptions) => void; - unsetNode: (options: TransformOptions) => void; - insertNode: (node: Node, options: Omit & { - select?: boolean; - }) => void; - deleteNode: (options: { - at?: Location; - distance?: number; - unit?: "character" | "word" | "line" | "block"; - reverse?: boolean; - hanging?: boolean; - voids?: boolean; - }) => void; - removeNode: (node: Node) => void; - wrapNode: (node: Node, options: Omit) => void; - unwrapNode: (options: Omit) => void; - mergeNodes: (options: Omit) => void; - getEmbeddedItems: () => { - [key: string]: any; - }; - getVariable: (name: string, defaultValue: any) => T; - setVariable: (name: string, value: T) => void; -} -export declare type IRteParamWithPreventDefault = { - rte: IRteParam; - preventDefault: () => void; - [key: string]: any; -}; -export declare type IConfigCallback = (rte: IRteParam | void) => Partial; -export declare type IOnFunction = { - beforeRender: (rte: IRteParam) => void; - beforeChildRender: (rte: IRteParam) => void; - change: (params: IRteParamWithPreventDefault) => void; - deleteBackward: (params: IRteParamWithPreventDefault) => void; - deleteForward: (params: IRteParamWithPreventDefault) => void; - exec: (rte: IRteParam) => void; - insertBreak: (params: IRteParamWithPreventDefault) => void; - keydown: (params: { - event: React.KeyboardEvent; - rte: IRteParam; - }) => void; - normalize: (params: IRteParamWithPreventDefault) => void; - paste: (params: IRteParamWithPreventDefault) => void; -}; -export declare type IOnType = "exec" | "normalize" | "deleteBackwards" | "deleteForwards" | "insertBreak" | "beforeRender" | "beforeChildRender" | "copy"; -export declare type IDisplayOnOptions = "toolbar" | "hoveringToolbar"; -export declare type IElementTypeOptions = "inline" | "void" | "block" | "text"; -export declare interface IDnd { - disable: boolean; - hideSelectionBackground: boolean; - icon?: React.ReactElement; - className: string; - droppableContainer: (elementType: string, path: number[]) => string; - disableColumnLayout: boolean; -} -export declare interface IRteTextType { - text: string; -} -export declare interface IRteElementType { - uid: string; - type: string; - attrs: { - [key: string]: any; - }; - children: Array; -} -declare type IDynamicFunction = (element: IRteElementType) => Exclude | Exclude[]; -export declare interface IConfig { - title: string; - icon: React.ReactElement | null; - display: IDisplayOnOptions | IDisplayOnOptions[]; - elementType: IElementTypeOptions | IElementTypeOptions[] | IDynamicFunction; - render?: (...params: any) => ReactElement; - shouldOverride?: (element: IRteElementType) => boolean; -} -export declare interface IRegistryDnd { - DisableDND: boolean; - DisableSelectionHalo: boolean; - CustomDndIcon: React.ReactElement; - ContainerClassName: "scrte-table-row-dnd-container"; - getDroppableContainer: (elementType: string, path: number[]) => string; - DisableGridDnd: boolean; -} -export declare interface IRegistry { - title: string; - iconName?: React.ReactElement | null; - category?: string; - toolbar: { - inMainToolbar: boolean; - inHoveringToolbar: boolean; - }; - isContentstackElement: boolean; - beforeChildrenRender?: (...params: any) => any; - beforeElementRender?: (...params: any) => any; - handleMouseDown?: (...params: any) => any; - Component?: (element: React.ReactElement, attrs: { - [key: string]: any; - }, path: number[], rte: IRteParam) => React.ReactElement; - IngressComponent?: React.Component | null; - shouldOverride?: (element: IRteElementType) => boolean; -} -export declare interface IMeta { - id: string; - elementType: null | IElementTypeOptions | IElementTypeOptions[] | IDynamicFunction; - editorCallbacks: { - [key: string]: any; - }; - isDependent: boolean; -} -export declare interface IPluginMetaData { - registry: IRegistry; - meta: IMeta; -} -export declare interface IContainerRegistry { - id: string; - title: string; - iconName?: React.ReactElement | null; - rootCategory: false; - toolbar: { - inMainToolbar: boolean; - inHoveringToolbar: boolean; - }; -} -export declare interface IContainerMeta { - id: string; - dependentPlugins: RTEPlugin[]; -} -export declare interface IContainerMetaData { - registry: IContainerRegistry; - meta: IContainerMeta; -} -export declare type IRTEPluginInitializer = (id: string, config: IConfigCallback) => RTEPlugin; -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/dist/src/RTE/types.d.ts.map b/dist/src/RTE/types.d.ts.map deleted file mode 100644 index f469641..0000000 --- a/dist/src/RTE/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/RTE/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACH,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,MAAM,EACN,IAAI,EACJ,SAAS,EACZ,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,WAAW,gBAAgB;IAC9B,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IAChC,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,MAAM,CAAC,OAAO,WAAW,SAAS;IAC9B,SAAS,EAAE;QACP,GAAG,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC;QACxB,GAAG,EAAE,CAAC,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;QAEnC,UAAU,EAAE,MAAM,OAAO,CAAC;QAC1B,SAAS,EAAE,MAAM,OAAO,CAAC;QAEzB,MAAM,EAAE,MAAM,KAAK,CAAC;QAEpB,MAAM,EAAE,CACJ,EAAE,EAAE,QAAQ,EACZ,OAAO,CAAC,EAAE;YACN,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;SAC7D,KACA,KAAK,GAAG,SAAS,CAAC;QAEvB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AAE,eAAe,KAAK,OAAO,CAAC;CAC1D;AAED,MAAM,CAAC,OAAO,WAAW,KAAK;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EACL,IAAI,GACJ,mBAAmB,GACnB,mBAAmB,EAAE,GACrB,gBAAgB,CAAC;IACvB,eAAe,EAAE;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;IACF,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,eAAe;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,kBAAkB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IACrC,YAAY,EAAE,KAAK,CAAC;IACpB,OAAO,EAAE;QACL,aAAa,EAAE,OAAO,CAAC;QACvB,iBAAiB,EAAE,OAAO,CAAC;KAC9B,CAAC;CACL;AAED,MAAM,CAAC,OAAO,WAAW,cAAc;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,SAAS,EAAE,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,kBAAkB;IACvC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,IAAI,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG,CACxC,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,eAAe,KACtB,SAAS,CAAC"} \ No newline at end of file diff --git a/dist/src/appConfig/index.d.ts b/dist/src/appConfig/index.d.ts deleted file mode 100644 index 9d6c592..0000000 --- a/dist/src/appConfig/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import postRobot from "post-robot"; -import Stack from "../stack"; -import { IInstallationData, ValidationOptions, IAppConfigInitData } from "../types"; -export declare interface AppConfigAdditionalData { - currentBranch: string; -} -/** - * Class representing the current stack in Contentstack UI. - */ -export declare class AppConfig { - _data: IAppConfigInitData; - _connection: typeof postRobot; - _emitter: EventEmitter; - private _additionalData; - constructor(data: IAppConfigInitData, connection: typeof postRobot, emitter: EventEmitter, additionalData: AppConfigAdditionalData); - stack: () => Stack; - setInstallationData: (installationData: IInstallationData) => Promise; - getInstallationData: () => Promise; - /** - * Sets the validation state of the app. If the validation is false, the Contentstack App Config - * will not allow saving the configuration. The message will be displayed if provided. - * @param {boolean} isValid - The validation state of the app. - * @param {ValidationOptions} options - Additional options to be sent to the parent. - * @returns {Promise} - A promise that resolves to void. - */ - setValidity(isValid: boolean, options?: ValidationOptions): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/src/appConfig/index.d.ts.map b/dist/src/appConfig/index.d.ts.map deleted file mode 100644 index 54b9329..0000000 --- a/dist/src/appConfig/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/appConfig/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EACH,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,UAAU,CAAC;AAIlB,MAAM,CAAC,OAAO,WAAW,uBAAuB;IAC5C,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AAEH,qBAAa,SAAS;IAClB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,WAAW,EAAE,OAAO,SAAS,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,eAAe,CAA0B;gBAG7C,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,OAAO,SAAS,EAC5B,OAAO,EAAE,YAAY,EACrB,cAAc,EAAE,uBAAuB;IAU3C,KAAK,cAIH;IAEF,mBAAmB,qBACG,iBAAiB,KACpC,QAAQ,iBAAiB,CAAC,CAQ3B;IAEF,mBAAmB,QAAO,QAAQ,iBAAiB,CAAC,CAKlD;IAEF;;;;;;OAMG;IACG,WAAW,CACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,iBAAiB,GAC5B,OAAO,CAAC,IAAI,CAAC;CAsBnB"} \ No newline at end of file diff --git a/dist/src/entry.d.ts b/dist/src/entry.d.ts deleted file mode 100644 index d2361db..0000000 --- a/dist/src/entry.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import EventEmitter from "wolfy87-eventemitter"; -import postRobot from "post-robot"; -import Field from "./field"; -import { IFieldInitData, IFieldModifierLocationInitData, ISidebarInitData } from "./types"; -import { Entry as EntryType } from "../src/types/entry.types"; -import { IEntryOptions, IGetFieldOptions, IOnEntryChangeCallback } from "./types/entry.types"; -import { ContentType, PublishDetails } from "./types/stack.types"; -import { GenericObjectType } from "./types/common.types"; -/** Class representing an entry from Contentstack UI. Not available for Dashboard UI Location. */ -declare class Entry { - /** - * @hideconstructor - */ - content_type: ContentType; - _data: EntryType; - locale: string; - _connection: typeof postRobot; - _emitter: EventEmitter; - _changedData?: GenericObjectType; - _options: IEntryOptions; - constructor(initializationData: IFieldInitData | ISidebarInitData | IFieldModifierLocationInitData, connection: typeof postRobot, emitter: EventEmitter, options?: IEntryOptions); - /** - * Gets data of the current entry. - * @return {Object} Returns entry data. - */ - getData(): EntryType; - /** - * Gets the field object for the saved data, which allows you to interact with the field. - * This object will have all the same methods and properties of appSDK.location.CustomField.field. - * Note: For fields initialized using the getFields function, the setData function currently works only for the following fields: as single_line, multi_line, RTE, markdown, select, number, boolean, date, link, and Custom Field UI Location of data type text, number, boolean, and date. - * @example - * var field = entry.getField('field_uid'); - * var fieldSchema = field.schema; - * var fieldUid = field.uid; - * var fieldData = field.getData(); - * @param {string} uid Unique ID of the field - * @param {boolean} options.useUnsavedSchema If set to true, the field will get the unsaved field - * @return {Object} Field object - */ - getField(uid: string, options?: IGetFieldOptions): Field; - /** - * This function executes the callback function every time an entry is saved. - * @param {function} callback The function to be called when an entry is saved. - */ - onSave(callback: (arg0: EntryType) => void): void; - /** - * The onChange() function executes the provided callback function whenever an entry is updated. - * @param {function} callback - The function to be called when the entry is edited or changed. - */ - onChange(callback: IOnEntryChangeCallback): void; - /** - * The onPublish() function executes the callback function every time an entry has been published with the respective payload. - * @param {function} callback The function to be called when an entry is published. - */ - onPublish(callback: (arg0: PublishDetails) => void): void; - /** - * The onUnPublish() function executes the callback function every time an entry has been unpublished with the respective payload. - * @param {function} callback The function to be called when an entry is un published. - */ - onUnPublish(callback: (arg0: PublishDetails) => void): void; -} -export default Entry; -//# sourceMappingURL=entry.d.ts.map \ No newline at end of file diff --git a/dist/src/entry.d.ts.map b/dist/src/entry.d.ts.map deleted file mode 100644 index 2c19499..0000000 --- a/dist/src/entry.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EACH,cAAc,EACd,8BAA8B,EAC9B,gBAAgB,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACH,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAU,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,kGAAkG;AAElG,cAAM,KAAK;IACP;;OAEG;IAEH,YAAY,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,SAAS,CAAC;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,QAAQ,EAAE,aAAa,CAAC;gBAGpB,kBAAkB,EACZ,cAAc,GACd,gBAAgB,GAChB,8BAA8B,EACpC,UAAU,EAAE,OAAO,SAAS,EAC5B,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,aAAa;IAyC3B;;;OAGG;IAEH,OAAO;IAIP;;;;;;;;;;;;OAYG;IAEH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,KAAK;IA+FxD;;;OAGG;IAEH,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI;IAW1C;;;OAGG;IAEH,QAAQ,CAAC,QAAQ,EAAE,sBAAsB;IAiBzC;;;OAGG;IAEH,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI;IAclD;;;OAGG;IAEH,WAAW,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI;CAavD;AACD,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/dist/src/entryFieldLocation/entry.d.ts b/dist/src/entryFieldLocation/entry.d.ts deleted file mode 100644 index b661ad3..0000000 --- a/dist/src/entryFieldLocation/entry.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=entry.d.ts.map \ No newline at end of file diff --git a/dist/src/entryFieldLocation/entry.d.ts.map b/dist/src/entryFieldLocation/entry.d.ts.map deleted file mode 100644 index 7299b6a..0000000 --- a/dist/src/entryFieldLocation/entry.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../src/entryFieldLocation/entry.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/src/entryFieldLocation/field.d.ts b/dist/src/entryFieldLocation/field.d.ts deleted file mode 100644 index 9bb1819..0000000 --- a/dist/src/entryFieldLocation/field.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=field.d.ts.map \ No newline at end of file diff --git a/dist/src/entryFieldLocation/field.d.ts.map b/dist/src/entryFieldLocation/field.d.ts.map deleted file mode 100644 index 16df42d..0000000 --- a/dist/src/entryFieldLocation/field.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/entryFieldLocation/field.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/src/entryFieldLocation/frame.d.ts b/dist/src/entryFieldLocation/frame.d.ts deleted file mode 100644 index 3261bd8..0000000 --- a/dist/src/entryFieldLocation/frame.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=frame.d.ts.map \ No newline at end of file diff --git a/dist/src/entryFieldLocation/frame.d.ts.map b/dist/src/entryFieldLocation/frame.d.ts.map deleted file mode 100644 index fc99da7..0000000 --- a/dist/src/entryFieldLocation/frame.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../src/entryFieldLocation/frame.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/src/extension.d.ts b/dist/src/extension.d.ts deleted file mode 100644 index 46c9930..0000000 --- a/dist/src/extension.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import postRobot from "post-robot"; -import AssetSidebarWidget from "./AssetSidebarWidget"; -import { IRTEPluginInitializer } from "./RTE/types"; -import Metadata from "./metadata"; -import Modal from "./modal"; -import Stack from "./stack"; -import Store from "./store"; -import { IAppConfigWidget, ICustomField, IDashboardWidget, IFieldModifierLocation, IFullPageLocation, ISidebarWidget, InitializationData, LocationType, Region } from "./types"; -import { GenericObjectType } from "./types/common.types"; -import { User } from "./types/user.types"; -/** - * Class representing an extension from Contentstack App SDK. - * @hideconstructor - */ -declare class Extension { - /** - * This value represents the current app's unique ID. - */ - appUID: string; - /** - * This holds the app's installation ID. - */ - installationUID: string; - /** - * This object holds details of the current user. - */ - currentUser: User; - /** - * The type of UI Location being rendered. - */ - private type; - /** - * The configuration set for an app. - */ - private config; - /** - * This holds the instance of Cross-domain communication library for posting messages between windows. - */ - postRobot: typeof postRobot; - /** - * This holds the stack instance that allows users to read and manipulate a range of objects in a stack. - */ - stack: Stack; - /** - * Store to persist data for extension. - * Note: Data is stored in the browser's {@link external:localStorage} and will be lost if the {@link external:localStorage} is cleared in the browser. - */ - store: Store; - /** - * This holds the instance of the Metadata class used to manage metadata. - */ - metadata: Metadata; - /** - * This value represents the current location's unique ID. One App may contain multiple locations - */ - locationUID: string; - /** - * This holds the instance of a helper class used to manage modals in an App. - */ - modal: Modal; - /** - * The Contentstack Region on which the app is running. - */ - readonly region: Region; - version: number | null; - /** - * This holds the information of the currently running location of an App. - */ - location: { - DashboardWidget: IDashboardWidget | null; - SidebarWidget: ISidebarWidget | null; - CustomField: ICustomField | null; - RTEPlugin: IRTEPluginInitializer | null; - AppConfigWidget: IAppConfigWidget | null; - AssetSidebarWidget: AssetSidebarWidget | null; - FullPage: IFullPageLocation | null; - FieldModifierLocation: IFieldModifierLocation | null; - }; - constructor(initData: InitializationData); - pulse: (eventName: string, metadata: GenericObjectType) => void; - /** - * Method used to retrieve the configuration set for an app. - */ - getConfig: () => Promise; - /** - * Method used to get the type of currently running UI location of the app. - */ - getCurrentLocation: () => LocationType; - /** - * Conditionally retrieves and returns the app version if not present already - * @returns version of the app currently running. - */ - getAppVersion: () => Promise; - /** - * Method used to get the Contentstack Region on which the app is running. - */ - getCurrentRegion: () => Region; - /** - * Method used to initialize the App SDK. - * @param version - Version of the app SDK in use. - */ - static initialize(version: string): Promise; - setReady(): Promise; -} -export default Extension; -//# sourceMappingURL=extension.d.ts.map \ No newline at end of file diff --git a/dist/src/extension.d.ts.map b/dist/src/extension.d.ts.map deleted file mode 100644 index 9d0d497..0000000 --- a/dist/src/extension.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3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AE;QACN,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC;QACzC,aAAa,EAAE,cAAc,GAAG,IAAI,CAAC;QACrC,WAAW,EAAE,YAAY,GAAG,IAAI,CAAC;QACjC,SAAS,EAAE,qBAAqB,GAAG,IAAI,CAAC;QACxC,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC;QACzC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,CAAC;QAC9C,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;QACnC,qBAAqB,EAAE,sBAAsB,GAAG,IAAI,CAAC;KACxD,CAAC;gBAEU,QAAQ,EAAE,kBAAkB;IAmOxC,KAAK,cAAe,MAAM,YAAY,iBAAiB,KAAG,IAAI,CAE5D;IAEF;;OAEG;IACH,SAAS,QAAO,QAAQ,iBAAiB,CAAC,CAQxC;IAEF;;OAEG;IACH,kBAAkB,QAAO,YAAY,CAEnC;IAEF;;;OAGG;IACH,aAAa,QAAa,QAAQ,MAAM,GAAG,IAAI,CAAC,CAoB9C;IAEF;;OAEG;IACH,gBAAgB,QAAO,MAAM,CAE3B;IAEF;;;OAGG;WACU,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWrE,QAAQ,IAAI,OAAO,CAAC,oBAAoB,CAAC;CAG5C;AAED,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/dist/src/field.d.ts b/dist/src/field.d.ts deleted file mode 100644 index 8d5cd6b..0000000 --- a/dist/src/field.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import EventEmitter from "wolfy87-eventemitter"; -import postRobot from "post-robot"; -import { IFieldInitData, IFieldModifierLocationInitData } from "./types"; -import { GenericObjectType } from "./types/common.types"; -import { Schema } from "./types/stack.types"; -/** Class representing a field from Contentstack UI. Only available for Custom Field and Field Modifier UI Location */ -declare class Field { - /** - * @hideconstructor - */ - uid: string; - data_type: string; - schema: Schema; - _emitter: EventEmitter; - _data: GenericObjectType; - _resolvedData: GenericObjectType; - _self: boolean; - _connection: typeof postRobot; - constructor(fieldDataObject: IFieldInitData | IFieldModifierLocationInitData, connection: typeof postRobot, emitter: EventEmitter); - /** - * Sets the data for the current field. - * @param {Object|string|number} data Data to be set on the field - * @return {external:Promise} A promise object which is resolved when data is set for a field. Note: The data set by this function will only be saved when user saves the entry. - */ - setData(data: any): Promise; - /** - * Gets the data of the current field - * @param {Object} options Options object for get Data method. - * @param {boolean} options.resolved If the resolved parameter is set to true for the File field, then the method will return a resolved asset object along with all the field metadata, e.g. 'field.getData({resolved:true})'. - * @return {Object|string|number} Returns the field data. - */ - getData({ resolved }?: { - resolved?: boolean | undefined; - }): GenericObjectType; - /** - * Sets the focus for a field when an App is being used. This method shows user presence and highlights the App's Custom Field that the user is currently accessing in Contentstack UI. - * @return {Promise} A promise object which is resolved when Contentstack UI returns an acknowledgement of the focused state. - */ - setFocus(): Promise; - /** - * The `onChange` function is triggered when another extension or app programmatically modifies the data of this field using the `field.setData()` function. - * It is specifically designed for App's Custom Fields of data types text, number, boolean, or date. - * @param {function} callback The function to be called when a field has been updated. - */ - onChange?(callback: (data: any) => any): void; -} -export default Field; -//# sourceMappingURL=field.d.ts.map \ No newline at end of file diff --git a/dist/src/field.d.ts.map b/dist/src/field.d.ts.map deleted file mode 100644 index 366bea7..0000000 --- a/dist/src/field.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA6B7C,sHAAsH;AACtH,cAAM,KAAK;IACP;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;IACzB,aAAa,EAAE,iBAAiB,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,OAAO,SAAS,CAAC;gBAG1B,eAAe,EAAE,cAAc,GAAG,8BAA8B,EAChE,UAAU,EAAE,OAAO,SAAS,EAC5B,OAAO,EAAE,YAAY;IAoDzB;;;;OAIG;IAEH,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC;IA8BlC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAgB,EAAE;;KAAK;IAIjC;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B;;;;OAIG;IACH,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG;CAYzC;AAED,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/dist/src/fieldLocation/entry.d.ts b/dist/src/fieldLocation/entry.d.ts deleted file mode 100644 index c759c7e..0000000 --- a/dist/src/fieldLocation/entry.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Entry from "../entry"; -import { IFieldLocationInitData } from "../types"; -import { IGetTagsOptions } from "../types/entry.types"; -declare class FieldLocationEntry extends Entry { - constructor(initializationData: IFieldLocationInitData, connection: any, emitter: EventEmitter); - /** - * Returns the value of the tags associated with the entry. - * @returns {string[]} Returns an array of tags associated with the entry. - */ - getTags(options?: IGetTagsOptions): Array; - /** - * Sets the tags on the entry. - * @param tags tags to be set on the entry - * @returns {string[]} Returns an array of tags associated with the entry. - */ - setTags(tags: Array): Promise>; -} -export default FieldLocationEntry; -//# sourceMappingURL=entry.d.ts.map \ No newline at end of file diff --git a/dist/src/fieldLocation/entry.d.ts.map b/dist/src/fieldLocation/entry.d.ts.map deleted file mode 100644 index 3ec9d0e..0000000 --- a/dist/src/fieldLocation/entry.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../src/fieldLocation/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,cAAM,kBAAmB,SAAQ,KAAK;gBAE9B,kBAAkB,EAAE,sBAAsB,EAC1C,UAAU,EAAE,GAAG,EACf,OAAO,EAAE,YAAY;IAUzB;;;OAGG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC;IAUjD;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CA2B7D;AAED,eAAe,kBAAkB,CAAC"} \ No newline at end of file diff --git a/dist/src/fieldLocation/field.d.ts b/dist/src/fieldLocation/field.d.ts deleted file mode 100644 index 552f3ed..0000000 --- a/dist/src/fieldLocation/field.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import EventEmitter from "wolfy87-eventemitter"; -import { IFieldInitData, IFieldLocationInitData } from "../types"; -/** Class representing a field from Contentstack UI. Only available for Custom Field extension */ -declare class FieldLocationField { - /** - * @hideconstructor - */ - uid: string; - data_type: string; - schema: { - [key: string]: any; - }; - _emitter: EventEmitter; - _data: { - [key: string]: any; - }; - _resolvedData: { - [key: string]: any; - }; - _self: any; - _connection: any; - constructor(fieldDataObject: IFieldInitData | IFieldLocationInitData, connection: any, emitter: EventEmitter); - /** - * Sets the data for the current field. - * @param {Object|string|number} data Data to be set on the field - * @return {external:Promise} A promise object which is resolved when data is set for a field. Note: The data set by this function will only be saved when user saves the entry. - */ - setData(data: any): Promise; - /** - * Gets the data of the current field - * @param {Object} options Options object for get Data method. - * @param {boolean} options.resolved If the resolved parameter is set to true for the File field, then the method will return a resolved asset object along with all the field metadata, e.g. 'field.getData({resolved:true})'. - * @return {Object|string|number} Returns the field data. - */ - getData({ resolved }?: { - resolved?: boolean | undefined; - }): { - [key: string]: any; - }; - getDelta(): any; -} -export default FieldLocationField; -//# sourceMappingURL=field.d.ts.map \ No newline at end of file diff --git a/dist/src/fieldLocation/field.d.ts.map b/dist/src/fieldLocation/field.d.ts.map deleted file mode 100644 index bf499c4..0000000 --- a/dist/src/fieldLocation/field.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/fieldLocation/field.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AA4BlE,iGAAiG;AACjG,cAAM,kBAAkB;IACpB;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC/B,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC9B,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACtC,KAAK,EAAE,GAAG,CAAC;IACX,WAAW,EAAE,GAAG,CAAC;gBAGb,eAAe,EAAE,cAAc,GAAG,sBAAsB,EACxD,UAAU,EAAE,GAAG,EACf,OAAO,EAAE,YAAY;IAmDzB;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA8B/C;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAgB,EAAE;;KAAK;;;IAIjC,QAAQ;CAGX;AAED,eAAe,kBAAkB,CAAC"} \ No newline at end of file diff --git a/dist/src/fieldLocation/frame.d.ts b/dist/src/fieldLocation/frame.d.ts deleted file mode 100644 index e879608..0000000 --- a/dist/src/fieldLocation/frame.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import EventEmitter from "wolfy87-eventemitter"; -/** - * Class representing an iframe window from Contentstack UI. Not available for Custom Widgets. - */ -declare class FieldLocationFrame { - /** - * @hideconstructor - */ - _connection: any; - _autoResizingEnabled: boolean; - _emitter: EventEmitter; - _height?: number; - _width?: number; - private observer; - constructor(connection: any, emitter: EventEmitter); - /** - * This method updates the extension height and width on Contentstack UI. - * If the value is not passed, it will update the height and width of the - * extension with the current height and width of the extension. - * @param {string|number} height Desired height of the iframe window - */ - updateDimension(dimension?: { - height?: number; - width?: number; - }): void; - /** - * This method enables auto resizing of the extension height. - * @return {FieldLocationFrame}. - */ - enableAutoResizing(): FieldLocationFrame; - /** - * This method disables auto resizing of the extension height. - * @return {FieldLocationFrame}. - */ - disableAutoResizing(): FieldLocationFrame; -} -export default FieldLocationFrame; -//# sourceMappingURL=frame.d.ts.map \ No newline at end of file diff --git a/dist/src/fieldLocation/frame.d.ts.map b/dist/src/fieldLocation/frame.d.ts.map deleted file mode 100644 index 4f8dd41..0000000 --- a/dist/src/fieldLocation/frame.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../src/fieldLocation/frame.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAGhD;;GAEG;AAEH,cAAM,kBAAkB;IACpB;;OAEG;IAEH,WAAW,EAAE,GAAG,CAAC;IACjB,oBAAoB,UAAS;IAC7B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,QAAQ,CAA+B;gBAEnC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY;IAelD;;;;;OAKG;IACH,eAAe,CAAC,SAAS,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;IAiC/D;;;OAGG;IACH,kBAAkB,IAAI,kBAAkB;IAkBxC;;;OAGG;IACH,mBAAmB,IAAI,kBAAkB;CAQ5C;AAED,eAAe,kBAAkB,CAAC"} \ No newline at end of file diff --git a/dist/src/fieldModifierLocation/entry.d.ts b/dist/src/fieldModifierLocation/entry.d.ts deleted file mode 100644 index 99c48c3..0000000 --- a/dist/src/fieldModifierLocation/entry.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import postRobot from "post-robot"; -import Entry from "../entry"; -import { IFieldModifierLocationInitData } from "../types"; -import { IGetTagsOptions } from "../types/entry.types"; -declare class FieldModifierLocationEntry extends Entry { - constructor(initializationData: IFieldModifierLocationInitData, connection: typeof postRobot, emitter: EventEmitter); - /** - * Returns the value of the tags associated with the entry. - * @returns {string[]} Returns an array of tags associated with the entry. - */ - getTags(options?: IGetTagsOptions): Array; - /** - * Sets the tags on the entry. - * @param tags tags to be set on the entry - * @returns {string[]} Returns an array of tags associated with the entry. - */ - setTags(tags: Array): Promise>; -} -export default FieldModifierLocationEntry; -//# sourceMappingURL=entry.d.ts.map \ No newline at end of file diff --git a/dist/src/fieldModifierLocation/entry.d.ts.map b/dist/src/fieldModifierLocation/entry.d.ts.map deleted file mode 100644 index c7b1a9b..0000000 --- a/dist/src/fieldModifierLocation/entry.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../src/fieldModifierLocation/entry.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvD,cAAM,0BAA2B,SAAQ,KAAK;gBAEtC,kBAAkB,EAAE,8BAA8B,EAClD,UAAU,EAAE,OAAO,SAAS,EAC5B,OAAO,EAAE,YAAY;IASzB;;;OAGG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC;IAUjD;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CAuC7D;AAED,eAAe,0BAA0B,CAAC"} \ No newline at end of file diff --git a/dist/src/fieldModifierLocation/field.d.ts b/dist/src/fieldModifierLocation/field.d.ts deleted file mode 100644 index 3e3b09b..0000000 --- a/dist/src/fieldModifierLocation/field.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import EventEmitter from "wolfy87-eventemitter"; -import postRobot from "post-robot"; -import { IFieldInitData, IFieldModifierLocationInitData } from "../types"; -import { GenericObjectType } from "../types/common.types"; -import { Schema } from "../types/stack.types"; -/** Class representing a field from Contentstack UI. */ -declare class FieldModifierLocationField { - /** - * @hideconstructor - */ - uid: string; - data_type: string; - schema: Schema; - _emitter: EventEmitter; - _data: GenericObjectType; - _resolvedData: GenericObjectType; - _self: boolean; - _connection: typeof postRobot; - constructor(fieldDataObject: IFieldInitData | IFieldModifierLocationInitData, connection: typeof postRobot, emitter: EventEmitter); - /** - * Sets the data for the current field. - * @param {Object|string|number} data Data to be set on the field - * @return {external:Promise} A promise object which is resolved when data is set for a field. - * Note: The data set by this function will only be saved when user saves the entry. - */ - setData(data: any): Promise; - /** - * Gets the data of the current field - * @param {Object} options Options object for get Data method. - * @param {boolean} options.resolved If the resolved parameter is set to true for the File field, then the method will return a resolved asset object along with all the field metadata, e.g. 'field.getData({resolved:true})'. - * @return {Object|string|number} Returns the field data. - */ - getData({ resolved }?: { - resolved?: boolean | undefined; - }): GenericObjectType; -} -export default FieldModifierLocationField; -//# sourceMappingURL=field.d.ts.map \ No newline at end of file diff --git a/dist/src/fieldModifierLocation/field.d.ts.map b/dist/src/fieldModifierLocation/field.d.ts.map deleted file mode 100644 index 5d2b7ac..0000000 --- a/dist/src/fieldModifierLocation/field.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/fieldModifierLocation/field.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AA+B9C,uDAAuD;AACvD,cAAM,0BAA0B;IAC5B;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;IACzB,aAAa,EAAE,iBAAiB,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,OAAO,SAAS,CAAC;gBAG1B,eAAe,EAAE,cAAc,GAAG,8BAA8B,EAChE,UAAU,EAAE,OAAO,SAAS,EAC5B,OAAO,EAAE,YAAY;IAoDzB;;;;;OAKG;IACG,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,0BAA0B,CAAC;IA8B7D;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAgB,EAAE;;KAAK,GAAG,iBAAiB;CAGxD;AAED,eAAe,0BAA0B,CAAC"} \ No newline at end of file diff --git a/dist/src/fieldModifierLocation/frame.d.ts b/dist/src/fieldModifierLocation/frame.d.ts deleted file mode 100644 index 02bf479..0000000 --- a/dist/src/fieldModifierLocation/frame.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import EventEmitter from "wolfy87-eventemitter"; -import postRobot from "post-robot"; -/** - * Class representing an iframe window from Contentstack UI. Not available for Custom Widgets. - */ -declare class FieldModifierLocationFrame { - /** - * @hideconstructor - */ - _connection: typeof postRobot; - _autoResizingEnabled: boolean; - _emitter: EventEmitter; - _height?: number; - _width?: number; - private observer; - constructor(connection: typeof postRobot, emitter: EventEmitter); - /** - * This method updates the UI location height and width on Contentstack UI. - * If the value is not passed, it will update the height and width of the - * UI location with the current height and width of the UI location. - * @param {dimension: {height: number, width: number}} dimension Desired height and width of the iframe window - */ - updateDimension(dimension?: { - height?: number; - width?: number; - }): Promise; - /** - * Prevent user from accidently closing the app by clicking outside the frame - * if the app is performing some active task. - */ - preventFrameClose(state: boolean): Promise; - /** - * This method enables auto resizing of the UI Location height. - * @return {FieldModifierLocationFrame}. - */ - enableAutoResizing(): FieldModifierLocationFrame; - /** - * This method disables auto resizing of the UI location height. - * @return {FieldModifierLocationFrame}. - */ - disableAutoResizing(): FieldModifierLocationFrame; - /** - * It closes the app modal. - * @returns {Promise} - */ - closeModal(): Promise; -} -export default FieldModifierLocationFrame; -//# sourceMappingURL=frame.d.ts.map \ No newline at end of file diff --git a/dist/src/fieldModifierLocation/frame.d.ts.map b/dist/src/fieldModifierLocation/frame.d.ts.map deleted file mode 100644 index 5f42ce8..0000000 --- a/dist/src/fieldModifierLocation/frame.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../src/fieldModifierLocation/frame.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC;;GAEG;AAEH,cAAM,0BAA0B;IAC5B;;OAEG;IAEH,WAAW,EAAE,OAAO,SAAS,CAAC;IAC9B,oBAAoB,UAAS;IAC7B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,QAAQ,CAA+B;gBAEnC,UAAU,EAAE,OAAO,SAAS,EAAE,OAAO,EAAE,YAAY;IAgB/D;;;;;OAKG;IACG,eAAe,CAAC,SAAS,CAAC,EAAE;QAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgDjB;;;OAGG;IACG,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAMtD;;;OAGG;IACH,kBAAkB,IAAI,0BAA0B;IAoBhD;;;OAGG;IACH,mBAAmB,IAAI,0BAA0B;IASjD;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC;AAED,eAAe,0BAA0B,CAAC"} \ No newline at end of file diff --git a/dist/src/index.d.ts b/dist/src/index.d.ts deleted file mode 100644 index 6391b38..0000000 --- a/dist/src/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import UiLocation from "./uiLocation"; -/** - * Class to initialize the App on Contentstack UI. - * Import Contentstack App SDK and then call ContentstackAppSDK.init in your code base - * - * @example Custom Field UI Location - * ContentstackAppSDK.init().then(function (sdk) { - * const customField = sdk.location.CustomField; - * }) - * @example Dashboard UI Location - * ContentstackAppSDK.init().then(function (sdk) { - * const dashboardUILocation = sdk.location.DashboardWidget; - * }) - * @return {Promise} A promise object which will be resolved with an instance of the {@link UiLocation} class. - * @hideconstructor - */ -declare class ContentstackAppSDK { - /** - * A static variable that stores the instance of {@link UiLocation} class after initialization - */ - static _uiLocation: UiLocation; - /** - * Initializes the App SDK and returns an instance of {@link UiLocation} class - */ - static init(): Promise; - /** - * Version of Contentstack App SDK. - */ - static get SDK_VERSION(): string; -} -export default ContentstackAppSDK; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/src/index.d.ts.map b/dist/src/index.d.ts.map deleted file mode 100644 index 4435bb4..0000000 --- a/dist/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,cAAc,CAAC;AAMtC;;;;;;;;;;;;;;GAcG;AAEH,cAAM,kBAAkB;IACpB;;OAEG;IACH,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAYlC;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;CACJ;AAED,eAAe,kBAAkB,CAAC"} \ No newline at end of file diff --git a/dist/src/location.d.ts b/dist/src/location.d.ts deleted file mode 100644 index 94eefab..0000000 --- a/dist/src/location.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import postRobot from "post-robot"; -import AssetSidebarWidget from "./AssetSidebarWidget"; -import { IRTEPluginInitializer } from "./RTE/types"; -import Metadata from "./metadata"; -import Modal from "./modal"; -import Stack from "./stack"; -import Store from "./store"; -import { IAppConfigWidget, ICustomField, IDashboardWidget, IFieldModifierLocation, IFullPageLocation, ISidebarWidget, InitializationData, LocationType, Region } from "./types"; -import { GenericObjectType } from "./types/common.types"; -import { User } from "./types/user.types"; -/** - * Class representing an location from Contentstack App SDK. - * @hideconstructor - */ -declare class Location { - /** - * This value represents the current app's unique ID. - */ - appUID: string; - /** - * This holds the app's installation ID. - */ - installationUID: string; - /** - * This object holds details of the current user. - */ - currentUser: User; - /** - * The type of UI Location being rendered. - */ - private type; - /** - * The configuration set for an app. - */ - private config; - /** - * This holds the instance of Cross-domain communication library for posting messages between windows. - */ - postRobot: typeof postRobot; - /** - * This holds the stack instance that allows users to read and manipulate a range of objects in a stack. - */ - stack: Stack; - /** - * Store to persist data for the app. - * Note: Data is stored in the browser's {@link external:localStorage} and will be lost if the {@link external:localStorage} is cleared in the browser. - */ - store: Store; - /** - * This holds the instance of the Metadata class used to manage metadata. - */ - metadata: Metadata; - /** - * This value represents the current location's unique ID. One App may contain multiple locations - */ - locationUID: string; - /** - * This holds the instance of a helper class used to manage modals in an App. - */ - modal: Modal; - /** - * The Contentstack Region on which the app is running. - */ - readonly region: Region; - version: number | null; - /** - * This holds the information of the currently running location of an App. - */ - location: { - DashboardWidget: IDashboardWidget | null; - SidebarWidget: ISidebarWidget | null; - CustomField: ICustomField | null; - RTEPlugin: IRTEPluginInitializer | null; - AppConfigWidget: IAppConfigWidget | null; - AssetSidebarWidget: AssetSidebarWidget | null; - FullPage: IFullPageLocation | null; - FieldModifierLocation: IFieldModifierLocation | null; - }; - constructor(initData: InitializationData); - pulse: (eventName: string, metadata: GenericObjectType) => void; - /** - * Method used to retrieve the configuration set for an app. - */ - getConfig: () => Promise; - /** - * Method used to get the type of currently running UI location of the app. - */ - getCurrentLocation: () => LocationType; - /** - * Conditionally retrieves and returns the app version if not present already - * @returns version of the app currently running. - */ - getAppVersion: () => Promise; - /** - * Method used to get the Contentstack Region on which the app is running. - */ - getCurrentRegion: () => Region; - /** - * Method used to initialize the App SDK. - * @param version - Version of the app SDK in use. - */ - static initialize(version: string): Promise; - setReady(): Promise; -} -export default Location; -//# sourceMappingURL=location.d.ts.map \ No newline at end of file diff --git a/dist/src/location.d.ts.map b/dist/src/location.d.ts.map deleted file mode 100644 index ffb0a7f..0000000 --- a/dist/src/location.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/location.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAOpD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO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AAC;QACnC,qBAAqB,EAAE,sBAAsB,GAAG,IAAI,CAAC;KACxD,CAAC;gBAEU,QAAQ,EAAE,kBAAkB;IAmOxC,KAAK,cAAe,MAAM,YAAY,iBAAiB,KAAG,IAAI,CAE5D;IAEF;;OAEG;IACH,SAAS,QAAO,QAAQ,iBAAiB,CAAC,CAQxC;IAEF;;OAEG;IACH,kBAAkB,QAAO,YAAY,CAEnC;IAEF;;;OAGG;IACH,aAAa,QAAa,QAAQ,MAAM,GAAG,IAAI,CAAC,CAoB9C;IAEF;;OAEG;IACH,gBAAgB,QAAO,MAAM,CAE3B;IAEF;;;OAGG;WACU,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWrE,QAAQ,IAAI,OAAO,CAAC,oBAAoB,CAAC;CAG5C;AAED,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/dist/src/metadata.d.ts b/dist/src/metadata.d.ts deleted file mode 100644 index 4d6f7bf..0000000 --- a/dist/src/metadata.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import postRobot from "post-robot"; -import { GenericObjectType } from "./types/common.types"; -export declare interface IMetadata { - api_key: string; - _content_type_uid?: string; - entity_uid: string; - extension_uid?: string; - locale?: string; - scope?: string; - type: "asset" | "entry"; - uid: string; - [key: string]: any; -} -export declare interface IMetadataCreateDto { - entity_uid: string; - _content_type_uid: string; - type: "asset" | "entry"; - extension_uid: string; - [key: string]: any; -} -export declare interface IMetadataUpdateDto { - uid: string; - [key: string]: any; -} -export declare interface IMetadataRetrieveDto { - uid: string; -} -export declare interface IMetadataDeleteDto { - uid: string; -} -/** - * The Metadata class provides methods for creating, retrieving, updating, and deleting metadata. - */ -declare class Metadata { - private _connection; - constructor(_connection: typeof postRobot); - /** - * Creates a new Metadata record. - * @param {IMetadataCreateDto} metadataConfig The metadata configuration data required to create the metadata. - * @returns {Promise<{ metadata: IMetadata }>} A promise that resolves to the newly created metadata record. - */ - createMetaData(metadataConfig: IMetadataCreateDto): Promise<{ - metadata: IMetadata; - }>; - /** - * Retrieves a metadata record by its ID. - * @param {IMetadataRetrieveDto} metadataConfig The metadata configuration containing its uid. - * @returns {Promise<{ metadata: IMetadata }> } A promise that resolves to the metadata record with the specified ID. - */ - retrieveMetaData(metadataConfig: IMetadataRetrieveDto): Promise<{ - metadata: IMetadata; - }>; - /** - * Retrieves all metadata records. - * @param {GenericObjectType} params Optional parameters for the query. - * @returns {Promise<{ metadata: IMetadata[] }>} A promise that resolves to an array of all metadata records. - */ - retrieveAllMetaData(params?: GenericObjectType): Promise<{ - metadata: IMetadata[]; - }>; - /** - * Updates a metadata record. - * @param {IMetadataUpdateDto} metadataConfig The metadata configuration that needs to be updated. - * @returns {Promise<{ metadata: IMetadata }>} A promise that resolves to the metadata record that has been updated. - */ - updateMetaData(metadataConfig: IMetadataUpdateDto): Promise<{ - metadata: IMetadata; - }>; - /** - * Deletes a metadata record. - * @param {IMetadataDeleteDto} metadataConfig The metadata configuration. - * @returns {Promise<{ notice: string }>} A promise that resolves with a message upon successful deletion of the metadata record. - */ - deleteMetaData(metadataConfig: IMetadataDeleteDto): Promise<{ - notice: string; - }>; -} -export default Metadata; -//# sourceMappingURL=metadata.d.ts.map \ No newline at end of file diff --git a/dist/src/metadata.d.ts.map b/dist/src/metadata.d.ts.map deleted file mode 100644 index 4a11ddf..0000000 --- a/dist/src/metadata.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,CAAC,OAAO,WAAW,SAAS;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,M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AE,CAAC;IAoBnC;;;;OAIG;IACH,cAAc,CACV,cAAc,EAAE,kBAAkB,GACnC,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAiBjC;AACD,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/dist/src/modal.d.ts b/dist/src/modal.d.ts deleted file mode 100644 index 5d3b943..0000000 --- a/dist/src/modal.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare class Modal { - constructor(); - setBackgroundElement(element: HTMLElement): void; -} -export default Modal; -//# sourceMappingURL=modal.d.ts.map \ No newline at end of file diff --git a/dist/src/modal.d.ts.map b/dist/src/modal.d.ts.map deleted file mode 100644 index 650787f..0000000 --- a/dist/src/modal.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/modal.ts"],"names":[],"mappings":"AAEA,cAAM,KAAK;;IAUP,oBAAoB,CAAC,OAAO,EAAE,WAAW;CAG5C;AAED,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/dist/src/stack/api/asset/index.d.ts b/dist/src/stack/api/asset/index.d.ts deleted file mode 100644 index 1eb4fee..0000000 --- a/dist/src/stack/api/asset/index.d.ts +++ /dev/null @@ -1,167 +0,0 @@ -import Base from "../base"; -import { GenericObjectType } from "../../../types/common.types"; -declare class Asset extends Base { - getReferences: any; - environment: any; - constructor(uid: any); - /** - * @function - * @name Stack#Asset.Query - * @description This static method instantiates the query module for assets. To see the list of methods that can be used for querying assets, refer the {@link Query} module. - * @example - * let assetQuery = appSDK.stack.Asset.Query(); - * assetQuery.where("title": "main.js").limit(10).skip(10).find().then(...).catch(...); - * @return {Query} - */ - static Query(): import("../query").default; - static module(plural?: boolean): "Assets" | "Asset"; - static get connection(): any; - /** - * @function - * @name Stack#Asset.getRteAssets - * @description This static method retrieves comprehensive information on all assets uploaded through the Rich Text Editor field. - * @return {external:Promise} - */ - static getRteAssets(): any; - /** - * @function - * @name Stack#Asset.getAssetsOfSpecificTypes - * @description This static method retrieves assets that are either image or video files, based on the request query. - * @param {String} assetType Type of asset to be received for e.g., ‘image/png’ - * @return {external:Promise} - */ - static getAssetsOfSpecificTypes(assetType: any): any; - /** - * @name Stack#Asset#only - * @function - * @description This method is used to show the selected fields of the assets in the result set. - * @param {String} [key=BASE] - Single field of an asset - * @param {Array} values - Array of fields to be shown in the result set - * @example - * Only with the field UID - * appSDK.stack.Asset('bltsomething123').only('title').fetch(); - * @example - * Only with the field UID - * appSDK.stack.Asset('bltsomething123').only('BASE','title').fetch(); - * @example - * Only with the field UIDs(array) - * appSDK.stack.Asset('bltsomething123').only(['title','description']).fetch(); - * @returns {Stack#Asset} - */ - /** - * @name Stack#Asset#except - * @function - * @description This method is used to hide the selected fields of the assets in result set. - * @param {String} [key=BASE] - Single field of an asset - * @param {Array} values - Array of fields to be hidden in the result set - * @example - * .Except with the field UID - * appSDK.stack.Asset('bltsomething123').except('title').fetch(); - * @example - * .Except with the field UID - * appSDK.stack.Asset('bltsomething123').except('BASE','title').fetch(); - * @example - * .Except with the field UIDs(array) - * appSDK.stack.Asset('bltsomething123').except(['title','description']).fetch(); - * @returns {Stack#Asset} - */ - /** - * @function - * @name Stack#Asset#environment - * @description This method is used to set the environment name of which you want to retrieve the data. - * @param {String} environment_uid - UID/Name of environment - * @example appSDK.stack.Asset('bltsomething123').environment('development').fetch() - * @returns {Stack#Asset} - */ - /** - This method includes a query parameter in your query. - @name Stack#Asset#addParam - @function - @example appSDK.stack.Asset('uid').addParam('key', 'value').fetch().then().catch(); - @param {string} key - Key of the parammeter - @param {string} value - Value of the parammeter - @return {Stack#Asset} - */ - /** - This method includes a query parameter in your query. - @name Stack#Asset#addQuery - @function - @example appSDK.stack.Asset('uid').addQuery('key', 'value').fetch().then().catch(); - @param {string} key - Key of the parammeter - @param {string} value - Value of the parammeter - @return {Stack#Asset} - */ - /** - This method will fetch the details of the entries and the assets in which the specified asset is referenced. - @see {@link - https://www.contentstack.com/docs/apis/content-management-api/#get-all-references-of-asset| - Asset References} - @name Stack#Asset#getReferences - @function - @example appSDK.stack.Asset('uid').getReferences().then().catch(); - @return {external:Promise} - */ - /** - This method deletes an existing asset. - @see {@link - https://www.contentstack.com/docs/apis/content-management-api/#delete-an-asset| - Delete Asset} - @name Stack#Asset#delete - @function - @example appSDK.stack.Asset('uid').delete().then().catch(); - @return {external:Promise} - */ - /** - * @name Stack#Asset#publish - * @function - * @description This method allows you to publish the asset either immediately or schedule the publish for a later date/time. - * @param {object} payload - Payload for the request. - * @example appSDK.stack.Asset('bltsomething123') - .publish( - { - "asset": { - "locales": [ - "en-us" - ], - "environments": [ - "development" - ] - }, - "version": 1, - "scheduled_at": "2019-02-08T18:30:00.000Z" - }); - * @return {external:Promise} - */ - publish(payload: any): any; - /** - * @function - * @name Stack#Asset#unpublish - * @description This method will instantly unpublish the asset, and also give you the provision to automatically unpublish the asset at a later date/time. - * @param {object} payload - Payload for the request. - * @example appSDK.stack.Asset('bltsomething123') - .unpublish({ - "asset": { - "locales": [ - "en-us" - ], - "environments": [ - "development" - ] - }, - "version": 1, - "scheduled_at": "2019-02-08T18:30:00.000Z" - }); - * @return {external:Promise} - */ - unpublish(payload: any): any; - static handleUpload(_files: any, type: any, options?: { - parentFolderUid?: string; - customUploadHandler?: GenericObjectType; - }): Promise>; - static uploadAsset(files: any, options?: { - parentFolderUid?: string; - }): Promise>; -} -declare const _default: (uiConnection: any) => typeof Asset; -export default _default; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/src/stack/api/asset/index.d.ts.map b/dist/src/stack/api/asset/index.d.ts.map deleted file mode 100644 index 2cf07a4..0000000 --- a/dist/src/stack/api/asset/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/stack/api/asset/index.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAwBhE,cAAM,KAAM,SAAQ,IAAI;IACpB,aAAa,EAAE,GAAG,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC;gBACL,GAAG,KAAA;IAOf;;;;;;;;OAQG;IAEH,MAAM,CAAC,KAAK;IASZ,MAAM,CAAC,MAAM,CAAC,MAAM,UAAQ;IAI5B,MAAM,KAAK,UAAU,QAEpB;IAED;;;;;OAKG;IAEH,MAAM,CAAC,YAAY;IAOnB;;;;;;OAMG;IACH,MAAM,CAAC,wBAAwB,CAAC,SAAS,KAAA;IAazC;;;;;;;;;;;;;;;;OAgBG;IAEH;;;;;;;;;;;;;;;;OAgBG;IAEH;;;;;;;OAOG;IAEH;;;;;;;;IAQA;IAEA;;;;;;;;IAQA;IAEA;;;;;;;;;IASA;IAEA;;;;;;;;;KASC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,OAAO,KAAA;IAWf;;;;;;;;;;;;;;;;;;;KAmBC;IACD,SAAS,CAAC,OAAO,KAAA;WAWJ,YAAY,CACrB,MAAM,KAAA,EACN,IAAI,KAAA,EACJ,OAAO,CAAC,EAAE;QACN,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;KAC3C,GACF,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IA6CxC,MAAM,CAAC,WAAW,CAAC,KAAK,KAAA,EAAE,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE;CAGnE;;AAED,wBAQE"} \ No newline at end of file diff --git a/dist/src/stack/api/base.d.ts b/dist/src/stack/api/base.d.ts deleted file mode 100644 index bee679e..0000000 --- a/dist/src/stack/api/base.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import Query from './query'; -/** - * This is Base class, it holds all the methods required for Modle instance, - * eg ContentType('uid').delete() or Asset('uid').update({...}) - * @ignore - */ -export default class Base { - uid: string; - _query: { - [key: string]: any; - }; - only: any; - except: any; - addParam: any; - static connection: any; - static contentTypeUid: string; - constructor(uid: string); - static Query(): Query; - static create(payload: { - [key: string]: any; - }): any; - update(payload: { - [key: string]: any; - }): any; - delete(): any; - fetch(action: string, payload?: { - [key: string]: any; - }): any; -} -//# sourceMappingURL=base.d.ts.map \ No newline at end of file diff --git a/dist/src/stack/api/base.d.ts.map b/dist/src/stack/api/base.d.ts.map deleted file mode 100644 index aac90c0..0000000 --- a/dist/src/stack/api/base.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/stack/api/base.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,SAAS,CAAC;AAY5B;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,IAAI;IAGvB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;IAC9B,IAAI,EAAE,GAAG,CAAA;IACT,MAAM,EAAE,GAAG,CAAA;IACX,QAAQ,EAAE,GAAG,CAAA;IAEb,MAAM,CAAC,UAAU,EAAE,GAAG,CAAA;IACtB,MAAM,CAAC,cAAc,EAAE,MAAM,CAAA;gBAEjB,GAAG,EAAE,MAAM;IASvB,MAAM,CAAC,KAAK;IAMZ,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAK7C,MAAM,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAOtC,MAAM;IAIN,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;CAcvD"} \ No newline at end of file diff --git a/dist/src/stack/api/content-type/entry.d.ts b/dist/src/stack/api/content-type/entry.d.ts deleted file mode 100644 index 68974bf..0000000 --- a/dist/src/stack/api/content-type/entry.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _default: (uiConnection: any, contentType: string) => any; -export default _default; -//# sourceMappingURL=entry.d.ts.map \ No newline at end of file diff --git a/dist/src/stack/api/content-type/entry.d.ts.map b/dist/src/stack/api/content-type/entry.d.ts.map deleted file mode 100644 index b113636..0000000 --- a/dist/src/stack/api/content-type/entry.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../../../src/stack/api/content-type/entry.ts"],"names":[],"mappings":"uCA2X8B,GAAG,eAAe,MAAM;AAAtD,wBAmBE"} \ No newline at end of file diff --git a/dist/src/stack/api/content-type/index.d.ts b/dist/src/stack/api/content-type/index.d.ts deleted file mode 100644 index a51cb72..0000000 --- a/dist/src/stack/api/content-type/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _default: (uiConnection: any) => any; -export default _default; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/src/stack/api/content-type/index.d.ts.map b/dist/src/stack/api/content-type/index.d.ts.map deleted file mode 100644 index 2562f4e..0000000 --- a/dist/src/stack/api/content-type/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/stack/api/content-type/index.ts"],"names":[],"mappings":"uCAgC8B,GAAG;AAAjC,wBAQE"} \ No newline at end of file diff --git a/dist/src/stack/api/query.d.ts b/dist/src/stack/api/query.d.ts deleted file mode 100644 index 1ded9c8..0000000 --- a/dist/src/stack/api/query.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import * as Utils from "../utils"; -declare const _extend: { - compare(type: any): (key: any, value: any) => any; - contained(bool: any): (key: any, value: any) => any; - exists(bool: any): (key: any) => any; - logical(type: any): () => any; - sort(type: any): (key: any) => any; - pagination(type: any): (value: any) => any; -}; -/** - * Creates an instance of the query - * @hideconstructor - */ -declare class Query { - module: any; - _connection: any; - _query: { - [key: string]: any; - }; - contentTypeUid: string; - only: any; - except: any; - addQuery: any; - lessThan: any; - lessThanOrEqualTo: any; - greaterThan: any; - greaterThanOrEqualTo: any; - notEqualTo: any; - containedIn: any; - notContainedIn: any; - exists: any; - notExists: any; - ascending: ReturnType; - descending: ReturnType; - beforeUid: ReturnType; - afterUid: ReturnType; - skip: ReturnType; - limit: ReturnType; - or: ReturnType; - and: ReturnType; - addParam: ReturnType; - singleEntry: any; - constructor(connection: any, module: any, contentTypeUid: any); - /** - * @function - * @name Query#includeReference - * @description This method is used to include referenced entries from other content types. Note: This method is only valid for querying {@link Stack#ContentType#Entry}. - * @example - * .includeReference with reference_field_uids as array - * stack.ContentType('contenttype_uid').Entry.Query().includeReference(['category', 'author']).find() - * @example - * .includeReference with reference_field_uids - * stack.ContentType('contenttype_uid').Entry.Query().includeReference('category', 'author').find() - * @returns {Query} - */ - /** - * @function - * @name Query#includeSchema - * @description This method is used to include the schema of the current contenttype in result set along with the entry/entries. Note: This method is only valid for querying {@link Stack#ContentType#Entry}. - * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().includeSchema().find() - * @returns {Query} - */ - /** - * @function - * @name Query#language - * @description This method is used to set the language code of which you want to retrieve the data. Note: This method is only valid for querying {@link Stack#ContentType#Entry}. - * @param {String} languageCode - Language code, for e.g. 'en-us', 'ja-jp', and so on - * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().language('en-us').find() - * @returns {Query} - */ - /** - * @function - * @name Query#includeContentType - * @description This method is used to include the current content type in the result set along with the entry(ies). Note: This method is only valid for querying {@link Stack#ContentType#Entry}. - * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().includeContentType().find() - * @returns {Query} - */ - /** - * @function - * @name Query#includeOwner - * @description This method is used to include the owner of the entry(ies) in the result set. Note: This method is only valid for querying {@link Stack#ContentType#Entry}. - * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().includeOwner().find() - * @returns {Query} - */ - /** - * @function - * @name Query#environment - * @description This method is used to set the environment name of which you want to retrieve the data. - * @param {String} environment_uid - UID/Name of environment - * @example appSDK.stack.ContentType('contenttype_uid').Entry.Query().environment('development').find() - * @returns {Query} - */ - /** - * @description This method provides only the entries containing field values matching the specified condition. - * @param {String} key - UID of the field - * @param {*} value - The value used to match or compare - * @example appSDK.stack.ContentType('blog').where('title','Demo') - * @returns {Query} - */ - equalTo(key: any, value: any): this; - where(key: any, value: any): this; - /** - * @description This method provides only the number of entries matching the specified filters. - * @example appSDK.stack.ContentType('blog').count() - * @returns {Query} - */ - count(): any; - /** - * @description This method is used to set raw queries on the Query instance. - * @param {object} query - Raw{json} queries to filter the entries in the result set. - * @returns {Query} - */ - query(query: any): this; - /** - * @description The ’tags’ parameter allows you to specify an array of tags to search for objects. - * @param {Array} values - Tags - * @example appSDK.stack.ContentType('blog').tags(['technology', 'business']) - * @returns {Query} - */ - tags(values: any): this; - /** - * @description This method also includes the total number of entries returned in the response. - * @example appSDK.stack.ContentType('blog').includeCount() - * @returns {Query} - */ - includeCount(): this; - /** - * @summary returns Returns the raw query which can be used for further calls (.and/.or). - * @description This method provides raw{json} queries based on the filters applied on the Query object. - * @example appSDK.stack.ContentType('blog').where('title','Demo').getQuery() - * @returns {Query} - */ - getQuery(): any; - /** - * @description This method provides only the entries matching the regular expression for the specified field. - * @param {String} key - UID of the field - * @param {*} value - The value used to match or compare - * @param {String} [options] - Match or compare a value in the entry - * @example - * .regex without options - * let blogQuery = appSDK.stack.ContentType('blog').regex('title','^Demo') - * @example - * .regex with options - * let blogQuery = appSDK.stack.ContentType('blog').regex('title','^Demo', 'i') - * @returns {Query} - */ - regex(key: any, value: any, options: any): this; - /** - * @description This method is used to search data in entries. - * @param {string} value - Value to search in the entries. - * @example appSDK.stack.ContentType('blog').search('Welcome to demo') - * @returns {Query} - */ - search(value: any): this; - /** - * @description This method provides all the entries which satisfy the specified query. - * @example - * let blogQuery = appSDK.stack.ContentType('blog').find() - */ - find(): any; - /** - * @description This method provides a single entry from the result set. - * @example - * let blogQuery = appSDK.stack.ContentType('blog').findOne() - */ - findOne(): any; -} -export default Query; -//# sourceMappingURL=query.d.ts.map \ No newline at end of file diff --git a/dist/src/stack/api/query.d.ts.map b/dist/src/stack/api/query.d.ts.map deleted file mode 100644 index 62703e2..0000000 --- a/dist/src/stack/api/query.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/stack/api/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAalC,QAAA,MAAM,OAAO;;;;;;;CAqFZ,CAAC;AAEF;;;GAGG;AACH,cAAM,KAAK;IACP,MAAM,EAAE,GAAG,CAAC;IACZ,WAAW,EAAE,GAAG,CAAC;IACjB,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,EAAE,GAAG,CAAC;IACZ,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;IACd,iBAAiB,EAAE,GAAG,CAAC;IACvB,WAAW,EAAE,GAAG,CAAC;IACjB,oBAAoB,EAAE,GAAG,CAAC;IAC1B,UAAU,EAAE,GAAG,CAAC;IAChB,WAAW,EAAE,GAAG,CAAC;IACjB,cAAc,EAAE,GAAG,CAAC;IACpB,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,EAAE,GAAG,CAAC;IACf,SAAS,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,UAAU,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,SAAS,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,QAAQ,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,KAAK,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7C,EAAE,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,GAAG,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5C,WAAW,EAAE,GAAG,CAAC;gBAEL,UAAU,KAAA,EAAE,MAAM,KAAA,EAAE,cAAc,KAAA;IAyQ9C;;;;;;;;;;;OAWG;IAEH;;;;;;OAMG;IAEH;;;;;;;OAOG;IAEH;;;;;;OAMG;IAEH;;;;;;OAMG;IAGH;;;;;;;OAOG;IAEH;;;;;;OAMG;IACH,OAAO,CAAC,GAAG,KAAA,EAAE,KAAK,KAAA;IASlB,KAAK,CAAC,GAAG,KAAA,EAAE,KAAK,KAAA;IAQhB;;;;OAIG;IACH,KAAK;IAaL;;;;OAIG;IACH,KAAK,CAAC,KAAK,KAAA;IAQX;;;;;OAKG;IACH,IAAI,CAAC,MAAM,KAAA;IAQX;;;;OAIG;IACH,YAAY;IAKZ;;;;;OAKG;IACH,QAAQ;IAIR;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,GAAG,KAAA,EAAE,KAAK,KAAA,EAAE,OAAO,KAAA;IAgBzB;;;;;OAKG;IACH,MAAM,CAAC,KAAK,KAAA;IAQZ;;;;OAIG;IACH,IAAI;IAYJ;;;;OAIG;IACH,OAAO;CAaV;AAED,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/dist/src/stack/index.d.ts b/dist/src/stack/index.d.ts deleted file mode 100644 index 236f6a9..0000000 --- a/dist/src/stack/index.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { BranchDetail, GetAllStacksOptions, StackAdditionalData, StackDetail, StackSearchQuery } from '../types/stack.types'; -import { IManagementTokenDetails } from '../types'; -/** - * Class representing the current stack in Contentstack UI. - */ -declare class Stack { - /** - * @hideconstructor - */ - _connection: any; - _data: StackDetail; - ContentType: any; - Asset: any; - private _currentBranch; - constructor(data: StackDetail | undefined, connection: any, additionalData: StackAdditionalData); - /** - * This method returns the data of the current stack. - * @return Returns stack data. - */ - getData(): StackDetail; - /** - * This method returns all the stacks in the current organization. - * @param query asks for organization UID and query params to get all stacks - * @returns Stacks within current organization - */ - getAllStacks({ orgUid, params }?: GetAllStacksOptions): Promise; - /** - * Get the details of all the management tokens of the stack. - * Note: This API does not return the token value. - * @see {@link https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-management-tokens | Get all management tokens} - * @returns Details of all the management token of the stack - */ - getManagementTokens(): Promise; - /** - * Gets the results of the search based on user query - * @param queries Array of key value pair of query parameters - * @param apiKey API key of the stack - * @returns Result of the query - */ - search(queries: StackSearchQuery, apiKey?: string | null): any; - /** - * This API allows you to retrieve data of a content type of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-single-content-type| Content Type API} requests. This method returns a Promise object. - * @param {string} uid Uid of the desired content type - * @param {Object} params Optional parameters for the GET call - * @return {Object} A promise object which will be resolved with content type details. - */ - getContentType(uid: string, params?: {}): Promise<{ - [key: string]: any; - }>; - /** - * This API allows you to retrieve data of a content types of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-all-content-types| Content Types API} requests. This method returns a Promise object. - * @param {Object} query Query for the GET call - * @param {Object} params Optional parameters for the GET call - * @return {Object} A promise object which will be resolved with details of the content type. - */ - getContentTypes(query?: {}, params?: { - [key: string]: any; - }): Promise<{ - [key: string]: any; - }>; - /** - * This API allows you to retrieve environment details of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-single-environment| Environment API} requests. This method returns a Promise object. - * @param {string} name Name of the desired environment - * @param {Object} params Optional parameters for the GET call - * @return {Object} A promise object which will be resolved with environment details. - */ - getEnvironment(name: string, params?: {}): any; - /** - * This API allows you to retrieve details of environments of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-all-environments| Environments API} requests. This method returns a Promise object. - * @param {Object} query Query for the GET call - * @param {Object} params Optional parameters for the GET call - * @return {Object} A Promise object which will be resolved with details of the environments. - */ - getEnvironments(query?: {}, params?: {}): any; - /** - * This API allows you to retrieve details of releases of a stack using the {@link https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-releases| Releases API} requests. This method returns a Promise object. - * @param {Object} query Query for the GET call - * @param {Object} params Optional parameters for the GET call - * @return {Object} A Promise object which will be resolved with details of the releases. - */ - getReleases(query?: {}, params?: {}): any; - /** - * This API allows you to retrieve details of publish queue of a stack using the {@link https://www.contentstack.com/docs/developers/apis/content-management-api/#get-publish-queue| Publish Queue API} requests. This method returns a Promise object. - * @param {Object} query Query for the GET call - * @param {Object} params Optional parameters for the GET call - * @return {Object} A Promise object which will be resolved with details of the publish queue. - */ - getPublishes(query?: {}, params?: {}): any; - /** - * This API allows you to retrive a locale of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-language| Language API} requests. Method returns a Promise object. - * @param {string} code Code of the desired locale - * @param {Object} params Optional parameters for the GET call - * @return {Object} A promise object which will be resolved with locale details. - */ - getLocale(code: string, params?: {}): any; - /** - * This API allows you to retrive the locales of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-all-content-types| Languages API} requests. Method returns a Promise object. - * @param {Object} query Query for the GET call - * @param {Object} params Optional parameters for the GET call - * @return {Object} A Promise object which will be resolved with details of the locales. - */ - getLocales(query?: {}, params?: {}): any; - /** - * This API allows you to retrive a workflow of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-a-workflow| Language API} requests. Method returns a Promise object. - * @param {string} code Code of the desired locale - * @param {Object} params Optional parameters for the GET call - * @return {Object} A promise object which will be resolved with locale details. - */ - getWorkflow(uid: string, params?: {}): any; - /** - * This API allows you to retrive the locales of a stack using the {@link https://www.contentstack.com/docs/apis/content-management-api/#get-all-content-types| Languages API} requests. Method returns a Promise object. - * @param {Object} query Query for the GET call - * @param {Object} params Optional parameters for the GET call - * @return {Object} A Promise object which will be resolved with details of the locales. - */ - getWorkflows(query?: {}, params?: {}): any; - /** - * This API allows you to retrieve all the branches in the current stack - * @returns All branches of the current stack - */ - getAllBranches(): BranchDetail[]; - /** - * Returns the details of the current branch of the stack if available - * @returns current branch of the current stack if available - */ - getCurrentBranch(): BranchDetail | null; -} -export default Stack; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/src/stack/index.d.ts.map b/dist/src/stack/index.d.ts.map deleted file mode 100644 index bc95fee..0000000 --- a/dist/src/stack/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stack/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7H,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGnD;;GAEG;AAEH,cAAM,KAAK;IACT;;OAEG;IAEH,WAAW,EAAE,GAAG,CAAA;IAChB,KAAK,EAAE,WAAW,CAAA;IAClB,WAAW,EAAE,GAAG,CAAA;IAChB,KAAK,EAAE,GAAG,CAAA;IACV,OAAO,CAAC,cAAc,CAA6B;gBAGvC,IAAI,yBAAiC,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,EAAE,mBAAmB;IAkCvG;;;OAGG;IAEH,OAAO,IAAI,WAAW;IAKtB;;;;OAIG;IACG,YAAY,CAAC,EAAC,MAAW,EAAE,MAAW,EAAC,GAAE,mBAAwB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAqBhG;;;;;OAKG;IACG,mBAAmB,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAW/D;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAE,MAAM,GAAG,IAAyB;IAS5E;;;;;OAKG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAQzE;;;;;OAKG;IACH,eAAe,CAAC,KAAK,KAAK,EAAE,MAAM,GAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAO,GAAG,OAAO,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAOjG;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK;IAQxC;;;;;OAKG;IACH,eAAe,CAAC,KAAK,KAAK,EAAE,MAAM,KAAK;IAOvC;;;;;OAKG;IACH,WAAW,CAAC,KAAK,KAAK,EAAE,MAAM,KAAK;IAOnC;;;;;OAKG;IACH,YAAY,CAAC,KAAK,KAAK,EAAE,MAAM,KAAK;IAOpC;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK;IAQnC;;;;;OAKG;IACH,UAAU,CAAC,KAAK,KAAK,EAAE,MAAM,KAAK;IAOlC;;;;;OAKG;IACD,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,KAAK;IAQpC;;;;;OAKG;IACH,YAAY,CAAC,KAAK,KAAK,EAAE,MAAM,KAAK;IAOpC;;;OAGG;IACH,cAAc,IAAI,YAAY,EAAE;IAIhC;;;OAGG;IACH,gBAAgB,IAAI,YAAY,GAAG,IAAI;CAG1C;AAED,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/dist/src/stack/utils.d.ts b/dist/src/stack/utils.d.ts deleted file mode 100644 index f215d40..0000000 --- a/dist/src/stack/utils.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export declare function transform(type: any): () => any; -export declare function merge(target: { - [key: string]: any; -}, source: { - [key: string]: any; -}): { - [key: string]: any; -}; -export declare function mergeDeep(oldTarget: { - [key: string]: any; -}, oldSource: { - [key: string]: any; -}): { - [key: string]: any; -}; -export declare function _type(val: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"; -export declare function addParam(key: any, value: any): any; -export declare function addQuery(key: any, value: any): any; -export declare function language(languageCode: any): any; -export declare function environment(environmentCode: any): any; -export declare function includeOwner(): any; -export declare function includeContentType(): any; -export declare function includeSchema(): any; -export declare function includeReference(val: any): any; -export declare function getReferences(): any; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/dist/src/stack/utils.d.ts.map b/dist/src/stack/utils.d.ts.map deleted file mode 100644 index da9f731..0000000 --- a/dist/src/stack/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/stack/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,IAAI,KAAA,aAgC7B;AAGD,wBAAgB,KAAK,CACjB,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC9B,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE;;EASjC;AAGD,wBAAgB,SAAS,CACrB,SAAS,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EACjC,SAAS,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE;;EAwBpC;AAED,wBAAgB,KAAK,CAAC,GAAG,KAAA,+FAOxB;AAED,wBAAgB,QAAQ,CAAC,GAAG,KAAA,EAAE,KAAK,KAAA,OAMlC;AAED,wBAAgB,QAAQ,CAAC,GAAG,KAAA,EAAE,KAAK,KAAA,OAMlC;AAED,wBAAgB,QAAQ,CAAC,YAAY,KAAA,OAMpC;AAED,wBAAgB,WAAW,CAAC,eAAe,KAAA,OAM1C;AAED,wBAAgB,YAAY,QAG3B;AAED,wBAAgB,kBAAkB,QAGjC;AAED,wBAAgB,aAAa,QAG5B;AAED,wBAAgB,gBAAgB,CAAC,GAAG,KAAA,OAiBnC;AAED,wBAAgB,aAAa,QAE5B"} \ No newline at end of file diff --git a/dist/src/store.d.ts b/dist/src/store.d.ts deleted file mode 100644 index f2ea5af..0000000 --- a/dist/src/store.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { GenericObjectType } from "./types/common.types"; -import postRobot from "post-robot"; -/** - * Class used by an app to store your data in {@link external:localStorage}. - * @hideconstructor - */ -declare class Store { - _connection: typeof postRobot; - constructor(connection: typeof postRobot); - /** - * Retrieves the stored data value associated with the given key. - * @param {string} key - The key of the stored data. - * @example - * appSDK.store.get('key').then((value) => console.log(value)); // Logs the value for the given key - * @returns {Promise} A Promise that resolves to the value associated with the key. - */ - get(key: string): Promise; - /** - * Retrieves an object with all the stored key-value pairs. - * @example await appSDK.store.getAll(); // Returns a Promise containing the stored data. - * @return {Promise} A Promise that resolves with the stored key-value pairs as an object. - */ - getAll(): Promise; - /** - * Sets the value of a key. - * @param {string} key The key for the stored data. - * @param {*} value The data to be stored. - * @example await appSDK.store.set('key', 'value'); // Returns a Promise that resolves with the success status. - * @return {Promise} A Promise that resolves with the success status (true when the value was set successfully). - */ - set(key: string, value: any): Promise; - /** - * Removes the value associated with a key from the store. - * @param {string} key The key whose value needs to be removed. - * @example await appSDK.store.remove('key'); // Returns a Promise that resolves with the success status. - * @return {Promise} A Promise that resolves with the success status (true when the value was removed successfully). - */ - remove(key: string): Promise; - /** - * Clears all the stored data of an UI Location. - * @example await appSDK.store.clear(); // Returns a Promise that resolves with the success status. - * @returns {Promise} A Promise that resolves with the success status (true when all values are cleared successfully). - */ - clear(): Promise; -} -export default Store; -//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/dist/src/store.d.ts.map b/dist/src/store.d.ts.map deleted file mode 100644 index 654bce6..0000000 --- a/dist/src/store.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC;;;GAGG;AACH,cAAM,KAAK;IACP,WAAW,EAAE,OAAO,SAAS,CAAC;gBAElB,UAAU,EAAE,OAAO,SAAS;IAIxC;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAY9B;;;;OAIG;IACH,MAAM,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAOpC;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAU9C;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUrC;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;CAM5B;AAED,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/dist/src/streamlinedField.d.ts b/dist/src/streamlinedField.d.ts deleted file mode 100644 index b6ba074..0000000 --- a/dist/src/streamlinedField.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=streamlinedField.d.ts.map \ No newline at end of file diff --git a/dist/src/streamlinedField.d.ts.map b/dist/src/streamlinedField.d.ts.map deleted file mode 100644 index cab815f..0000000 --- a/dist/src/streamlinedField.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"streamlinedField.d.ts","sourceRoot":"","sources":["../../src/streamlinedField.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/src/types.d.ts b/dist/src/types.d.ts deleted file mode 100644 index cf25adc..0000000 --- a/dist/src/types.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -import EntryClass from "./entry"; -import Field from "./field"; -import FieldModifierLocationField from "./fieldModifierLocation/field"; -import FieldModifierLocationFrame from "./fieldModifierLocation/frame"; -import Stack from "./stack"; -import { GenericObjectType } from "./types/common.types"; -import { Entry } from "./types/entry.types"; -import { Asset, ContentType, Schema, StackDetail } from "./types/stack.types"; -import { User } from "./types/user.types"; -import Window from "./window"; -export declare interface IDashboardWidget { - frame: Window; - stack: Stack; -} -export declare interface ICustomField { - entry: EntryClass; - field: Field; - fieldConfig: GenericObjectType; - frame: Window; - stack: Stack; -} -export declare interface ISidebarWidget { - entry: EntryClass; - stack: Stack; -} -export declare interface IFieldModifierLocation { - entry: EntryClass; - stack: Stack; - field: FieldModifierLocationField; - frame: FieldModifierLocationFrame; -} -export declare interface IFullPageLocation { - stack: Stack; -} -export declare interface ManifestUser { - uid: string; - first_name: string; - last_name: string; -} -export declare interface Manifest { - created_by: ManifestUser; - icon: string; - name: string; - target_type: string; - uid: string; - updated_by: ManifestUser; - version: number; - visibility: string; -} -export declare interface IAppConfigWidget { - installation: { - setInstallationData: (installationData: IInstallationData) => Promise; - getInstallationData: () => Promise; - setValidity: (isValid: boolean, options?: ValidationOptions) => void; - stack(): Stack; - }; - stack: Stack; -} -export declare enum DashboardWidth { - FULL_WIDTH = "full_width", - HALF_WIDTH = "half_width" -} -export declare enum LocationType { - APP_CONFIG_WIDGET = "APP_CONFIG_WIDGET", - ASSET_SIDEBAR_WIDGET = "ASSET_SIDEBAR_WIDGET", - DASHBOARD = "DASHBOARD", - FIELD = "FIELD", - FIELD_MODIFIER_LOCATION = "FIELD_MODIFIER_LOCATION", - FULL_PAGE_LOCATION = "FULL_PAGE_LOCATION", - RTE = "RTE", - WIDGET = "WIDGET" -} -declare interface ICommonInitData { - app_id: string; - currentBranch: string; - extension_uid: string; - installation_uid: string; - region: string; - stack: StackDetail; - type: LocationType; - user: User; - manifest?: Manifest; -} -export declare interface IDashboardInitData extends ICommonInitData { - dashboard_width: DashboardWidth; - config?: GenericObjectType; - type: LocationType.DASHBOARD; -} -export declare interface ISidebarInitData extends ICommonInitData { - config?: GenericObjectType; - content_type: ContentType; - entry: Entry; - locale: string; - type: LocationType.WIDGET; -} -export declare interface IFieldInitData extends ICommonInitData { - config?: GenericObjectType; - content_type: ContentType; - entry: Entry; - field_config: GenericObjectType; - locale: string; - schema: Schema; - self: boolean; - type: LocationType.FIELD; - uid: string; - value: any; -} -export declare interface IFullPageLocationInitData extends ICommonInitData { - config?: GenericObjectType; - type: LocationType.FULL_PAGE_LOCATION; -} -export declare interface IRTEInitData extends ICommonInitData { - config?: GenericObjectType; - type: LocationType.RTE; -} -export declare interface IAppConfigInitData extends ICommonInitData { - config?: GenericObjectType; - type: LocationType.APP_CONFIG_WIDGET; -} -export declare interface IAssetSidebarInitData extends ICommonInitData { - config: GenericObjectType; - currentAsset: Asset; - type: LocationType.ASSET_SIDEBAR_WIDGET; -} -export declare interface IFieldModifierLocationInitData extends ICommonInitData { - changedData: Entry; - config?: GenericObjectType; - content_type: ContentType; - entry: Entry; - locale: string; - schema: Schema; - self: boolean; - value: any; - type: LocationType.FIELD_MODIFIER_LOCATION; - uid: string; -} -export declare interface setAssetDto { - title: string; - description: string; - tags: string[]; -} -export declare enum StackLocation { - STACK_CONFIG = "cs.cm.stack.config", - DASHBOARD = "cs.cm.stack.dashboard", - SIDEBAR = "cs.cm.stack.sidebar", - CUSTOM_FIELD = "cs.cm.stack.custom_field", - RTE = "cs.cm.stack.rte" -} -export declare enum OrganizationLocation { - ORG_CONFIG = "cs.org.config" -} -export declare type AppLocation = StackLocation | OrganizationLocation; -export interface Scope { - content_types: string[]; -} -export declare type InitializationData = IAppConfigInitData | IAssetSidebarInitData | IDashboardInitData | IFieldInitData | IFieldModifierLocationInitData | IFullPageLocationInitData | IRTEInitData | ISidebarInitData; -/** - * installation details API response - */ -export interface IInstallationData { - configuration: { - [key: string]: any; - }; - serverConfiguration: { - [key: string]: any; - }; - webhooks?: { - channels: string[]; - }[]; - uiLocations?: { - type: AppLocation; - meta: { - enabled: boolean; - scope?: Scope; - name: string; - extentionUid: string; - }[]; - }[]; -} -export declare interface ValidationOptions { - message?: string; -} -export declare interface IManagementTokenDetails { - uid: string; - name: string; -} -export declare enum Region { - UNKNOWN = "UNKNOWN", - NA = "NA", - EU = "EU", - AZURE_NA = "AZURE_NA", - AZURE_EU = "AZURE_EU" -} -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/dist/src/types.d.ts.map b/dist/src/types.d.ts.map deleted file mode 100644 index 9a63110..0000000 --- a/dist/src/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,0BAA0B,MAAM,+BAA+B,CAAC;AACvE,OAAO,0BAA0B,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY;IACjC,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,iBAAiB,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc;IACnC,KAAK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AY,WAAW,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAE/D,MAAM,WAAW,KAAK;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,oBAAY,kBAAkB,GACxB,kBAAkB,GAClB,qBAAqB,GACrB,kBAAkB,GAClB,cAAc,GACd,8BAA8B,GAC9B,yBAAyB,GACzB,YAAY,GACZ,gBAAgB,CAAC;AAEvB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACtC,mBAAmB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC5C,QAAQ,CAAC,EAAE;QACP,QAAQ,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,WAAW,CAAC,EAAE;QACV,IAAI,EAAE,WAAW,CAAC;QAClB,IAAI,EAAE;YACF,OAAO,EAAE,OAAO,CAAC;YACjB,KAAK,CAAC,EAAE,KAAK,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,YAAY,EAAE,MAAM,CAAC;SACxB,EAAE,CAAC;KACP,EAAE,CAAC;CACP;AAGD,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,uBAAuB;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,oBAAY,MAAM;IACd,OAAO,YAAY;IACnB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACxB"} \ No newline at end of file diff --git a/dist/src/types/common.types.d.ts b/dist/src/types/common.types.d.ts deleted file mode 100644 index 064fdf6..0000000 --- a/dist/src/types/common.types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface AnyProperty { - [propName: string]: any; -} -export declare type GenericObjectType = Record; -//# sourceMappingURL=common.types.d.ts.map \ No newline at end of file diff --git a/dist/src/types/common.types.d.ts.map b/dist/src/types/common.types.d.ts.map deleted file mode 100644 index 10d8f3f..0000000 --- a/dist/src/types/common.types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../../src/types/common.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/src/types/entry.types.d.ts b/dist/src/types/entry.types.d.ts deleted file mode 100644 index a34e6e0..0000000 --- a/dist/src/types/entry.types.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import Field from "../field"; -import { AnyProperty } from "./common.types"; -export declare interface IGetFieldOptions { - /** - * By default, getFields will return a field if has been saved. - * If you want to get a field that has not been saved, set this to true. - */ - useUnsavedSchema?: boolean; -} -export declare interface IEntryInternalFlags { - /** - * This is an internal flag used to inject a custom field instance. - * This is used by the App SDK to inject a custom field instance. - */ - FieldInstance?: Field; -} -export declare interface IEntryOptions { - _internalFlags?: IEntryInternalFlags; -} -export declare interface IGetTagsOptions { - /** - * By default, getFields will return a field if has been saved. - * If you want to get a field that has not been saved, set this to true. - */ - useUnsavedSchema?: boolean; -} -export declare type IOnEntryChangeCallback = ( -/** - * The new entry object. - */ -unresolvedEntry: Record, -/** - * The new entry object with all the file fields resolved. - */ -resolvedEntry: Record) => void; -export interface Entry extends AnyProperty { - title: string; - uid: string; - content_type_title: string; - publish_details: Array; - locale: string; - url?: string; -} -//# sourceMappingURL=entry.types.d.ts.map \ No newline at end of file diff --git a/dist/src/types/entry.types.d.ts.map b/dist/src/types/entry.types.d.ts.map deleted file mode 100644 index 6fa5671..0000000 --- a/dist/src/types/entry.types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"entry.types.d.ts","sourceRoot":"","sources":["../../../src/types/entry.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACrC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,WAAW,mBAAmB;IACxC;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,aAAa;IAClC,cAAc,CAAC,EAAE,mBAAmB,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,WAAW,eAAe;IACpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,MAAM,sBAAsB,GAAG;AACzC;;GAEG;AACH,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;AACpC;;GAEG;AACH,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACjC,IAAI,CAAC;AAEV,MAAM,WAAW,KAAM,SAAQ,WAAW;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/dist/src/types/postRobot.types.d.ts b/dist/src/types/postRobot.types.d.ts deleted file mode 100644 index d789086..0000000 --- a/dist/src/types/postRobot.types.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -declare type CrossDomainWindowType = Window | null; -declare type DomainMatcher = string | RegExp | string[]; -declare type HandlerType = (event: { - source: CrossDomainWindowType; - origin: string; - data: any; -}) => Promise; -declare type ErrorHandlerType = (err: any) => void; -interface ServerOptionsType { - handler?: HandlerType | undefined; - errorHandler?: ErrorHandlerType | undefined; - window?: CrossDomainWindowType | undefined; - name?: string | undefined; - domain?: DomainMatcher | undefined; - once?: boolean | undefined; - errorOnClose?: boolean | undefined; -} -interface CancelableType { - cancel: () => void; -} -interface RegularRequestOptionsType { - domain?: DomainMatcher | undefined; - fireAndForget?: false | undefined; - timeout?: number | undefined; -} -interface ResponseMessageEvent { - source: CrossDomainWindowType; - origin: string; - data: T; -} -interface FireAndForgetRequestOptionsType { - domain?: DomainMatcher | undefined; - fireAndForget?: true | undefined; - timeout?: number | undefined; -} -interface Config { - LOG_LEVEL: string; -} -//# sourceMappingURL=postRobot.types.d.ts.map \ No newline at end of file diff --git a/dist/src/types/postRobot.types.d.ts.map b/dist/src/types/postRobot.types.d.ts.map deleted file mode 100644 index f64435e..0000000 --- a/dist/src/types/postRobot.types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"postRobot.types.d.ts","sourceRoot":"","sources":["../../../src/types/postRobot.types.ts"],"names":[],"mappings":"AAAA,aAAK,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAAC;AAE3C,aAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEhD,aAAK,WAAW,GAAG,CAAC,KAAK,EAAE;IACvB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;CACb,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAEnB,aAAK,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;AAE3C,UAAU,iBAAiB;IACvB,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC5C,MAAM,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC3C,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACnC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACtC;AAED,UAAU,cAAc;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,yBAAyB;IAC/B,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,UAAU,oBAAoB,CAAC,CAAC,GAAG,MAAM;IACrC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,CAAC;CACX;AAED,UAAU,+BAA+B;IACrC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,UAAU,MAAM;IACZ,SAAS,EAAE,MAAM,CAAC;CACrB"} \ No newline at end of file diff --git a/dist/src/types/stack.types.d.ts b/dist/src/types/stack.types.d.ts deleted file mode 100644 index f8cfcb1..0000000 --- a/dist/src/types/stack.types.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -import Entry from "../entry"; -import { AnyProperty, GenericObjectType } from "./common.types"; -export declare interface StackDetail { - created_at: string; - updated_at: string; - uid: string; - name: string; - org_uid: string; - api_key: string; - master_locale: string; - is_asset_download_public: boolean; - owner_uid: string; - user_uids: string[]; - settings: { - version?: string; - rte_version?: number; - blockAuthQueryParams?: boolean; - allowedCDNTokens?: ["access_token"]; - branches?: boolean; - localesOptimization?: boolean; - webhook_enabled?: boolean; - live_preview?: Partial<{ - enabled: boolean; - "default-env": string; - "default-url": string; - }>; - language_fallback?: boolean; - }; - master_key?: string; - collaborators?: { - uid: string; - created_at: string; - updated_at: string; - email: string; - username: string; - first_name: string; - last_name: string; - active: boolean; - metadata: { - idp_user: boolean; - }; - settings: { - preferences: { - global: any[]; - stack: any[]; - }; - }; - accepted: boolean; - invited_at: string; - invited_by: string; - }[]; - stack_variables?: GenericObjectType; - discrete_variables?: { - cms: boolean; - _version: number; - secret_key: string; - }; - global_search?: boolean; - branches?: BranchDetail[]; - usage?: { - content_types: number; - entries: number; - assets: number; - environments: number; - locales: number; - roles: number; - webhooks: number; - extensions: number; - saved_searches: number; - global_fields: number; - branches: number; - labels: number; - releases: number; - branch_aliases: number; - }; -} -export declare interface BranchDetail { - api_key: string; - uid: string; - source: string; - alias: { - uid: string; - }[]; -} -export declare interface StackAdditionalData { - currentBranch: string; -} -export declare interface StackSearchQuery { - type: "entries" | "assets"; - skip?: number; - limit?: number; - include_publish_details?: boolean; - include_unpublished?: boolean; - include_workflow?: boolean; - include_fields?: boolean; - include_rules?: boolean; - include_title_field_uid?: boolean; - query?: GenericObjectType; - search?: string; - save_recent_search?: boolean; - desc?: string; -} -export declare interface GetAllStacksOptions { - orgUid?: string; - params?: GenericObjectType; -} -export interface ContentType extends AnyProperty { - title: string; - uid: string; - schema: Array; - options: ContentTypeOptions; -} -export interface ContentTypeOptions { - is_page: boolean; - singleton: boolean; - title: string; - sub_title: Array; - url_pattern?: string; -} -export interface Schema extends AnyProperty { - display_name: string; - uid: string; - $uid: string; - data_type: string; - mandatory?: boolean; - unique?: boolean; - field_metadata?: GenericObjectType; -} -export interface Asset extends AnyProperty { - uid: string; - title: string; - description?: string; - parent_uid?: string; - url?: string; - filename?: string; -} -export interface PublishDetails extends AnyProperty { - entries: Array; - environments: Array; - locales: Array; - publish_with_reference: boolean; - rules: GenericObjectType; -} -//# sourceMappingURL=stack.types.d.ts.map \ No newline at end of file diff --git a/dist/src/types/stack.types.d.ts.map b/dist/src/types/stack.types.d.ts.map deleted file mode 100644 index a0d479e..0000000 --- a/dist/src/types/stack.types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stack.types.d.ts","sourceRoot":"","sources":["../../../src/types/stack.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,CAAC,OAAO,WAAW,WAAW;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,gBAAgB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;YACnB,OAAO,EAAE,OAAO,CAAC;YACjB,aAAa,EAAE,MAAM,CAAC;YACtB,aAAa,EAAE,MAAM,CAAC;SACzB,CAAC,CAAC;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU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AC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,MAAO,SAAQ,WAAW;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACtC;AAED,MAAM,WAAW,KAAM,SAAQ,WAAW;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IAC/C,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;IAChC,KAAK,EAAE,iBAAiB,CAAC;CAC5B"} \ No newline at end of file diff --git a/dist/src/types/user.types.d.ts b/dist/src/types/user.types.d.ts deleted file mode 100644 index 24c2eb8..0000000 --- a/dist/src/types/user.types.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AnyProperty, GenericObjectType } from "./common.types"; -export interface User extends AnyProperty { - uid: string; - email: string; - username: string; - first_name: string; - last_name: string; - org_uid: Array; - organizations: Array; - roles: Array; -} -//# sourceMappingURL=user.types.d.ts.map \ No newline at end of file diff --git a/dist/src/types/user.types.d.ts.map b/dist/src/types/user.types.d.ts.map deleted file mode 100644 index 2ab41bf..0000000 --- a/dist/src/types/user.types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user.types.d.ts","sourceRoot":"","sources":["../../../src/types/user.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACxC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;CACnC"} \ No newline at end of file diff --git a/dist/src/uiLocation.d.ts b/dist/src/uiLocation.d.ts deleted file mode 100644 index f11159a..0000000 --- a/dist/src/uiLocation.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -import postRobot from "post-robot"; -import AssetSidebarWidget from "./AssetSidebarWidget"; -import { IRTEPluginInitializer } from "./RTE/types"; -import Metadata from "./metadata"; -import Modal from "./modal"; -import Stack from "./stack"; -import Store from "./store"; -import { IAppConfigWidget, ICustomField, IDashboardWidget, IFieldModifierLocation, IFullPageLocation, ISidebarWidget, InitializationData, LocationType, Region } from "./types"; -import { GenericObjectType } from "./types/common.types"; -import { User } from "./types/user.types"; -/** - * Class representing an UI Location from Contentstack App SDK. - * @hideconstructor - */ -declare class UiLocation { - /** - * This value represents the current app's unique ID. - */ - appUID: string; - /** - * This holds the app's installation ID. - */ - installationUID: string; - /** - * This object holds details of the current user. - */ - currentUser: User; - /** - * The type of UI Location being rendered. - */ - private type; - /** - * The configuration set for an app. - */ - private config; - /** - * This holds the instance of Cross-domain communication library for posting messages between windows. - */ - postRobot: typeof postRobot; - /** - * This holds the stack instance that allows users to read and manipulate a range of objects in a stack. - */ - stack: Stack; - /** - * Store to persist data for the app. - * Note: Data is stored in the browser's {@link external:localStorage} and will be lost if the {@link external:localStorage} is cleared in the browser. - */ - store: Store; - /** - * This holds the instance of the Metadata class used to manage metadata. - */ - metadata: Metadata; - /** - * This value represents the current UI location's unique ID. One App may contain multiple UI locations - */ - locationUID: string; - /** - * This holds the instance of a helper class used to manage modals in an App. - */ - modal: Modal; - /** - * The Contentstack Region on which the app is running. - */ - readonly region: Region; - version: number | null; - /** - * This holds the information of the currently running UI location of an App. - */ - location: { - DashboardWidget: IDashboardWidget | null; - SidebarWidget: ISidebarWidget | null; - CustomField: ICustomField | null; - RTEPlugin: IRTEPluginInitializer | null; - AppConfigWidget: IAppConfigWidget | null; - AssetSidebarWidget: AssetSidebarWidget | null; - FullPage: IFullPageLocation | null; - FieldModifierLocation: IFieldModifierLocation | null; - }; - constructor(initData: InitializationData); - pulse: (eventName: string, metadata: GenericObjectType) => void; - /** - * Method used to retrieve the configuration set for an app. - */ - getConfig: () => Promise; - /** - * Method used to get the type of currently running UI location of the app. - */ - getCurrentLocation: () => LocationType; - /** - * Conditionally retrieves and returns the app version if not present already - * @returns version of the app currently running. - */ - getAppVersion: () => Promise; - /** - * Method used to get the Contentstack Region on which the app is running. - */ - getCurrentRegion: () => Region; - /** - * Method used to initialize the App SDK. - * @param version - Version of the app SDK in use. - */ - static initialize(version: string): Promise; - setReady(): Promise; -} -export default UiLocation; -//# sourceMappingURL=uiLocation.d.ts.map \ No newline at end of file diff --git a/dist/src/uiLocation.d.ts.map b/dist/src/uiLocation.d.ts.map deleted file mode 100644 index ffa17e1..0000000 --- a/dist/src/uiLocation.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uiLocation.d.ts","sourceRoot":"","sources":["../../src/uiLocation.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAOpD,OAAO,QAAQ,MAAM,YAAY,C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;QACzC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,CAAC;QAC9C,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;QACnC,qBAAqB,EAAE,sBAAsB,GAAG,IAAI,CAAC;KACxD,CAAC;gBAEU,QAAQ,EAAE,kBAAkB;IAmOxC,KAAK,cAAe,MAAM,YAAY,iBAAiB,KAAG,IAAI,CAE5D;IAEF;;OAEG;IACH,SAAS,QAAO,QAAQ,iBAAiB,CAAC,CAQxC;IAEF;;OAEG;IACH,kBAAkB,QAAO,YAAY,CAEnC;IAEF;;;OAGG;IACH,aAAa,QAAa,QAAQ,MAAM,GAAG,IAAI,CAAC,CAoB9C;IAEF;;OAEG;IACH,gBAAgB,QAAO,MAAM,CAE3B;IAEF;;;OAGG;WACU,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWrE,QAAQ,IAAI,OAAO,CAAC,oBAAoB,CAAC;CAG5C;AAED,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/dist/src/utils.d.ts b/dist/src/utils.d.ts deleted file mode 100644 index 484730f..0000000 --- a/dist/src/utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare function onData>(data: { - data: Data; -}): Promise; -export declare function onError(error: Error): Promise; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/dist/src/utils.d.ts.map b/dist/src/utils.d.ts.map deleted file mode 100644 index 25025f4..0000000 --- a/dist/src/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,iBAK5E;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,kBAEnC"} \ No newline at end of file diff --git a/dist/src/utils/errorMessages.d.ts b/dist/src/utils/errorMessages.d.ts deleted file mode 100644 index 32eb059..0000000 --- a/dist/src/utils/errorMessages.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -export declare const ERROR_MESSAGES: Readonly<{ - configPage: { - setValidity: { - isValidTypeBoolean: string; - messageTypeString: string; - }; - }; - entryField: { - entry: { - tagsShouldNotBeBlank: string; - tagsShouldBeArrayOfStrings: string; - }; - frame: { - dimensionHeightShouldBeNumber: string; - dimensionWidthShouldBeNumber: string; - }; - }; -}>; -export default function generateErrorMessages(message: string): string; -//# sourceMappingURL=errorMessages.d.ts.map \ No newline at end of file diff --git a/dist/src/utils/errorMessages.d.ts.map b/dist/src/utils/errorMessages.d.ts.map deleted file mode 100644 index 8fde1ab..0000000 --- a/dist/src/utils/errorMessages.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errorMessages.d.ts","sourceRoot":"","sources":["../../../src/utils/errorMessages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;EAiBzB,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,OAAO,EAAE,MAAM,UAE5D"} \ No newline at end of file diff --git a/dist/src/utils/utils.d.ts b/dist/src/utils/utils.d.ts deleted file mode 100644 index 566aecf..0000000 --- a/dist/src/utils/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Region } from "../types"; -export declare function onData>(data: { - data: Data; -}): Promise; -export declare function onError(error: Error): Promise; -export declare function formatAppRegion(region: string): Region; -export declare function getPreferredBodyElement(nodeCollection: HTMLCollection): Element; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/dist/src/utils/utils.d.ts.map b/dist/src/utils/utils.d.ts.map deleted file mode 100644 index fdf602c..0000000 --- a/dist/src/utils/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,MAAM,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,iBAK5E;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,kBAEnC;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAatD;AAED,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,cAAc,WA6BrE"} \ No newline at end of file diff --git a/dist/src/window.d.ts b/dist/src/window.d.ts deleted file mode 100644 index 7e8cf56..0000000 --- a/dist/src/window.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import EventEmitter from "wolfy87-eventemitter"; -import postRobot from "post-robot"; -import { DashboardWidth, LocationType } from "./types"; -/** - * Class representing an iframe window from Contentstack UI. Not available for Custom Widgets. - */ -declare class Window { - /** - * @hideconstructor - */ - _connection: typeof postRobot; - _autoResizingEnabled: boolean; - _resizingEnabled: boolean; - type: LocationType.DASHBOARD | LocationType.FIELD; - _emitter: EventEmitter; - state: DashboardWidth; - _height?: number; - constructor(connection: any, type: LocationType.DASHBOARD | LocationType.FIELD, emitter: EventEmitter, state?: DashboardWidth); - /** - * Activates the resize button that allows you to resize the window size of your Dashboard Widget. - * @return {Promise} A promise that resolves when the resize button becomes visible on the Dashboard Widget. - */ - enableResizing(): Promise; - /** - * This function executes the callback function whenever a Dashboard Widget is maximized or minimized. Only applicable on Dashboard Widgets. - * @param {function} callback The function to be called when a Dashboard Widget is maximized or minimized. - * @return {boolean} Returns true if the operation completes successfully without errors. - */ - onDashboardResize(callback: (event: any) => void): boolean; - /** - * Updates the Widget height on Contentstack UI. - * If the 'height' argument is not provided, it will automatically calculate the scroll height and adjust the widget window height accordingly. - * @param {number} height The desired height of the iframe window. - * @return {Promise} A promise that resolves when Contentstack UI acknowledges that the height has been updated. - */ - updateHeight(height?: number): Promise; - /** - * Enables auto resizing of the Widget height. - * @return {Window} The context of the Window class. - */ - enableAutoResizing(): Window; - /** - * Disables auto resizing of the Widget height. - * @returns {Window} The context of the Window class. - */ - disableAutoResizing(): Window; - /** - * Adds a padding on top of the Dashboard widget. - * @returns {Promise} A promise that resolves when the padding is added. - */ - enablePaddingTop(): Promise; - /** - * Removes the padding previously added on top of the Dashboard widget. - * @returns {Promise} A promise that resolves when the padding is removed. - */ - disablePaddingTop(): Promise; -} -export default Window; -//# sourceMappingURL=window.d.ts.map \ No newline at end of file diff --git a/dist/src/window.d.ts.map b/dist/src/window.d.ts.map deleted file mode 100644 index d20a57a..0000000 --- a/dist/src/window.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/window.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvD;;GAEG;AAEH,cAAM,MAAM;IACR;;OAEG;IAEH,WAAW,EAAE,OAAO,SAAS,CAAC;IAC9B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,YAAY,CAAC,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC;IAClD,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;gBAGb,UAAU,EAAE,GAAG,EACf,IAAI,EAAE,YAAY,CAAC,SAAS,GAAG,YAAY,CAAC,KAAK,EACjD,OAAO,EAAE,YAAY,EACrB,KAAK,GAAE,cAA0C;IAUrD;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAUrC;;;;OAIG;IACH,iBAAiB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI;IAmBhD;;;;;OAKG;IACG,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBlD;;;OAGG;IACH,kBAAkB,IAAI,MAAM;IAe5B;;;OAGG;IACH,mBAAmB,IAAI,MAAM;IAS7B;;;OAGG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAMvC;;;OAGG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAK3C;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index c9ab735..723fcc8 100644 --- a/package.json +++ b/package.json @@ -25,12 +25,6 @@ "name": "Contentstack", "url": "https://www.contentstack.com/" }, - "maintainers": [ - { - "name": "Deepak Kharah", - "email": "deepak.kharah@contentstack.com" - } - ], "license": "MIT", "devDependencies": { "@babel/core": "^7.2.2",