@magmacomputing/tempo-plugin-astro 1.1.2 → 1.1.4

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
@@ -39,7 +39,7 @@ When resolving the term, the plugin intelligently returns the correct astronomic
39
39
  key: 'Vernal', // Flips to 'Autumnal' if sphere is set to 'south'
40
40
  season: 'Spring', // Flips to 'Autumn' if sphere is set to 'south'
41
41
  sphere: 'north', // Flips to 'south' if sphere is set to 'south'
42
- type: 'Equinox',
42
+ event: 'Equinox',
43
43
  group: 'astronomy',
44
44
  year: 2026,
45
45
  month: 3,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,25 @@
1
1
  import { Tempo } from '@magmacomputing/tempo/core';
2
+ declare module '@magmacomputing/tempo/core' {
3
+ interface TempoTermRegistry {
4
+ astro: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
5
+ astronomy: {
6
+ key: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
7
+ season: Tempo.SEASON;
8
+ sphere: Tempo.COMPASS;
9
+ event: 'Equinox' | 'Solstice';
10
+ group: 'astronomy';
11
+ year: number;
12
+ month: number;
13
+ day: number;
14
+ hour: number;
15
+ minute: number;
16
+ second: number;
17
+ millisecond: number;
18
+ microsecond: number;
19
+ nanosecond: number;
20
+ };
21
+ }
22
+ }
2
23
  /**
3
24
  * ## AstroTerm
4
25
  * Exposes precise astronomical calculations as a standard Tempo scope.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function a0_0x583b(_0x3268bb,_0xa9d3ae){_0x3268bb=_0x3268bb-0x8f;const _0x4650c9=a0_0x4650();let _0x583b71=_0x4650c9[_0x3268bb];return _0x583b71;}const a0_0x1b148d=a0_0x583b;(function(_0x5c0ba9,_0x539e80){const _0x49cdc5=a0_0x583b,_0x1132a8=_0x5c0ba9();while(!![]){try{const _0xcf48a0=parseInt(_0x49cdc5(0x9b))/0x1*(-parseInt(_0x49cdc5(0xb3))/0x2)+-parseInt(_0x49cdc5(0xb7))/0x3+parseInt(_0x49cdc5(0xa9))/0x4*(-parseInt(_0x49cdc5(0xad))/0x5)+-parseInt(_0x49cdc5(0x96))/0x6+-parseInt(_0x49cdc5(0xa4))/0x7+-parseInt(_0x49cdc5(0xb9))/0x8*(-parseInt(_0x49cdc5(0xa2))/0x9)+-parseInt(_0x49cdc5(0xba))/0xa*(-parseInt(_0x49cdc5(0x95))/0xb);if(_0xcf48a0===_0x539e80)break;else _0x1132a8['push'](_0x1132a8['shift']());}catch(_0x28685b){_0x1132a8['push'](_0x1132a8['shift']());}}}(a0_0x4650,0x577e6));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':a0_0x1b148d(0xa0),'Summer':'summer','Autumnal':a0_0x1b148d(0xaf),'Winter':a0_0x1b148d(0xb8)}),{COMPASS,SEASON,DURATIONS}=enums,key=a0_0x1b148d(0xb6),scope=a0_0x1b148d(0x98);function calculateAstroMoment(_0x11ad13,_0x373be8,_0x226c53){const _0x2197df=a0_0x1b148d,_0x48f208=(_0x11ad13-0x7d0)/0x3e8;let _0x4c0fdf;switch(_0x373be8){case ASTRO['Vernal']:_0x4c0fdf=2451623.80984+365242.37404*_0x48f208+0.05169*_0x48f208*_0x48f208;break;case ASTRO[_0x2197df(0x9f)]:_0x4c0fdf=2451716.56767+365241.62603*_0x48f208+0.00325*_0x48f208*_0x48f208;break;case ASTRO[_0x2197df(0x99)]:_0x4c0fdf=2451810.21715+365242.01767*_0x48f208-0.11575*_0x48f208*_0x48f208;break;case ASTRO['Winter']:_0x4c0fdf=2451900.05952+365242.74049*_0x48f208-0.06223*_0x48f208*_0x48f208;break;}const _0x3ad8c5=Math[_0x2197df(0xbc)]((_0x4c0fdf-2440587.5)*DURATIONS['days']);return new Tempo(_0x3ad8c5,{'timeZone':_0x226c53,'timeStamp':'ms'});}function resolve(_0x5d50f9,_0x1d1831){const _0x3620ab=a0_0x1b148d,_0x1fff07=_0x5d50f9['config'][_0x3620ab(0xb0)];if(!_0x1fff07)return[];const _0x35eb4d=_0x1d1831?.['yy']??_0x1d1831?.[_0x3620ab(0xbb)]??_0x5d50f9['yy'],_0x47a12f=_0x1d1831?.[_0x3620ab(0xaa)]??_0x5d50f9['tz']??_0x3620ab(0xa7),_0x18a571=[],_0x399f20=_0x1fff07===COMPASS[_0x3620ab(0xa1)]?{'vernal':'Autumnal','summer':_0x3620ab(0xae),'autumnal':_0x3620ab(0xa8),'winter':_0x3620ab(0x9f)}:{'vernal':_0x3620ab(0xa8),'summer':_0x3620ab(0x9f),'autumnal':'Autumnal','winter':_0x3620ab(0xae)},_0x429507=_0x1fff07===COMPASS['South']?{'vernal':SEASON['Autumn'],'summer':SEASON[_0x3620ab(0xae)],'autumnal':SEASON[_0x3620ab(0xb1)],'winter':SEASON[_0x3620ab(0x9f)]}:{'vernal':SEASON[_0x3620ab(0xb1)],'summer':SEASON[_0x3620ab(0x9f)],'autumnal':SEASON[_0x3620ab(0xb4)],'winter':SEASON[_0x3620ab(0xae)]};for(const _0x29e13b of[_0x35eb4d-0x1,_0x35eb4d,_0x35eb4d+0x1]){const _0x3cef41=(_0x28ce56,_0x554452)=>{const _0x4e1f57=_0x3620ab,_0x4e3076=calculateAstroMoment(_0x28ce56,_0x554452,_0x47a12f),_0x1b0c9a=_0x4e3076[_0x4e1f57(0xb5)]();return{'year':_0x1b0c9a[_0x4e1f57(0xbb)],'month':_0x1b0c9a['month'],'day':_0x1b0c9a[_0x4e1f57(0x94)],'hour':_0x1b0c9a[_0x4e1f57(0xa6)],'minute':_0x1b0c9a['minute'],'second':_0x1b0c9a['second'],'millisecond':_0x1b0c9a[_0x4e1f57(0x8f)],'microsecond':_0x1b0c9a[_0x4e1f57(0xab)],'nanosecond':_0x1b0c9a[_0x4e1f57(0x92)]};};_0x18a571[_0x3620ab(0x9c)]({'key':_0x399f20[_0x3620ab(0xa0)],'season':_0x429507[_0x3620ab(0xa0)],'sphere':_0x1fff07,..._0x3cef41(_0x29e13b,ASTRO['Vernal']),'type':'Equinox','group':_0x3620ab(0x98)}),_0x18a571[_0x3620ab(0x9c)]({'key':_0x399f20[_0x3620ab(0xb2)],'season':_0x429507[_0x3620ab(0xb2)],'sphere':_0x1fff07,..._0x3cef41(_0x29e13b,ASTRO[_0x3620ab(0x9f)]),'type':_0x3620ab(0xa5),'group':_0x3620ab(0x98)}),_0x18a571['push']({'key':_0x399f20['autumnal'],'season':_0x429507[_0x3620ab(0xaf)],'sphere':_0x1fff07,..._0x3cef41(_0x29e13b,ASTRO[_0x3620ab(0x99)]),'type':_0x3620ab(0x9e),'group':'astronomy'}),_0x18a571[_0x3620ab(0x9c)]({'key':_0x399f20[_0x3620ab(0xb8)],'season':_0x429507[_0x3620ab(0xb8)],'sphere':_0x1fff07,..._0x3cef41(_0x29e13b,ASTRO[_0x3620ab(0xae)]),'type':_0x3620ab(0xa5),'group':_0x3620ab(0x98)});}return _0x18a571;}function resolveDateBoundary(_0x3ea8d1,_0x17218f){const _0x587ca1=a0_0x1b148d,_0x28b5de=resolve(_0x3ea8d1,_0x17218f);return _0x28b5de[_0x587ca1(0x9d)](_0x19f135=>({..._0x19f135,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x2493e5){return resolve(this,_0x2493e5);},'define'(_0x199c53,_0xbffdb5){const _0x409613=a0_0x1b148d,_0x53a214=resolve(this,_0xbffdb5),_0x19a86b=resolveDateBoundary(this,_0xbffdb5),_0x1c5e64=_0xbffdb5??this[_0x409613(0xb5)]();if(_0x199c53===!![]||_0x199c53===void 0x0){const _0x4adadd=getTermRange(this,_0x19a86b,!![],_0xbffdb5);return _0x4adadd;}const _0x49b0dc=getTermRange(this,_0x53a214,![],_0xbffdb5);if(!_0x49b0dc)return _0x49b0dc;const _0x2f65bb=getTermRange(this,_0x19a86b,![],_0xbffdb5);if(!_0x2f65bb)return _0x49b0dc;const _0x1db9aa=_0x53a214[_0x409613(0x90)](_0x58902e=>_0x58902e[_0x409613(0x9a)]===_0x2f65bb['key']&&_0x58902e[_0x409613(0xbb)]===_0x2f65bb['year']&&_0x58902e['month']===_0x2f65bb[_0x409613(0xac)]&&_0x58902e[_0x409613(0x94)]===_0x2f65bb[_0x409613(0x94)]);if(!_0x1db9aa)return{..._0x2f65bb,'strict':_0x49b0dc[_0x409613(0x9a)]};const _0x4e2eeb=_0x1c5e64[_0x409613(0x91)]({'year':_0x1db9aa[_0x409613(0xbb)],'month':_0x1db9aa[_0x409613(0xac)],'day':_0x1db9aa[_0x409613(0x94)],'hour':_0x1db9aa[_0x409613(0xa6)]??0x0,'minute':_0x1db9aa[_0x409613(0x93)]??0x0,'second':_0x1db9aa[_0x409613(0xa3)]??0x0,'millisecond':_0x1db9aa[_0x409613(0x8f)]??0x0,'microsecond':_0x1db9aa[_0x409613(0xab)]??0x0,'nanosecond':_0x1db9aa[_0x409613(0x92)]??0x0})[_0x409613(0x97)]({'minutes':0x1}),_0x157fe9=getTermRange(this,_0x53a214,![],_0x4e2eeb);if(!_0x157fe9)return{..._0x2f65bb,'strict':_0x49b0dc[_0x409613(0x9a)]};return{..._0x157fe9,'strict':_0x49b0dc[_0x409613(0x9a)]};}});function a0_0x4650(){const _0x184e31=['hour','UTC','Vernal','4ovsXHP','timeZoneId','microsecond','month','108490xrmyIT','Winter','autumnal','sphere','Spring','summer','12WQZczK','Autumn','toDateTime','astro','112200CyimDd','winter','8DcrvNa','742090mTTqyO','year','trunc','millisecond','find','with','nanosecond','minute','day','121NSZHQC','304470KhLdZP','add','astronomy','Autumnal','key','59557Antwgo','push','map','Equinox','Summer','vernal','South','2406006usWKYq','second','1806518ZJEkFK','Solstice'];a0_0x4650=function(){return _0x184e31;};return a0_0x4650();}Tempo['extend'](AstroTerm);export{AstroTerm};
1
+ const a0_0x156bb5=a0_0x5924;(function(_0x44a49f,_0x3525f2){const _0x2ea014=a0_0x5924,_0x149a9f=_0x44a49f();while(!![]){try{const _0x4186e5=parseInt(_0x2ea014(0x1bc))/0x1+-parseInt(_0x2ea014(0x1d3))/0x2*(parseInt(_0x2ea014(0x1cd))/0x3)+parseInt(_0x2ea014(0x1d4))/0x4+parseInt(_0x2ea014(0x1b5))/0x5+parseInt(_0x2ea014(0x1c6))/0x6*(-parseInt(_0x2ea014(0x1b6))/0x7)+parseInt(_0x2ea014(0x1de))/0x8*(parseInt(_0x2ea014(0x1d1))/0x9)+parseInt(_0x2ea014(0x1d7))/0xa*(-parseInt(_0x2ea014(0x1bf))/0xb);if(_0x4186e5===_0x3525f2)break;else _0x149a9f['push'](_0x149a9f['shift']());}catch(_0x326041){_0x149a9f['push'](_0x149a9f['shift']());}}}(a0_0x3888,0x9aca2));import{Tempo,enums}from'@magmacomputing/tempo/core';import{getTermRange}from'@magmacomputing/tempo/term';function a0_0x3888(){const _0x58acde=['vernal','second','South','4762355WLfjAR','11571IXGggh','astronomy','year','winter','Vernal','minute','650647ayaawg','Autumn','hour','919105ARxOLL','Solstice','toDateTime','days','month','Spring','summer','948GOHxtV','Autumnal','millisecond','sphere','extend','config','microsecond','444zdeuVt','key','day','Equinox','117YLJHFs','Winter','4372XuDIeV','3968732HcgAaK','autumnal','timeZoneId','190Xhhwwa','astro','push','Summer','map','UTC','trunc','129824xCYJTV','nanosecond','find'];a0_0x3888=function(){return _0x58acde;};return a0_0x3888();}import{definePremiumTerm}from'@magmacomputing/tempo/plugin';import{enumify}from'@magmacomputing/tempo/library';var ASTRO=enumify({'Vernal':a0_0x156bb5(0x1b2),'Summer':a0_0x156bb5(0x1c5),'Autumnal':a0_0x156bb5(0x1d5),'Winter':a0_0x156bb5(0x1b9)}),{COMPASS,SEASON,DURATIONS}=enums,key=a0_0x156bb5(0x1d8),scope='astronomy';function calculateAstroMoment(_0x4d3666,_0x3622ee,_0x5856f8){const _0x379401=a0_0x156bb5,_0x3196fc=(_0x4d3666-0x7d0)/0x3e8;let _0x2d4eeb;switch(_0x3622ee){case ASTRO[_0x379401(0x1ba)]:_0x2d4eeb=2451623.80984+365242.37404*_0x3196fc+0.05169*_0x3196fc*_0x3196fc;break;case ASTRO[_0x379401(0x1da)]:_0x2d4eeb=2451716.56767+365241.62603*_0x3196fc+0.00325*_0x3196fc*_0x3196fc;break;case ASTRO['Autumnal']:_0x2d4eeb=2451810.21715+365242.01767*_0x3196fc-0.11575*_0x3196fc*_0x3196fc;break;case ASTRO[_0x379401(0x1d2)]:_0x2d4eeb=2451900.05952+365242.74049*_0x3196fc-0.06223*_0x3196fc*_0x3196fc;break;}const _0x5a8425=Math[_0x379401(0x1dd)]((_0x2d4eeb-2440587.5)*DURATIONS[_0x379401(0x1c2)]);return new Tempo(_0x5a8425,{'timeZone':_0x5856f8,'timeStamp':'ms'});}function resolve(_0x4f1347,_0x4531d3){const _0x2da391=a0_0x156bb5,_0x577fb=_0x4f1347[_0x2da391(0x1cb)][_0x2da391(0x1c9)];if(!_0x577fb)return[];const _0xe4bb39=_0x4531d3?.['yy']??_0x4531d3?.[_0x2da391(0x1b8)]??_0x4f1347['yy'],_0x1c9714=_0x4531d3?.[_0x2da391(0x1d6)]??_0x4f1347['tz']??_0x2da391(0x1dc),_0x16c714=[],_0x1d49b2=_0x577fb===COMPASS[_0x2da391(0x1b4)]?{'vernal':_0x2da391(0x1c7),'summer':_0x2da391(0x1d2),'autumnal':_0x2da391(0x1ba),'winter':_0x2da391(0x1da)}:{'vernal':_0x2da391(0x1ba),'summer':_0x2da391(0x1da),'autumnal':_0x2da391(0x1c7),'winter':_0x2da391(0x1d2)},_0x5e9ce4=_0x577fb===COMPASS[_0x2da391(0x1b4)]?{'vernal':SEASON[_0x2da391(0x1bd)],'summer':SEASON['Winter'],'autumnal':SEASON[_0x2da391(0x1c4)],'winter':SEASON['Summer']}:{'vernal':SEASON['Spring'],'summer':SEASON[_0x2da391(0x1da)],'autumnal':SEASON[_0x2da391(0x1bd)],'winter':SEASON[_0x2da391(0x1d2)]};for(const _0x1f1c29 of[_0xe4bb39-0x1,_0xe4bb39,_0xe4bb39+0x1]){const _0x526520=(_0x1333e0,_0x411157)=>{const _0x383baf=_0x2da391,_0x545df8=calculateAstroMoment(_0x1333e0,_0x411157,_0x1c9714),_0x4c8ac6=_0x545df8['toDateTime']();return{'year':_0x4c8ac6[_0x383baf(0x1b8)],'month':_0x4c8ac6['month'],'day':_0x4c8ac6[_0x383baf(0x1cf)],'hour':_0x4c8ac6[_0x383baf(0x1be)],'minute':_0x4c8ac6['minute'],'second':_0x4c8ac6[_0x383baf(0x1b3)],'millisecond':_0x4c8ac6[_0x383baf(0x1c8)],'microsecond':_0x4c8ac6[_0x383baf(0x1cc)],'nanosecond':_0x4c8ac6[_0x383baf(0x1b0)]};};_0x16c714['push']({'key':_0x1d49b2[_0x2da391(0x1b2)],'season':_0x5e9ce4[_0x2da391(0x1b2)],'sphere':_0x577fb,..._0x526520(_0x1f1c29,ASTRO['Vernal']),'event':_0x2da391(0x1d0),'group':_0x2da391(0x1b7)}),_0x16c714[_0x2da391(0x1d9)]({'key':_0x1d49b2['summer'],'season':_0x5e9ce4['summer'],'sphere':_0x577fb,..._0x526520(_0x1f1c29,ASTRO[_0x2da391(0x1da)]),'event':'Solstice','group':'astronomy'}),_0x16c714[_0x2da391(0x1d9)]({'key':_0x1d49b2[_0x2da391(0x1d5)],'season':_0x5e9ce4[_0x2da391(0x1d5)],'sphere':_0x577fb,..._0x526520(_0x1f1c29,ASTRO[_0x2da391(0x1c7)]),'event':'Equinox','group':_0x2da391(0x1b7)}),_0x16c714[_0x2da391(0x1d9)]({'key':_0x1d49b2[_0x2da391(0x1b9)],'season':_0x5e9ce4[_0x2da391(0x1b9)],'sphere':_0x577fb,..._0x526520(_0x1f1c29,ASTRO[_0x2da391(0x1d2)]),'event':_0x2da391(0x1c0),'group':_0x2da391(0x1b7)});}return _0x16c714;}function resolveDateBoundary(_0x27c6ab,_0x5f3cb0){const _0x3f3bfe=a0_0x156bb5,_0x533b69=resolve(_0x27c6ab,_0x5f3cb0);return _0x533b69[_0x3f3bfe(0x1db)](_0x482d46=>({..._0x482d46,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x1f5504){return resolve(this,_0x1f5504);},'define'(_0x1f0da3,_0x3d5a10){const _0x58ddba=a0_0x156bb5,_0x59a978=resolve(this,_0x3d5a10),_0x2e7b72=resolveDateBoundary(this,_0x3d5a10),_0x4477f9=_0x3d5a10??this[_0x58ddba(0x1c1)]();if(_0x1f0da3===!![]||_0x1f0da3===void 0x0){const _0x482ccf=getTermRange(this,_0x2e7b72,!![],_0x3d5a10);return _0x482ccf;}const _0x4fe544=getTermRange(this,_0x59a978,![],_0x3d5a10);if(!_0x4fe544)return _0x4fe544;const _0x255220=getTermRange(this,_0x2e7b72,![],_0x3d5a10);if(!_0x255220)return _0x4fe544;const _0x5424e4=_0x59a978[_0x58ddba(0x1b1)](_0x5b5172=>_0x5b5172[_0x58ddba(0x1ce)]===_0x255220[_0x58ddba(0x1ce)]&&_0x5b5172[_0x58ddba(0x1b8)]===_0x255220[_0x58ddba(0x1b8)]&&_0x5b5172[_0x58ddba(0x1c3)]===_0x255220[_0x58ddba(0x1c3)]&&_0x5b5172[_0x58ddba(0x1cf)]===_0x255220['day']);if(!_0x5424e4)return{..._0x255220,'strict':_0x4fe544['key']};const _0x119779=_0x4477f9['with']({'year':_0x5424e4[_0x58ddba(0x1b8)],'month':_0x5424e4[_0x58ddba(0x1c3)],'day':_0x5424e4['day'],'hour':_0x5424e4[_0x58ddba(0x1be)]??0x0,'minute':_0x5424e4[_0x58ddba(0x1bb)]??0x0,'second':_0x5424e4[_0x58ddba(0x1b3)]??0x0,'millisecond':_0x5424e4[_0x58ddba(0x1c8)]??0x0,'microsecond':_0x5424e4[_0x58ddba(0x1cc)]??0x0,'nanosecond':_0x5424e4['nanosecond']??0x0})['add']({'minutes':0x1}),_0x50b299=getTermRange(this,_0x59a978,![],_0x119779);if(!_0x50b299)return{..._0x255220,'strict':_0x4fe544[_0x58ddba(0x1ce)]};return{..._0x50b299,'strict':_0x4fe544['key']};}});Tempo[a0_0x156bb5(0x1ca)](AstroTerm);function a0_0x5924(_0x1ec4c8,_0xf7a27d){_0x1ec4c8=_0x1ec4c8-0x1b0;const _0x388883=a0_0x3888();let _0x5924b7=_0x388883[_0x1ec4c8];return _0x5924b7;}export{AstroTerm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmacomputing/tempo-plugin-astro",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
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",
@@ -15,7 +15,7 @@
15
15
  "scripts": {
16
16
  "build": "tsup src/index.ts --format esm --clean && tsc",
17
17
  "postbuild": "javascript-obfuscator dist/index.js --output dist/index.js",
18
- "test": "vitest run -c ../../vitest.premium.ts && vitest run -c ../../vitest.community.ts",
18
+ "test": "vitest run -c ../../test/vitest.premium.ts && vitest run -c ../../test/vitest.community.ts",
19
19
  "publish": "npm publish --access public",
20
20
  "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"
21
21
  },