@enhance-eng/sandbox 0.4.0 → 0.4.1-beta.62b15db

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const _0x55bc31=_0xebc9;function _0xebc9(_0xb72290,_0x18cab4){_0xb72290=_0xb72290-0x96;const _0x46d5e7=_0x46d5();let _0xebc96c=_0x46d5e7[_0xb72290];return _0xebc96c;}(function(_0x2fce50,_0x231a1f){const _0x5e6ced=_0xebc9,_0x539f88=_0x2fce50();while(!![]){try{const _0x37ce31=-parseInt(_0x5e6ced(0xb1))/0x1*(parseInt(_0x5e6ced(0x96))/0x2)+-parseInt(_0x5e6ced(0x9b))/0x3+parseInt(_0x5e6ced(0xa5))/0x4+-parseInt(_0x5e6ced(0x9f))/0x5*(-parseInt(_0x5e6ced(0xac))/0x6)+-parseInt(_0x5e6ced(0xa3))/0x7+parseInt(_0x5e6ced(0xaf))/0x8*(-parseInt(_0x5e6ced(0xa4))/0x9)+parseInt(_0x5e6ced(0x97))/0xa;if(_0x37ce31===_0x231a1f)break;else _0x539f88['push'](_0x539f88['shift']());}catch(_0x40146f){_0x539f88['push'](_0x539f88['shift']());}}}(_0x46d5,0x75217));import{Command}from'commander';import{writeFile,mkdir}from'fs/promises';import{dirname,resolve}from'path';import _0x31dc37 from'dedent';function _0x46d5(){const _0x4dfa4b=['public/enhance-sw.js','command','282885Gmjnwe','stringify','output','name','846097jiGyCY','21141mouxPV','1210748befVTC','--publishable-key\x20<key>','description','--output\x20<path>','Output\x20path\x20for\x20the\x20service\x20worker\x20file','option','Enhance\x20sandbox\x20utility\x20CLI','42OvFPVv','stdout','action','2392JzVwCX','write','916JVseWm','version','cdnUrl','700QWtAjz','10770480KaAgca','requiredOption','Generate\x20the\x20service\x20worker\x20loader\x20file','utf-8','456555TNvZmi','publishableKey'];_0x46d5=function(){return _0x4dfa4b;};return _0x46d5();}function buildSwSource(_0x1d1c49){const _0x42a518=_0xebc9;return _0x31dc37`
4
- self.__ENHANCE_PUBLISHABLE_KEY__ = ${JSON[_0x42a518(0xa0)](_0x1d1c49[_0x42a518(0x9c)])};
5
- self.__ENHANCE_CDN__ = ${JSON[_0x42a518(0xa0)](_0x1d1c49[_0x42a518(0xb3)])};
3
+ const _0x2a2cef=_0x31dc;function _0x31dc(_0x898e36,_0x273fc2){_0x898e36=_0x898e36-0x6f;const _0x24e1b3=_0x24e1();let _0x31dcf3=_0x24e1b3[_0x898e36];return _0x31dcf3;}(function(_0x2f082f,_0x44bb7d){const _0x4131b9=_0x31dc,_0x1080c7=_0x2f082f();while(!![]){try{const _0x289a95=parseInt(_0x4131b9(0x90))/0x1+parseInt(_0x4131b9(0x83))/0x2+parseInt(_0x4131b9(0x7b))/0x3*(parseInt(_0x4131b9(0x8c))/0x4)+parseInt(_0x4131b9(0x87))/0x5*(-parseInt(_0x4131b9(0x81))/0x6)+parseInt(_0x4131b9(0x7f))/0x7*(parseInt(_0x4131b9(0x7c))/0x8)+parseInt(_0x4131b9(0x73))/0x9*(-parseInt(_0x4131b9(0x8d))/0xa)+-parseInt(_0x4131b9(0x80))/0xb;if(_0x289a95===_0x44bb7d)break;else _0x1080c7['push'](_0x1080c7['shift']());}catch(_0x5a45bb){_0x1080c7['push'](_0x1080c7['shift']());}}}(_0x24e1,0x281d9));import{Command}from'commander';import{writeFile,mkdir}from'fs/promises';import{dirname,resolve}from'path';import _0x5bef46 from'dedent';var DEFAULT_CDN_URL='https://cdn.enhancelabs.ai';function _0x24e1(){const _0x21ce11=['459gOmAKx','write','version','publishableKey','cdnUrl','command','CDN\x20URL\x20for\x20enhance\x20assets\x20(defaults\x20to\x20production)','stdout','6Pakncf','291352zAqmnq','public/enhance-sw.js','stringify','63pikRWC','4938802YEVfKI','3300Llqxxq','option','507754Nrwyya','Enhance\x20sandbox\x20utility\x20CLI','utf-8','parseAsync','2165IZjLRm','action','0.0.0','Generate\x20the\x20service\x20worker\x20loader\x20file','init','439916IRjTpL','21990TUSUZQ','cwd','name','161988nFFpop','Created\x20','description','output','requiredOption'];_0x24e1=function(){return _0x21ce11;};return _0x24e1();}function buildSwSource(_0x418f1a){const _0x2f0808=_0x31dc,_0x39c295=_0x418f1a[_0x2f0808(0x77)]??DEFAULT_CDN_URL;return _0x5bef46`
4
+ self.__ENHANCE_PUBLISHABLE_KEY__ = ${JSON[_0x2f0808(0x7e)](_0x418f1a[_0x2f0808(0x76)])};
5
+ self.__ENHANCE_CDN__ = ${JSON[_0x2f0808(0x7e)](_0x39c295)};
6
6
  importScripts(self.__ENHANCE_CDN__ + "/loader/loader.v1.js");
7
- `;}var program=new Command();program[_0x55bc31(0xa2)]('enhance-sandbox')[_0x55bc31(0xa7)](_0x55bc31(0xab))[_0x55bc31(0xb2)]('0.0.0'),program[_0x55bc31(0x9e)]('init')[_0x55bc31(0xa7)](_0x55bc31(0x99))[_0x55bc31(0x98)]('--cdn-url\x20<url>','CDN\x20URL\x20for\x20enhance\x20assets')[_0x55bc31(0x98)](_0x55bc31(0xa6),'Publishable\x20key\x20for\x20enhance')[_0x55bc31(0xaa)](_0x55bc31(0xa8),_0x55bc31(0xa9),_0x55bc31(0x9d))[_0x55bc31(0xae)](async _0xb506d5=>{const _0x9cc0e6=_0x55bc31,_0x2d9f6e=resolve(process['cwd'](),_0xb506d5[_0x9cc0e6(0xa1)]),_0x1ad33b=buildSwSource({'cdnUrl':_0xb506d5['cdnUrl'],'publishableKey':_0xb506d5[_0x9cc0e6(0x9c)]});await mkdir(dirname(_0x2d9f6e),{'recursive':!![]}),await writeFile(_0x2d9f6e,_0x1ad33b,_0x9cc0e6(0x9a)),process[_0x9cc0e6(0xad)][_0x9cc0e6(0xb0)]('Created\x20'+_0xb506d5[_0x9cc0e6(0xa1)]+'\x0a');}),program['parseAsync']();
7
+ `;}var program=new Command();program[_0x2a2cef(0x8f)]('enhance-sandbox')[_0x2a2cef(0x70)](_0x2a2cef(0x84))[_0x2a2cef(0x75)](_0x2a2cef(0x89)),program[_0x2a2cef(0x78)](_0x2a2cef(0x8b))[_0x2a2cef(0x70)](_0x2a2cef(0x8a))[_0x2a2cef(0x72)]('--publishable-key\x20<key>','Publishable\x20key\x20for\x20enhance')[_0x2a2cef(0x82)]('--cdn-url\x20<url>',_0x2a2cef(0x79))[_0x2a2cef(0x82)]('--output\x20<path>','Output\x20path\x20for\x20the\x20service\x20worker\x20file',_0x2a2cef(0x7d))[_0x2a2cef(0x88)](async _0x16cdcf=>{const _0x56ed0f=_0x2a2cef,_0x5c3d39=resolve(process[_0x56ed0f(0x8e)](),_0x16cdcf[_0x56ed0f(0x71)]),_0x1b1e3a=buildSwSource({'publishableKey':_0x16cdcf[_0x56ed0f(0x76)],'cdnUrl':_0x16cdcf[_0x56ed0f(0x77)]});await mkdir(dirname(_0x5c3d39),{'recursive':!![]}),await writeFile(_0x5c3d39,_0x1b1e3a,_0x56ed0f(0x85)),process[_0x56ed0f(0x7a)][_0x56ed0f(0x74)](_0x56ed0f(0x6f)+_0x16cdcf[_0x56ed0f(0x71)]+'\x0a');}),program[_0x2a2cef(0x86)]();
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { E as EnhanceOptions } from './sw-source-DpteoW28.js';
1
+ export { E as EnhanceOptions } from './sw-source-CUI8GVoj.js';
2
2
 
3
3
  declare function enhance(): void;
4
4
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var _0x22c40a=_0x623e;(function(_0x39c3c6,_0x3fd560){var _0x8bf4b0=_0x623e,_0x5e4470=_0x39c3c6();while(!![]){try{var _0x53f2dd=parseInt(_0x8bf4b0(0xcc))/0x1*(-parseInt(_0x8bf4b0(0xd4))/0x2)+parseInt(_0x8bf4b0(0xce))/0x3+-parseInt(_0x8bf4b0(0xd1))/0x4+parseInt(_0x8bf4b0(0xc7))/0x5*(-parseInt(_0x8bf4b0(0xc9))/0x6)+-parseInt(_0x8bf4b0(0xd0))/0x7*(-parseInt(_0x8bf4b0(0xd6))/0x8)+-parseInt(_0x8bf4b0(0xd3))/0x9*(-parseInt(_0x8bf4b0(0xc6))/0xa)+-parseInt(_0x8bf4b0(0xcd))/0xb*(-parseInt(_0x8bf4b0(0xca))/0xc);if(_0x53f2dd===_0x3fd560)break;else _0x5e4470['push'](_0x5e4470['shift']());}catch(_0x4a770c){_0x5e4470['push'](_0x5e4470['shift']());}}}(_0x1ecd,0x78a09));var SW_PATH=_0x22c40a(0xd5);function _0x1ecd(){var _0x2f9bd0=['2253532MhwHgC','createElement','5261049qQNsij','10JsrJCs','/enhance-sw.js','2110792NhAeYd','10jUdlKM','5aOusln','head','3251142GaZaXO','408WuBQwj','navigator.serviceWorker?.register(\x22','65930QOGQNO','247742lHYGRK','944463ZGAebS','textContent','7gLSSQM'];_0x1ecd=function(){return _0x2f9bd0;};return _0x1ecd();}function enhance(){var _0x3c8950=_0x22c40a;const _0xdfbd=document[_0x3c8950(0xd2)]('script');_0xdfbd[_0x3c8950(0xcf)]=_0x3c8950(0xcb)+SW_PATH+'\x22)',document[_0x3c8950(0xc8)]['appendChild'](_0xdfbd);}function _0x623e(_0x4a9232,_0x2236cf){_0x4a9232=_0x4a9232-0xc6;var _0x1ecd95=_0x1ecd();var _0x623e30=_0x1ecd95[_0x4a9232];return _0x623e30;}export{enhance};
1
+ var _0x5b4499=_0xe63b;(function(_0x156425,_0x3966bc){var _0x594c96=_0xe63b,_0x910df=_0x156425();while(!![]){try{var _0x45ce8b=-parseInt(_0x594c96(0x14c))/0x1+parseInt(_0x594c96(0x149))/0x2*(parseInt(_0x594c96(0x14f))/0x3)+parseInt(_0x594c96(0x154))/0x4*(-parseInt(_0x594c96(0x14b))/0x5)+-parseInt(_0x594c96(0x14a))/0x6*(parseInt(_0x594c96(0x150))/0x7)+parseInt(_0x594c96(0x153))/0x8+-parseInt(_0x594c96(0x148))/0x9+parseInt(_0x594c96(0x151))/0xa;if(_0x45ce8b===_0x3966bc)break;else _0x910df['push'](_0x910df['shift']());}catch(_0x29f01d){_0x910df['push'](_0x910df['shift']());}}}(_0x1207,0x736f5));function _0x1207(){var _0xbcb241=['2492872QQPMhl','4wUPIiX','/enhance-sw.js','createElement','1835559YuMxOV','464274jEGcSp','18DUAPyP','876515BBzjnC','653566YHusPu','appendChild','textContent','6SISKMr','1225770dqTXAF','12550880edBfFT','head'];_0x1207=function(){return _0xbcb241;};return _0x1207();}var SW_PATH=_0x5b4499(0x155);function enhance(){var _0x1747ee=_0x5b4499;const _0x4501f4=document[_0x1747ee(0x147)]('script');_0x4501f4[_0x1747ee(0x14e)]='navigator.serviceWorker?.register(\x22'+SW_PATH+'\x22)',document[_0x1747ee(0x152)][_0x1747ee(0x14d)](_0x4501f4);}function _0xe63b(_0x40ce87,_0x2d9b1f){_0x40ce87=_0x40ce87-0x147;var _0x120740=_0x1207();var _0xe63b96=_0x120740[_0x40ce87];return _0xe63b96;}export{enhance};
@@ -1,6 +1,6 @@
1
1
  type EnhanceOptions = {
2
- cdnUrl: string;
3
2
  publishableKey: string;
3
+ cdnUrl?: string;
4
4
  };
5
5
 
6
6
  export type { EnhanceOptions as E };
@@ -1,9 +1,9 @@
1
1
  import { Plugin } from 'vite';
2
- export { E as EnhancePluginOptions } from '../sw-source-DpteoW28.js';
2
+ export { E as EnhancePluginOptions } from '../sw-source-CUI8GVoj.js';
3
3
 
4
4
  declare const enhance: (options: {
5
- cdnUrl: string;
6
5
  publishableKey: string;
6
+ cdnUrl?: string;
7
7
  }) => Plugin;
8
8
 
9
9
  export { enhance };
@@ -1,5 +1,5 @@
1
- var _0x432a22=_0x5dcb;(function(_0x5b7744,_0x142bea){var _0x582409=_0x5dcb,_0x416df8=_0x5b7744();while(!![]){try{var _0x2f83f0=parseInt(_0x582409(0x104))/0x1+parseInt(_0x582409(0xfc))/0x2*(-parseInt(_0x582409(0x107))/0x3)+parseInt(_0x582409(0xf9))/0x4+parseInt(_0x582409(0xf5))/0x5*(-parseInt(_0x582409(0xf3))/0x6)+-parseInt(_0x582409(0xf2))/0x7+parseInt(_0x582409(0x106))/0x8*(parseInt(_0x582409(0xf7))/0x9)+-parseInt(_0x582409(0x105))/0xa;if(_0x2f83f0===_0x142bea)break;else _0x416df8['push'](_0x416df8['shift']());}catch(_0x4bc15e){_0x416df8['push'](_0x416df8['shift']());}}}(_0x2f88,0x4e3ba));import _0x5bda2c from'dedent';function buildSwSource(_0x489018){var _0xa5a79c=_0x5dcb;return _0x5bda2c`
2
- self.__ENHANCE_PUBLISHABLE_KEY__ = ${JSON[_0xa5a79c(0xf1)](_0x489018[_0xa5a79c(0xf8)])};
3
- self.__ENHANCE_CDN__ = ${JSON['stringify'](_0x489018[_0xa5a79c(0xf6)])};
1
+ function _0x3a5c(_0x48c29a,_0x123e52){_0x48c29a=_0x48c29a-0xd2;var _0x1ebb9a=_0x1ebb();var _0x3a5ca3=_0x1ebb9a[_0x48c29a];return _0x3a5ca3;}var _0x447c02=_0x3a5c;(function(_0x4c98c8,_0x4468d7){var _0x310584=_0x3a5c,_0x27aa66=_0x4c98c8();while(!![]){try{var _0x764efd=parseInt(_0x310584(0xe7))/0x1*(parseInt(_0x310584(0xd5))/0x2)+parseInt(_0x310584(0xeb))/0x3+parseInt(_0x310584(0xd9))/0x4*(parseInt(_0x310584(0xd7))/0x5)+-parseInt(_0x310584(0xe4))/0x6+parseInt(_0x310584(0xe6))/0x7+parseInt(_0x310584(0xdf))/0x8+-parseInt(_0x310584(0xdd))/0x9;if(_0x764efd===_0x4468d7)break;else _0x27aa66['push'](_0x27aa66['shift']());}catch(_0x3966fc){_0x27aa66['push'](_0x27aa66['shift']());}}}(_0x1ebb,0xe8b3a));import _0x422308 from'dedent';function _0x1ebb(){var _0x1bbc77=['cdnUrl','middlewares','application/javascript','6876SKLpRy','emitFile','5sJQjfk','use','2678948lnGpfS','stringify','url','<script>navigator.serviceWorker?.register(\x22','23195781ZUwNss','enhance','8403528yFPZWE','enhance-sw.js','\x22)</script>','/enhance-sw.js','replace','5082210aeWFnJ','setHeader','6884990lUCnMN','215HoYFsP','Content-Type','https://cdn.enhancelabs.ai','end','2803716ZSrfqU'];_0x1ebb=function(){return _0x1bbc77;};return _0x1ebb();}var DEFAULT_CDN_URL=_0x447c02(0xe9);function buildSwSource(_0x1246bc){var _0x2358c7=_0x447c02;const _0xc74d4b=_0x1246bc[_0x2358c7(0xd2)]??DEFAULT_CDN_URL;return _0x422308`
2
+ self.__ENHANCE_PUBLISHABLE_KEY__ = ${JSON[_0x2358c7(0xda)](_0x1246bc['publishableKey'])};
3
+ self.__ENHANCE_CDN__ = ${JSON[_0x2358c7(0xda)](_0xc74d4b)};
4
4
  importScripts(self.__ENHANCE_CDN__ + "/loader/loader.v1.js");
5
- `;}function _0x2f88(){var _0x2d35cc=['384013RHVrtr','6oPzSIF','setHeader','1269205FYjqXs','cdnUrl','1144692RuApdP','publishableKey','1189664VTWxUH','middlewares','asset','1137238AHqdhV','url','application/javascript','Content-Type','end','use','/enhance-sw.js','enhance','410846SwdteL','192530WNRxQF','32ltMQYW','3XjdVmn','emitFile','enhance-sw.js','<script>navigator.serviceWorker?.register(\x22','stringify'];_0x2f88=function(){return _0x2d35cc;};return _0x2f88();}function _0x5dcb(_0x513d06,_0x1c9d8b){_0x513d06=_0x513d06-0xee;var _0x2f88f0=_0x2f88();var _0x5dcba6=_0x2f88f0[_0x513d06];return _0x5dcba6;}var SW_PATH=_0x432a22(0x102),enhance=_0x2b35bb=>{var _0x5dd6fa=_0x432a22;const _0x2e297a=buildSwSource(_0x2b35bb),_0x1aede4=_0x5dd6fa(0xf0)+SW_PATH+'\x22)</script>';return{'name':_0x5dd6fa(0x103),'configureServer'(_0x21c72e){var _0x52a3d8=_0x5dd6fa;_0x21c72e[_0x52a3d8(0xfa)]['use']((_0x3edd7c,_0x3ac65c,_0xf03f70)=>{var _0x1efa3c=_0x52a3d8;if(_0x3edd7c[_0x1efa3c(0xfd)]===SW_PATH){_0x3ac65c[_0x1efa3c(0xf4)](_0x1efa3c(0xff),'application/javascript'),_0x3ac65c[_0x1efa3c(0x100)](_0x2e297a);return;}_0xf03f70();});},'configurePreviewServer'(_0x471bc5){var _0x44607d=_0x5dd6fa;_0x471bc5[_0x44607d(0xfa)][_0x44607d(0x101)]((_0x3bc119,_0xc26e45,_0x56d448)=>{var _0x200002=_0x44607d;if(_0x3bc119[_0x200002(0xfd)]===SW_PATH){_0xc26e45[_0x200002(0xf4)](_0x200002(0xff),_0x200002(0xfe)),_0xc26e45[_0x200002(0x100)](_0x2e297a);return;}_0x56d448();});},'generateBundle'(){var _0x21bf1b=_0x5dd6fa;this[_0x21bf1b(0xee)]({'type':_0x21bf1b(0xfb),'fileName':_0x21bf1b(0xef),'source':_0x2e297a});},'transformIndexHtml'(_0x60885c){return _0x60885c['replace'](/<head([^>]*)>/,'<head$1>'+_0x1aede4);}};};export{enhance};
5
+ `;}var SW_PATH=_0x447c02(0xe2),enhance=_0x21b2fb=>{var _0x2fd745=_0x447c02;const _0x36cbbe=buildSwSource(_0x21b2fb),_0xcf92c7=_0x2fd745(0xdc)+SW_PATH+_0x2fd745(0xe1);return{'name':_0x2fd745(0xde),'configureServer'(_0x276ce4){var _0x465765=_0x2fd745;_0x276ce4[_0x465765(0xd3)][_0x465765(0xd8)]((_0x44167e,_0x18312d,_0x28ed63)=>{var _0x26bcd5=_0x465765;if(_0x44167e[_0x26bcd5(0xdb)]===SW_PATH){_0x18312d[_0x26bcd5(0xe5)](_0x26bcd5(0xe8),_0x26bcd5(0xd4)),_0x18312d[_0x26bcd5(0xea)](_0x36cbbe);return;}_0x28ed63();});},'configurePreviewServer'(_0x219955){var _0x131c6a=_0x2fd745;_0x219955[_0x131c6a(0xd3)]['use']((_0x149e8f,_0x32a46c,_0x3f225e)=>{var _0x200940=_0x131c6a;if(_0x149e8f['url']===SW_PATH){_0x32a46c[_0x200940(0xe5)](_0x200940(0xe8),_0x200940(0xd4)),_0x32a46c['end'](_0x36cbbe);return;}_0x3f225e();});},'generateBundle'(){var _0x17f2b2=_0x2fd745;this[_0x17f2b2(0xd6)]({'type':'asset','fileName':_0x17f2b2(0xe0),'source':_0x36cbbe});},'transformIndexHtml'(_0x3b7b86){var _0x3fa406=_0x2fd745;return _0x3b7b86[_0x3fa406(0xe3)](/<head([^>]*)>/,'<head$1>'+_0xcf92c7);}};};export{enhance};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enhance-eng/sandbox",
3
- "version": "0.4.0",
3
+ "version": "0.4.1-beta.62b15db",
4
4
  "type": "module",
5
5
  "description": "Enhance preview bootstrap and tooling package.",
6
6
  "license": "MIT",