@koma-app/core 0.1.2 → 0.1.3

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/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AccountSummary, AgendaCourse, CancellationResult, CardProduct, CheckoutIdentity, ClientInfo, CreditPaymentResult, PaymentIntentInfo, PublicCourse, Studio, TrialEligibility } from "./types.js";
1
+ import type { AccountSummary, AgendaCourse, CancellationResult, CardProduct, CheckoutIdentity, ClientInfo, CreditPaymentResult, PaymentIntentInfo, PublicCourse, Studio, TrialEligibility, WaitlistJoinResult } from "./types.js";
2
2
  export type KomaClientOptions = {
3
3
  /** Préfixe des routes storefront. Défaut `/api/v1` (site proxifié en même origine, cookie de session). */
4
4
  baseUrl?: string;
@@ -48,6 +48,12 @@ export declare function createKomaClient(options?: KomaClientOptions): {
48
48
  payWithCredit: (slug: string, name?: string) => Promise<CreditPaymentResult>;
49
49
  /** Demande d'annulation (session requise) ; le studio finalise depuis le BO. */
50
50
  requestCancellation: (slug: string) => Promise<CancellationResult>;
51
+ /** Rejoint la liste d'attente d'un cours complet (session + crédit valable requis ; rien n'est débité avant l'inscription). */
52
+ joinWaitlist: (slug: string, name?: string) => Promise<WaitlistJoinResult>;
53
+ /** Quitte la liste d'attente. */
54
+ leaveWaitlist: (slug: string) => Promise<{
55
+ success: true;
56
+ }>;
51
57
  contact: (data: {
52
58
  name: string;
53
59
  email: string;
package/dist/client.js CHANGED
@@ -68,6 +68,10 @@ export function createKomaClient(options = {}) {
68
68
  payWithCredit: (slug, name) => post("/pay/credit", name ? { slug, name } : { slug }),
69
69
  /** Demande d'annulation (session requise) ; le studio finalise depuis le BO. */
70
70
  requestCancellation: (slug) => post(`/courses/${enc(slug)}/cancel`),
71
+ /** Rejoint la liste d'attente d'un cours complet (session + crédit valable requis ; rien n'est débité avant l'inscription). */
72
+ joinWaitlist: (slug, name) => post(`/courses/${enc(slug)}/waitlist`, name ? { name } : {}),
73
+ /** Quitte la liste d'attente. */
74
+ leaveWaitlist: (slug) => request("DELETE", `/courses/${enc(slug)}/waitlist`),
71
75
  contact: (data) => post("/contact", data),
72
76
  };
73
77
  }
package/dist/types.d.ts CHANGED
@@ -28,7 +28,11 @@ export type AgendaCourse = {
28
28
  createdAt: string;
29
29
  spotsLeft: number;
30
30
  full: boolean;
31
+ /** Liste d'attente possible si le cours est complet (API ≥ 13/10/2026). Le nombre en attente n'est jamais public. */
32
+ waitlistOpen?: boolean;
31
33
  myRegistered: boolean;
34
+ /** Sa position sur la liste d'attente (1 = la prochaine place), null si absente de la liste (API ≥ 13/10/2026). */
35
+ myWaitlistPosition?: number | null;
32
36
  };
33
37
  export type MyReservation = {
34
38
  createdAt: string;
@@ -80,10 +84,25 @@ export type AccountReservation = {
80
84
  paymentMethod: PaymentMethod;
81
85
  cancellationRequestedAt: string | null;
82
86
  };
87
+ /** Liste d'attente du compte connecté : la position seulement (API ≥ 13/10/2026). */
88
+ export type AccountWaitlistEntry = {
89
+ courseSlug: string;
90
+ courseKind: string;
91
+ courseTitle: string;
92
+ startsAt: string;
93
+ endsAt: string | null;
94
+ locationName: string;
95
+ position: number;
96
+ };
83
97
  export type AccountSummary = {
84
98
  email: string;
85
99
  cards: AccountCard[];
86
100
  reservations: AccountReservation[];
101
+ waitlist?: AccountWaitlistEntry[];
102
+ };
103
+ export type WaitlistJoinResult = {
104
+ success: true;
105
+ position: number;
87
106
  };
88
107
  /** Identité saisie au paiement : un seul champ « Prénom et nom » + email (décision du 26/09). */
89
108
  export type CheckoutIdentity = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koma-app/core",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Client typé, types et formateurs du storefront Koma — sans React.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Koma <contact@koma-app.fr>",