@portaki/module-ical-sync 0.1.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 +17 -0
- package/package.json +28 -0
- package/portaki.module.json +73 -0
- package/src/index.tsx +41 -0
- package/tsconfig.json +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @portaki/module-ical-sync
|
|
2
|
+
|
|
3
|
+
Module **hôte** : synchronisation de flux iCal (lien d’export Airbnb, Booking, etc.).
|
|
4
|
+
La logique de fetch et d’analyse vit dans **portaki-api** ; ce paquet expose le manifest npm et un panneau `renderHost` optionnel.
|
|
5
|
+
|
|
6
|
+
## Portaki
|
|
7
|
+
|
|
8
|
+
- Activer le module au niveau **Organisation → Modules**.
|
|
9
|
+
- Par logement : **Modules** → flux JSON → **Synchroniser** (API `POST .../modules/ical-sync/sync`).
|
|
10
|
+
|
|
11
|
+
## Développement
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Voir `portaki.module.json` pour la fiche catalogue.
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@portaki/module-ical-sync",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Portaki host module — iCal / Airbnb calendar sync",
|
|
5
|
+
"license": "AGPL-3.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./src/index.tsx",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"lint": "echo \"no lint yet\""
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@portaki/module-sdk": "workspace:*",
|
|
13
|
+
"react": "^19.1.0",
|
|
14
|
+
"react-dom": "^19.1.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/react": "^19",
|
|
18
|
+
"typescript": "^5"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/PortakiApp/portaki-sdk.git",
|
|
23
|
+
"directory": "packages/ical-sync"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../schema/module.v1.json",
|
|
3
|
+
"id": "ical-sync",
|
|
4
|
+
"name": {
|
|
5
|
+
"fr": "Calendriers (iCal / Airbnb)",
|
|
6
|
+
"en": "Calendars (iCal / Airbnb)"
|
|
7
|
+
},
|
|
8
|
+
"description": {
|
|
9
|
+
"fr": "Synchronisez des flux iCal publics (Airbnb, etc.) côté hôte.",
|
|
10
|
+
"en": "Sync public iCal feeds (Airbnb, etc.) on the host side."
|
|
11
|
+
},
|
|
12
|
+
"details": {
|
|
13
|
+
"fr": "Collez l’URL d’export .ics (Airbnb : Calendrier → Exporter). Portaki télécharge le fichier, compte les évènements et met à jour un résumé dans la configuration du module.",
|
|
14
|
+
"en": "Paste the .ics export URL (Airbnb: Calendar → Export). Portaki downloads the file, counts events, and updates a summary in the module config."
|
|
15
|
+
},
|
|
16
|
+
"examples": [
|
|
17
|
+
{
|
|
18
|
+
"title": { "fr": "Export Airbnb", "en": "Airbnb export" },
|
|
19
|
+
"description": {
|
|
20
|
+
"fr": "Utilisez le lien secret fourni par Airbnb ; ne le partagez pas publiquement.",
|
|
21
|
+
"en": "Use the secret link from Airbnb; do not share it publicly."
|
|
22
|
+
},
|
|
23
|
+
"link": "https://github.com/PortakiApp/portaki-sdk/tree/develop/packages/ical-sync"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"version": "1.0.0",
|
|
27
|
+
"author": {
|
|
28
|
+
"name": "Portaki",
|
|
29
|
+
"url": "https://portaki.app",
|
|
30
|
+
"type": "official"
|
|
31
|
+
},
|
|
32
|
+
"icon": "calendar-range",
|
|
33
|
+
"type": "official",
|
|
34
|
+
"tags": ["ical", "airbnb", "calendar", "host"],
|
|
35
|
+
"portakiVersionMin": "1.0.0",
|
|
36
|
+
"license": "AGPL-3.0",
|
|
37
|
+
"repository": "https://github.com/PortakiApp/portaki-sdk",
|
|
38
|
+
"screenshots": [],
|
|
39
|
+
"config": {
|
|
40
|
+
"defaults": {},
|
|
41
|
+
"globalAlert": {
|
|
42
|
+
"type": "info",
|
|
43
|
+
"message": {
|
|
44
|
+
"fr": "Module réservé à l’espace hôte : invisible pour les voyageurs.",
|
|
45
|
+
"en": "Host-only module: not shown to guests."
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"fields": [
|
|
49
|
+
{
|
|
50
|
+
"key": "feeds_json",
|
|
51
|
+
"label": { "fr": "Flux iCal (JSON)", "en": "iCal feeds (JSON)" },
|
|
52
|
+
"description": {
|
|
53
|
+
"fr": "Ex. [{\"id\":\"airbnb\",\"url\":\"https://www.airbnb.com/calendar/ical/….ics\"}]",
|
|
54
|
+
"en": "e.g. [{\"id\":\"airbnb\",\"url\":\"https://www.airbnb.com/calendar/ical/….ics\"}]"
|
|
55
|
+
},
|
|
56
|
+
"type": "textarea",
|
|
57
|
+
"required": true
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"catalog": {
|
|
62
|
+
"tagline": {
|
|
63
|
+
"fr": "Synchronisez Airbnb et autres flux .ics.",
|
|
64
|
+
"en": "Sync Airbnb and other .ics feeds."
|
|
65
|
+
},
|
|
66
|
+
"highlights": [
|
|
67
|
+
{ "fr": "Hôte uniquement", "en": "Host only" },
|
|
68
|
+
{ "fr": "API Portaki", "en": "Portaki API" }
|
|
69
|
+
],
|
|
70
|
+
"npmPackage": "@portaki/module-ical-sync",
|
|
71
|
+
"npmUrl": "https://www.npmjs.com/package/@portaki/module-ical-sync"
|
|
72
|
+
}
|
|
73
|
+
}
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import type { HostModuleContext } from '@portaki/module-sdk'
|
|
4
|
+
import { hostModule } from '@portaki/module-sdk'
|
|
5
|
+
|
|
6
|
+
function IcalHostBody({ ctx }: { ctx: HostModuleContext }) {
|
|
7
|
+
const summary = String(ctx.config.sync_summary ?? '').trim()
|
|
8
|
+
return (
|
|
9
|
+
<section data-module="ical-sync" className="space-y-3 text-sm">
|
|
10
|
+
<h2 className="text-base font-semibold">
|
|
11
|
+
{ctx.lang === 'fr' ? 'Calendriers' : 'Calendars'}
|
|
12
|
+
</h2>
|
|
13
|
+
<p className="leading-relaxed opacity-90">
|
|
14
|
+
{ctx.lang === 'fr'
|
|
15
|
+
? 'Configurez les flux dans Portaki (logement → modules), puis lancez la synchronisation pour mettre à jour ce résumé.'
|
|
16
|
+
: 'Configure feeds in Portaki (property → modules), then run sync to refresh this summary.'}
|
|
17
|
+
</p>
|
|
18
|
+
{summary ? (
|
|
19
|
+
<pre className="max-h-48 overflow-auto whitespace-pre-wrap rounded-lg border border-black/10 bg-black/[0.02] p-3 text-[11px] leading-snug dark:border-white/10 dark:bg-white/[0.03]">
|
|
20
|
+
{summary}
|
|
21
|
+
</pre>
|
|
22
|
+
) : (
|
|
23
|
+
<p className="text-[12px] opacity-70">
|
|
24
|
+
{ctx.lang === 'fr' ? 'Aucune synchronisation pour l’instant.' : 'No sync yet.'}
|
|
25
|
+
</p>
|
|
26
|
+
)}
|
|
27
|
+
</section>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default hostModule('ical-sync')
|
|
32
|
+
.label('Calendriers (iCal / Airbnb)', 'Calendars (iCal / Airbnb)')
|
|
33
|
+
.description(
|
|
34
|
+
'Synchronisation des flux iCal (Airbnb, etc.) pour le suivi interne.',
|
|
35
|
+
'iCal feed sync (Airbnb, etc.) for internal tracking.',
|
|
36
|
+
)
|
|
37
|
+
.icon('calendar-range')
|
|
38
|
+
.version('1.0.0')
|
|
39
|
+
.navSlot('section')
|
|
40
|
+
.hostRender((ctx) => <IcalHostBody ctx={ctx} />)
|
|
41
|
+
.build()
|