@magmacomputing/tempo-plugin-astro 1.1.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ![Tempo Plugin](/plugin-logo.svg)
2
+
1
3
  # @magmacomputing/tempo-plugin-astro
2
4
 
3
5
  This is a premium plugin for the [Tempo](https://github.com/magmacomputing/magma) library that provides precise astronomical events (Equinoxes and Solstices) and maps them to traditional season names based on hemisphere.
@@ -8,7 +10,7 @@ This is a premium plugin for the [Tempo](https://github.com/magmacomputing/magma
8
10
  npm install @magmacomputing/tempo-plugin-astro
9
11
  ```
10
12
 
11
- *Note: This plugin requires `@magmacomputing/tempo` version `3.0.0` or higher.*
13
+ *Note: This plugin requires `@magmacomputing/tempo` version `3.5.1` or higher.*
12
14
 
13
15
  ## Usage
14
16
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Tempo } from '@magmacomputing/tempo/core';
2
- declare module '@magmacomputing/tempo/core' {
1
+ import { Tempo } from '@magmacomputing/tempo';
2
+ declare module '@magmacomputing/tempo' {
3
3
  interface TempoTermRegistry {
4
4
  astro: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
5
5
  astronomy: {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- const a0_0x1edd4b=a0_0x4b4a;(function(_0x3825f2,_0x480825){const _0x1e08c0=a0_0x4b4a,_0xc67e04=_0x3825f2();while(!![]){try{const _0x3c93c4=parseInt(_0x1e08c0(0xf4))/0x1+-parseInt(_0x1e08c0(0x108))/0x2+-parseInt(_0x1e08c0(0xed))/0x3+parseInt(_0x1e08c0(0x101))/0x4+-parseInt(_0x1e08c0(0xeb))/0x5+parseInt(_0x1e08c0(0xf6))/0x6*(-parseInt(_0x1e08c0(0xf3))/0x7)+parseInt(_0x1e08c0(0xf5))/0x8;if(_0x3c93c4===_0x480825)break;else _0xc67e04['push'](_0xc67e04['shift']());}catch(_0x53eb2d){_0xc67e04['push'](_0xc67e04['shift']());}}}(a0_0x18f8,0x2f847));function a0_0x18f8(){const _0x113854=['winter','day','Summer','days','hour','toDateTime','astro','872955NLrWsz','Winter','1030221CUVIhO','month','minute','find','millisecond','UTC','7QlwbXV','363677qxovsY','5548368HaACWJ','1634790FZYOGi','add','trunc','Autumnal','push','key','vernal','config','extend','with','nanosecond','514472MFmnwa','Spring','second','timeZoneId','South','year','Autumn','401494qUeMYl','sphere','Vernal','autumnal','astronomy','summer','Equinox','microsecond'];a0_0x18f8=function(){return _0x113854;};return a0_0x18f8();}import{Tempo,enums}from'@magmacomputing/tempo/core';import{getTermRange}from'@magmacomputing/tempo/term';import{definePremiumTerm}from'@magmacomputing/tempo/plugin';import{enumify}from'@magmacomputing/tempo/library';var ASTRO=enumify({'Vernal':'vernal','Summer':'summer','Autumnal':a0_0x1edd4b(0x10b),'Winter':a0_0x1edd4b(0x110)}),{COMPASS,DURATIONS}=enums,key=a0_0x1edd4b(0xea),scope='astronomy';function calculateAstroMoment(_0x54a5f9,_0x284f3f,_0x582e96){const _0x4e8ba3=a0_0x1edd4b,_0x49361a=(_0x54a5f9-0x7d0)/0x3e8;let _0x1599bc;switch(_0x284f3f){case ASTRO[_0x4e8ba3(0x10a)]:_0x1599bc=2451623.80984+365242.37404*_0x49361a+0.05169*_0x49361a*_0x49361a;break;case ASTRO[_0x4e8ba3(0xe6)]:_0x1599bc=2451716.56767+365241.62603*_0x49361a+0.00325*_0x49361a*_0x49361a;break;case ASTRO[_0x4e8ba3(0xf9)]:_0x1599bc=2451810.21715+365242.01767*_0x49361a-0.11575*_0x49361a*_0x49361a;break;case ASTRO[_0x4e8ba3(0xec)]:_0x1599bc=2451900.05952+365242.74049*_0x49361a-0.06223*_0x49361a*_0x49361a;break;}const _0x483d7d=Math[_0x4e8ba3(0xf8)]((_0x1599bc-2440587.5)*DURATIONS[_0x4e8ba3(0xe7)]);return new Tempo(_0x483d7d,{'timeZone':_0x582e96,'timeStamp':'ms'});}function resolve(_0x2aca39,_0xc8550){const _0x462ade=a0_0x1edd4b,_0x1ed1e5=_0x2aca39[_0x462ade(0xfd)][_0x462ade(0x109)];if(!_0x1ed1e5)return[];const _0x45b218=_0xc8550?.['yy']??_0xc8550?.['year']??_0x2aca39['yy'],_0x1b8b2d=_0xc8550?.[_0x462ade(0x104)]??_0x2aca39['tz']??_0x462ade(0xf2),_0x2d70f3=[],_0x322213=_0x1ed1e5===COMPASS[_0x462ade(0x105)]?{'vernal':_0x462ade(0xf9),'summer':_0x462ade(0xec),'autumnal':_0x462ade(0x10a),'winter':'Summer'}:{'vernal':_0x462ade(0x10a),'summer':'Summer','autumnal':'Autumnal','winter':_0x462ade(0xec)},_0x24a667=_0x1ed1e5===COMPASS[_0x462ade(0x105)]?{'vernal':_0x462ade(0x107),'summer':_0x462ade(0xec),'autumnal':'Spring','winter':_0x462ade(0xe6)}:{'vernal':_0x462ade(0x102),'summer':_0x462ade(0xe6),'autumnal':_0x462ade(0x107),'winter':_0x462ade(0xec)};for(const _0x464dbd of[_0x45b218-0x1,_0x45b218,_0x45b218+0x1]){const _0x3af53b=(_0x6b17c9,_0x4b404e)=>{const _0x8498cb=_0x462ade,_0x17532c=calculateAstroMoment(_0x6b17c9,_0x4b404e,_0x1b8b2d),_0x5c32ed=_0x17532c['toDateTime']();return{'year':_0x5c32ed[_0x8498cb(0x106)],'month':_0x5c32ed['month'],'day':_0x5c32ed['day'],'hour':_0x5c32ed['hour'],'minute':_0x5c32ed[_0x8498cb(0xef)],'second':_0x5c32ed['second'],'millisecond':_0x5c32ed[_0x8498cb(0xf1)],'microsecond':_0x5c32ed['microsecond'],'nanosecond':_0x5c32ed[_0x8498cb(0x100)]};};_0x2d70f3[_0x462ade(0xfa)]({'key':_0x322213[_0x462ade(0xfc)],'season':_0x24a667[_0x462ade(0xfc)],'sphere':_0x1ed1e5,..._0x3af53b(_0x464dbd,ASTRO[_0x462ade(0x10a)]),'event':_0x462ade(0x10e),'group':_0x462ade(0x10c)}),_0x2d70f3['push']({'key':_0x322213[_0x462ade(0x10d)],'season':_0x24a667[_0x462ade(0x10d)],'sphere':_0x1ed1e5,..._0x3af53b(_0x464dbd,ASTRO[_0x462ade(0xe6)]),'event':'Solstice','group':_0x462ade(0x10c)}),_0x2d70f3['push']({'key':_0x322213[_0x462ade(0x10b)],'season':_0x24a667[_0x462ade(0x10b)],'sphere':_0x1ed1e5,..._0x3af53b(_0x464dbd,ASTRO['Autumnal']),'event':'Equinox','group':'astronomy'}),_0x2d70f3[_0x462ade(0xfa)]({'key':_0x322213[_0x462ade(0x110)],'season':_0x24a667[_0x462ade(0x110)],'sphere':_0x1ed1e5,..._0x3af53b(_0x464dbd,ASTRO[_0x462ade(0xec)]),'event':'Solstice','group':_0x462ade(0x10c)});}return _0x2d70f3;}function a0_0x4b4a(_0x2cc443,_0x1fb781){_0x2cc443=_0x2cc443-0xe6;const _0x18f8c4=a0_0x18f8();let _0x4b4a69=_0x18f8c4[_0x2cc443];return _0x4b4a69;}function resolveDateBoundary(_0x6beb,_0x2a9fc1){const _0x2f1d1f=resolve(_0x6beb,_0x2a9fc1);return _0x2f1d1f['map'](_0xf6c04d=>({..._0xf6c04d,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x4f7067){return resolve(this,_0x4f7067);},'define'(_0x28b5c8,_0x58dc6e){const _0x3fb9fe=a0_0x1edd4b,_0x19e2ad=resolve(this,_0x58dc6e),_0xb622b8=resolveDateBoundary(this,_0x58dc6e),_0x538192=_0x58dc6e??this[_0x3fb9fe(0xe9)]();if(_0x28b5c8===!![]||_0x28b5c8===void 0x0){const _0x4ade03=getTermRange(this,_0xb622b8,!![],_0x58dc6e);return _0x4ade03;}const _0x41dfa3=getTermRange(this,_0x19e2ad,![],_0x58dc6e);if(!_0x41dfa3)return _0x41dfa3;const _0x3fa024=getTermRange(this,_0xb622b8,![],_0x58dc6e);if(!_0x3fa024)return _0x41dfa3;const _0x557d15=_0x19e2ad[_0x3fb9fe(0xf0)](_0x1b808d=>_0x1b808d[_0x3fb9fe(0xfb)]===_0x3fa024['key']&&_0x1b808d[_0x3fb9fe(0x106)]===_0x3fa024[_0x3fb9fe(0x106)]&&_0x1b808d['month']===_0x3fa024[_0x3fb9fe(0xee)]&&_0x1b808d[_0x3fb9fe(0x111)]===_0x3fa024[_0x3fb9fe(0x111)]);if(!_0x557d15)return{..._0x3fa024,'strict':_0x41dfa3[_0x3fb9fe(0xfb)]};const _0x533225=_0x538192[_0x3fb9fe(0xff)]({'year':_0x557d15['year'],'month':_0x557d15['month'],'day':_0x557d15['day'],'hour':_0x557d15[_0x3fb9fe(0xe8)]??0x0,'minute':_0x557d15['minute']??0x0,'second':_0x557d15[_0x3fb9fe(0x103)]??0x0,'millisecond':_0x557d15[_0x3fb9fe(0xf1)]??0x0,'microsecond':_0x557d15[_0x3fb9fe(0x10f)]??0x0,'nanosecond':_0x557d15[_0x3fb9fe(0x100)]??0x0})[_0x3fb9fe(0xf7)]({'minutes':0x1}),_0x185d7c=getTermRange(this,_0x19e2ad,![],_0x533225);if(!_0x185d7c)return{..._0x3fa024,'strict':_0x41dfa3['key']};return{..._0x185d7c,'strict':_0x41dfa3[_0x3fb9fe(0xfb)]};}});Tempo[a0_0x1edd4b(0xfe)](AstroTerm);export{AstroTerm};
1
+ function a0_0x17a2(_0x5aa202,_0x131ea1){_0x5aa202=_0x5aa202-0xe7;const _0x1ed41e=a0_0x1ed4();let _0x17a24b=_0x1ed41e[_0x5aa202];return _0x17a24b;}const a0_0x42e3e2=a0_0x17a2;(function(_0x2cf271,_0x1630d7){const _0x57db4c=a0_0x17a2,_0x435a1b=_0x2cf271();while(!![]){try{const _0x195d25=parseInt(_0x57db4c(0x10d))/0x1*(parseInt(_0x57db4c(0x104))/0x2)+parseInt(_0x57db4c(0xf2))/0x3*(-parseInt(_0x57db4c(0xfb))/0x4)+-parseInt(_0x57db4c(0x114))/0x5*(parseInt(_0x57db4c(0xfe))/0x6)+parseInt(_0x57db4c(0x103))/0x7*(parseInt(_0x57db4c(0xe9))/0x8)+-parseInt(_0x57db4c(0xff))/0x9*(-parseInt(_0x57db4c(0xf8))/0xa)+-parseInt(_0x57db4c(0x117))/0xb+parseInt(_0x57db4c(0xf7))/0xc;if(_0x195d25===_0x1630d7)break;else _0x435a1b['push'](_0x435a1b['shift']());}catch(_0x543291){_0x435a1b['push'](_0x435a1b['shift']());}}}(a0_0x1ed4,0x6fa96));import{Tempo}from'@magmacomputing/tempo';import{enums,getTermRange,definePremiumTerm,enumify}from'@magmacomputing/tempo/plugin-api';function a0_0x1ed4(){const _0x4a0b75=['nanosecond','3016344TCHMVq','280HNSmsR','Summer','timeZoneId','8pPxvcD','autumnal','Solstice','1287918bNixZQ','252630YDryIm','sphere','config','Autumn','4172eiuJBT','2kgfcBa','summer','add','days','astro','minute','find','UTC','Winter','513007SHrFxb','hour','month','with','Equinox','extend','push','5saCQDS','trunc','millisecond','2083004CvZSTh','Vernal','map','776dVKPSl','vernal','day','microsecond','year','Autumnal','key','winter','Spring','1120137RUvhma','astronomy','South','second'];a0_0x1ed4=function(){return _0x4a0b75;};return a0_0x1ed4();}var ASTRO=enumify({'Vernal':'vernal','Summer':a0_0x42e3e2(0x105),'Autumnal':a0_0x42e3e2(0xfc),'Winter':a0_0x42e3e2(0xf0)}),{COMPASS,DURATIONS}=enums,key=a0_0x42e3e2(0x108),scope=a0_0x42e3e2(0xf3);function calculateAstroMoment(_0x38d0d8,_0x1ed8fd,_0x406ed7){const _0x33a78f=a0_0x42e3e2,_0x33dac7=(_0x38d0d8-0x7d0)/0x3e8;let _0x2543da;switch(_0x1ed8fd){case ASTRO[_0x33a78f(0xe7)]:_0x2543da=2451623.80984+365242.37404*_0x33dac7+0.05169*_0x33dac7*_0x33dac7;break;case ASTRO[_0x33a78f(0xf9)]:_0x2543da=2451716.56767+365241.62603*_0x33dac7+0.00325*_0x33dac7*_0x33dac7;break;case ASTRO[_0x33a78f(0xee)]:_0x2543da=2451810.21715+365242.01767*_0x33dac7-0.11575*_0x33dac7*_0x33dac7;break;case ASTRO[_0x33a78f(0x10c)]:_0x2543da=2451900.05952+365242.74049*_0x33dac7-0.06223*_0x33dac7*_0x33dac7;break;}const _0x33c968=Math[_0x33a78f(0x115)]((_0x2543da-2440587.5)*DURATIONS[_0x33a78f(0x107)]);return new Tempo(_0x33c968,{'timeZone':_0x406ed7,'timeStamp':'ms'});}function resolve(_0x2b9127,_0x36ffef){const _0x2ffbd3=a0_0x42e3e2,_0x390d49=_0x2b9127[_0x2ffbd3(0x101)][_0x2ffbd3(0x100)];if(!_0x390d49)return[];const _0x40dba6=_0x36ffef?.['yy']??_0x36ffef?.[_0x2ffbd3(0xed)]??_0x2b9127['yy'],_0x502bd7=_0x36ffef?.[_0x2ffbd3(0xfa)]??_0x2b9127['tz']??_0x2ffbd3(0x10b),_0x355d5b=[],_0x4b346a=_0x390d49===COMPASS[_0x2ffbd3(0xf4)]?{'vernal':_0x2ffbd3(0xee),'summer':_0x2ffbd3(0x10c),'autumnal':_0x2ffbd3(0xe7),'winter':'Summer'}:{'vernal':'Vernal','summer':'Summer','autumnal':_0x2ffbd3(0xee),'winter':_0x2ffbd3(0x10c)},_0x25465d=_0x390d49===COMPASS[_0x2ffbd3(0xf4)]?{'vernal':'Autumn','summer':_0x2ffbd3(0x10c),'autumnal':_0x2ffbd3(0xf1),'winter':_0x2ffbd3(0xf9)}:{'vernal':_0x2ffbd3(0xf1),'summer':_0x2ffbd3(0xf9),'autumnal':_0x2ffbd3(0x102),'winter':'Winter'};for(const _0x3ae3f4 of[_0x40dba6-0x1,_0x40dba6,_0x40dba6+0x1]){const _0x2bd504=(_0x2b3af0,_0x23bf2b)=>{const _0x2b75d1=_0x2ffbd3,_0x122c4a=calculateAstroMoment(_0x2b3af0,_0x23bf2b,_0x502bd7),_0x557f2f=_0x122c4a['toDateTime']();return{'year':_0x557f2f[_0x2b75d1(0xed)],'month':_0x557f2f[_0x2b75d1(0x10f)],'day':_0x557f2f[_0x2b75d1(0xeb)],'hour':_0x557f2f[_0x2b75d1(0x10e)],'minute':_0x557f2f[_0x2b75d1(0x109)],'second':_0x557f2f['second'],'millisecond':_0x557f2f[_0x2b75d1(0x116)],'microsecond':_0x557f2f[_0x2b75d1(0xec)],'nanosecond':_0x557f2f[_0x2b75d1(0xf6)]};};_0x355d5b[_0x2ffbd3(0x113)]({'key':_0x4b346a[_0x2ffbd3(0xea)],'season':_0x25465d[_0x2ffbd3(0xea)],'sphere':_0x390d49,..._0x2bd504(_0x3ae3f4,ASTRO[_0x2ffbd3(0xe7)]),'event':_0x2ffbd3(0x111),'group':'astronomy'}),_0x355d5b[_0x2ffbd3(0x113)]({'key':_0x4b346a[_0x2ffbd3(0x105)],'season':_0x25465d[_0x2ffbd3(0x105)],'sphere':_0x390d49,..._0x2bd504(_0x3ae3f4,ASTRO[_0x2ffbd3(0xf9)]),'event':'Solstice','group':_0x2ffbd3(0xf3)}),_0x355d5b['push']({'key':_0x4b346a[_0x2ffbd3(0xfc)],'season':_0x25465d['autumnal'],'sphere':_0x390d49,..._0x2bd504(_0x3ae3f4,ASTRO['Autumnal']),'event':'Equinox','group':_0x2ffbd3(0xf3)}),_0x355d5b[_0x2ffbd3(0x113)]({'key':_0x4b346a[_0x2ffbd3(0xf0)],'season':_0x25465d[_0x2ffbd3(0xf0)],'sphere':_0x390d49,..._0x2bd504(_0x3ae3f4,ASTRO[_0x2ffbd3(0x10c)]),'event':_0x2ffbd3(0xfd),'group':_0x2ffbd3(0xf3)});}return _0x355d5b;}function resolveDateBoundary(_0x129681,_0x3283c3){const _0x3a6692=a0_0x42e3e2,_0x1ba553=resolve(_0x129681,_0x3283c3);return _0x1ba553[_0x3a6692(0xe8)](_0x41c0c8=>({..._0x41c0c8,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x53c1ba){return resolve(this,_0x53c1ba);},'define'(_0x47a6f3,_0x9966fe){const _0x177c19=a0_0x42e3e2,_0x3fac2c=resolve(this,_0x9966fe),_0x4713c8=resolveDateBoundary(this,_0x9966fe),_0x43560b=_0x9966fe??this['toDateTime']();if(_0x47a6f3===!![]||_0x47a6f3===void 0x0){const _0x34f7ba=getTermRange(this,_0x4713c8,!![],_0x9966fe);return _0x34f7ba;}const _0x56330c=getTermRange(this,_0x3fac2c,![],_0x9966fe);if(!_0x56330c)return _0x56330c;const _0x452d1e=getTermRange(this,_0x4713c8,![],_0x9966fe);if(!_0x452d1e)return _0x56330c;const _0xfd640f=_0x3fac2c[_0x177c19(0x10a)](_0x222eb7=>_0x222eb7['key']===_0x452d1e['key']&&_0x222eb7[_0x177c19(0xed)]===_0x452d1e[_0x177c19(0xed)]&&_0x222eb7[_0x177c19(0x10f)]===_0x452d1e[_0x177c19(0x10f)]&&_0x222eb7['day']===_0x452d1e['day']);if(!_0xfd640f)return{..._0x452d1e,'strict':_0x56330c[_0x177c19(0xef)]};const _0x5a3a4e=_0x43560b[_0x177c19(0x110)]({'year':_0xfd640f[_0x177c19(0xed)],'month':_0xfd640f[_0x177c19(0x10f)],'day':_0xfd640f[_0x177c19(0xeb)],'hour':_0xfd640f[_0x177c19(0x10e)]??0x0,'minute':_0xfd640f[_0x177c19(0x109)]??0x0,'second':_0xfd640f[_0x177c19(0xf5)]??0x0,'millisecond':_0xfd640f[_0x177c19(0x116)]??0x0,'microsecond':_0xfd640f[_0x177c19(0xec)]??0x0,'nanosecond':_0xfd640f['nanosecond']??0x0})[_0x177c19(0x106)]({'minutes':0x1}),_0x4edf88=getTermRange(this,_0x3fac2c,![],_0x5a3a4e);if(!_0x4edf88)return{..._0x452d1e,'strict':_0x56330c[_0x177c19(0xef)]};return{..._0x4edf88,'strict':_0x56330c[_0x177c19(0xef)]};}});Tempo[a0_0x42e3e2(0x112)](AstroTerm);export{AstroTerm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmacomputing/tempo-plugin-astro",
3
- "version": "1.1.7",
3
+ "version": "2.0.0",
4
4
  "description": "Tempo plugin that calculates precise astronomical seasons (solstices & equinoxes) using the Jean Meeus algorithm — hemisphere-aware, sub-minute accuracy",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,18 +12,17 @@
12
12
  "LICENSE"
13
13
  ],
14
14
  "publishConfig": {
15
- "access": "public",
16
- "registry": "https://registry.npmjs.org/"
15
+ "registry": "https://registry.npmjs.org/",
16
+ "access": "public"
17
17
  },
18
18
  "scripts": {
19
19
  "build": "tsup src/index.ts --format esm --clean && tsc",
20
20
  "postbuild": "javascript-obfuscator dist/index.js --output dist/index.js",
21
21
  "test": "vitest run -c ../../test/vitest.premium.ts && vitest run -c ../../test/vitest.community.ts",
22
- "publish": "npm publish --access public",
23
22
  "prepublishOnly": "if [ $(git rev-parse --abbrev-ref HEAD) != main ]; then echo 'ERROR: Must be on main branch to publish.'; exit 1; fi && npm run build"
24
23
  },
25
24
  "peerDependencies": {
26
- "@magmacomputing/tempo": "3.0.3"
25
+ "@magmacomputing/tempo": "^3.5.1"
27
26
  },
28
27
  "tempo": {
29
28
  "vendorVariantId": "tempo-plugin-astro",