@sebbo2002/fitness-first-ical-proxy 5.0.0-develop.8 → 5.0.1-develop.1

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.
File without changes
File without changes
package/dist/bin/start.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as r,b as i}from"../chunk-O4KFVSQ5.js";import p from"express";var t=class n{static run(){new n}constructor(){this.app=p(),this.setupRoutes(),this.server=this.app.listen(process.env.PORT||8080),process.on("SIGINT",()=>this.stop()),process.on("SIGTERM",()=>this.stop())}setupRoutes(){this.app.get("/ping",(e,s)=>{s.send("pong")}),this.app.get("/ical",(e,s)=>{i.request(e.query).then(o=>{s.writeHead(200,{"Content-Type":"text/calendar; charset=utf-8","Content-Disposition":'attachment; filename="calendar.ics"'}),s.end(o.toString())})})}stop(){return r(this,null,function*(){yield new Promise(e=>this.server.close(e)),process.exit()})}};t.run();
2
+ import{a as r,b as i}from"../chunk-XBRWTV5R.js";import p from"express";var t=class n{static run(){new n}constructor(){this.app=p(),this.setupRoutes(),this.server=this.app.listen(process.env.PORT||8080),process.on("SIGINT",()=>this.stop()),process.on("SIGTERM",()=>this.stop())}setupRoutes(){this.app.get("/ping",(e,s)=>{s.send("pong")}),this.app.get("/ical",(e,s)=>{i.request(e.query).then(o=>{s.writeHead(200,{"Content-Type":"text/calendar; charset=utf-8","Content-Disposition":'attachment; filename="calendar.ics"'}),s.end(o.toString())})})}stop(){return r(this,null,function*(){yield new Promise(e=>this.server.close(e)),process.exit()})}};t.run();
3
3
  //# sourceMappingURL=start.js.map
@@ -1,2 +1,2 @@
1
1
  var m=(d,e,r)=>new Promise((c,i)=>{var s=o=>{try{t(r.next(o))}catch(a){i(a)}},n=o=>{try{t(r.throw(o))}catch(a){i(a)}},t=o=>o.done?c(o.value):Promise.resolve(o.value).then(s,n);t((r=r.apply(d,e)).next())});import l from"ical-generator";var f=class{static request(e){return m(this,null,function*(){let r=yield this.getCourses(e);return this.createCalendar(r)})}static getCourses(e){return m(this,null,function*(){let r="https://www.fitnessfirst.de/magicline/api/class-shedule/"+this.paramToString(e.club_id)+"/"+this.paramToString(e.category_id)+"/"+this.paramToString(e.class_id)+"/"+this.paramToString(e.daytime_id),i=yield(yield fetch(r)).json();return e.club_id==="96"&&(e.category_id==="aqua"||!e.category_id)&&Object.entries(i.classes).forEach(([s,n])=>{if(s.split("_",2)[1]==="sa"){let t={id:`kinderschwimmen-${s}`,title:"Kinderschwimmen",time:{from:"09:00:00",to:"12:15:00"},category:"Aqua",club:"Berlin - Gendarmenmarkt",url:"https://www.fitnessfirst.de/news/kinderschwimmen-1635593849"};Array.isArray(n)?i.classes[s]={before_noon:[t]}:(n.before_noon=n.before_noon||[],n.before_noon.push(t))}if(s.split("_",2)[1]==="th"){let t={id:`kinderschwimmen-${s}`,title:"Kinderschwimmen",time:{from:"15:00:00",to:"17:15:00"},category:"Aqua",club:"Berlin - Gendarmenmarkt",url:"https://www.fitnessfirst.de/news/kinderschwimmen-1635593849"};Array.isArray(n)?i.classes[s]={before_noon:[t]}:(n.before_noon=n.before_noon||[],n.before_noon.push(t))}}),i.classes})}static createCalendar(e){let r=l({name:"Fitness First",ttl:21600,prodId:{company:"sebbo.net",product:"fitness-first-ical-proxy"}});return Object.entries(e).forEach(([c,i])=>{let s=c.split("_")[0];(Array.isArray(i)?i:Object.values(i)).forEach(n=>{n.forEach(t=>{let o=new Date(s+"T"+t.time.from+"Z"),a=new Date(s+"T"+t.time.to+"Z");r.createEvent({id:t.id,start:o,end:a,floating:!0,summary:t.title,location:t.club,url:t.url})})})}),r}static paramToString(e){return typeof e=="string"?e:typeof e=="undefined"||e.length===0?"all":e.map(r=>r.toString()).join("-")}};export{m as a,f as b};
2
- //# sourceMappingURL=chunk-O4KFVSQ5.js.map
2
+ //# sourceMappingURL=chunk-XBRWTV5R.js.map
package/dist/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{b as a}from"../chunk-O4KFVSQ5.js";export{a as default};
1
+ import{b as a}from"../chunk-XBRWTV5R.js";export{a as default};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -18,13 +18,13 @@
18
18
  "@semantic-release/exec": "^6.0.3",
19
19
  "@semantic-release/git": "^10.0.1",
20
20
  "@semantic-release/npm": "^11.0.1",
21
- "@types/express": "^4.17.20",
22
- "@types/mocha": "^10.0.4",
23
- "@types/node": "^20.8.9",
24
- "@typescript-eslint/eslint-plugin": "^6.8.0",
25
- "@typescript-eslint/parser": "^6.8.0",
21
+ "@types/express": "^4.17.21",
22
+ "@types/mocha": "^10.0.6",
23
+ "@types/node": "^20.10.2",
24
+ "@typescript-eslint/eslint-plugin": "^6.13.1",
25
+ "@typescript-eslint/parser": "^6.13.1",
26
26
  "c8": "^8.0.1",
27
- "eslint": "^8.52.0",
27
+ "eslint": "^8.55.0",
28
28
  "eslint-plugin-jsonc": "^2.10.0",
29
29
  "esm": "^3.2.25",
30
30
  "license-checker": "^25.0.1",
@@ -34,9 +34,9 @@
34
34
  "semantic-release-license": "^1.0.3",
35
35
  "source-map-support": "^0.5.21",
36
36
  "ts-node": "^10.9.1",
37
- "tsup": "^7.2.0",
38
- "typedoc": "^0.25.3",
39
- "typescript": "^5.2.2"
37
+ "tsup": "^8.0.1",
38
+ "typedoc": "^0.25.4",
39
+ "typescript": "^5.3.2"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=18.0.0"
@@ -68,5 +68,5 @@
68
68
  "test": "mocha"
69
69
  },
70
70
  "type": "module",
71
- "version": "5.0.0-develop.8"
71
+ "version": "5.0.1-develop.1"
72
72
  }