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

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Sebastian Pekarek
3
+ Copyright (c) 2024 Sebastian Pekarek
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
6
  documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
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
@@ -8,24 +8,24 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "express": "^4.18.2",
11
- "ical-generator": "^6.0.0"
11
+ "ical-generator": "^6.0.1"
12
12
  },
13
13
  "description": "Small proxy that provides the course schedule from fitnessfirst.de/kurse as an iCal calendar.",
14
14
  "devDependencies": {
15
- "@qiwi/semantic-release-gh-pages-plugin": "^5.2.10",
15
+ "@qiwi/semantic-release-gh-pages-plugin": "^5.2.12",
16
16
  "@sebbo2002/semantic-release-docker": "^4.0.2",
17
17
  "@semantic-release/changelog": "^6.0.3",
18
18
  "@semantic-release/exec": "^6.0.3",
19
19
  "@semantic-release/git": "^10.0.1",
20
- "@semantic-release/npm": "^11.0.1",
20
+ "@semantic-release/npm": "^11.0.2",
21
21
  "@types/express": "^4.17.21",
22
- "@types/mocha": "^10.0.4",
23
- "@types/node": "^20.8.9",
24
- "@typescript-eslint/eslint-plugin": "^6.10.0",
25
- "@typescript-eslint/parser": "^6.10.0",
26
- "c8": "^8.0.1",
27
- "eslint": "^8.53.0",
28
- "eslint-plugin-jsonc": "^2.10.0",
22
+ "@types/mocha": "^10.0.6",
23
+ "@types/node": "^20.11.5",
24
+ "@typescript-eslint/eslint-plugin": "^6.18.1",
25
+ "@typescript-eslint/parser": "^6.18.1",
26
+ "c8": "^9.1.0",
27
+ "eslint": "^8.56.0",
28
+ "eslint-plugin-jsonc": "^2.13.0",
29
29
  "esm": "^3.2.25",
30
30
  "license-checker": "^25.0.1",
31
31
  "mocha": "^10.2.0",
@@ -33,10 +33,10 @@
33
33
  "nyc": "^15.1.0",
34
34
  "semantic-release-license": "^1.0.3",
35
35
  "source-map-support": "^0.5.21",
36
- "ts-node": "^10.9.1",
37
- "tsup": "^7.2.0",
38
- "typedoc": "^0.25.3",
39
- "typescript": "^5.2.2"
36
+ "ts-node": "^10.9.2",
37
+ "tsup": "^8.0.1",
38
+ "typedoc": "^0.25.7",
39
+ "typescript": "^5.3.3"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=18.0.0"
@@ -61,12 +61,12 @@
61
61
  "build": "tsup && cp ./dist/lib/index.d.ts ./dist/lib/index.d.cts",
62
62
  "build-all": "./.github/workflows/build.sh",
63
63
  "coverage": "c8 mocha",
64
- "develop": "ts-node ./src/bin/start.ts",
64
+ "develop": "TS_NODE_TRANSPILE_ONLY=true node --no-warnings --enable-source-maps --loader ts-node/esm src/bin/start.ts",
65
65
  "license-check": "license-checker --production --summary",
66
66
  "lint": "eslint . --ext .ts,.json",
67
67
  "start": "node ./dist/bin/start.js",
68
68
  "test": "mocha"
69
69
  },
70
70
  "type": "module",
71
- "version": "5.0.0"
71
+ "version": "5.0.1-develop.10"
72
72
  }