@koma-app/core 0.1.0 → 0.1.2

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/agenda.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { type FormatOptions } from "./format";
2
- import type { AgendaCourse } from "./types";
1
+ import { type FormatOptions } from "./format.js";
2
+ import type { AgendaCourse } from "./types.js";
3
3
  export type DayRelative = "today" | "tomorrow" | null;
4
4
  export type DayGroup<C extends {
5
5
  startsAt: string;
package/dist/agenda.js CHANGED
@@ -1,4 +1,4 @@
1
- import { dayKey, formatDayHeading } from "./format";
1
+ import { dayKey, formatDayHeading } from "./format.js";
2
2
  /** Groupe des cours (déjà triés par date) par jour civil du studio, avec repères Aujourd'hui / Demain. */
3
3
  export function groupByDay(courses, opts = {}) {
4
4
  const now = opts.now ?? new Date();
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";
1
+ import type { AccountSummary, AgendaCourse, CancellationResult, CardProduct, CheckoutIdentity, ClientInfo, CreditPaymentResult, PaymentIntentInfo, PublicCourse, Studio, TrialEligibility } 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;
package/dist/client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { KomaApiError, errorFromResponse } from "./errors";
1
+ import { KomaApiError, errorFromResponse } from "./errors.js";
2
2
  /** Client HTTP typé du storefront Koma. Chaque méthode rejette avec une `KomaApiError` en cas d'échec. */
3
3
  export function createKomaClient(options = {}) {
4
4
  const baseUrl = (options.baseUrl ?? "/api/v1").replace(/\/$/, "");
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./types";
2
- export { KomaApiError, DEFAULT_ERROR_MESSAGE } from "./errors";
3
- export { createKomaClient, type KomaClient, type KomaClientOptions } from "./client";
4
- export * from "./format";
5
- export * from "./agenda";
6
- export * from "./storage";
7
- export * from "./calendar";
8
- export * from "./seo";
1
+ export * from "./types.js";
2
+ export { KomaApiError, DEFAULT_ERROR_MESSAGE } from "./errors.js";
3
+ export { createKomaClient, type KomaClient, type KomaClientOptions } from "./client.js";
4
+ export * from "./format.js";
5
+ export * from "./agenda.js";
6
+ export * from "./storage.js";
7
+ export * from "./calendar.js";
8
+ export * from "./seo.js";
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./types";
2
- export { KomaApiError, DEFAULT_ERROR_MESSAGE } from "./errors";
3
- export { createKomaClient } from "./client";
4
- export * from "./format";
5
- export * from "./agenda";
6
- export * from "./storage";
7
- export * from "./calendar";
8
- export * from "./seo";
1
+ export * from "./types.js";
2
+ export { KomaApiError, DEFAULT_ERROR_MESSAGE } from "./errors.js";
3
+ export { createKomaClient } from "./client.js";
4
+ export * from "./format.js";
5
+ export * from "./agenda.js";
6
+ export * from "./storage.js";
7
+ export * from "./calendar.js";
8
+ export * from "./seo.js";
package/dist/seo.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AgendaCourse } from "./types";
1
+ import type { AgendaCourse } from "./types.js";
2
2
  export type JsonLdOptions = {
3
3
  /** URL publique de la page d'un cours (ex. `slug => https://www.mon-studio.fr/cours/${slug}`). */
4
4
  courseUrl: (slug: string) => string;
package/dist/storage.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CheckoutIdentity } from "./types";
1
+ import type { CheckoutIdentity } from "./types.js";
2
2
  type StorageLike = Pick<Storage, "getItem" | "setItem" | "removeItem">;
3
3
  /** Nom et email mémorisés pour pré-remplir les prochains achats (localStorage). */
4
4
  export declare function loadSavedIdentity(store?: StorageLike | null): CheckoutIdentity;
package/dist/types.d.ts CHANGED
@@ -32,6 +32,8 @@ export type AgendaCourse = {
32
32
  };
33
33
  export type MyReservation = {
34
34
  createdAt: string;
35
+ /** Moyen de paiement de la résa. « credit » : l'annulation dans le délai est immédiate (API ≥ 04/10/2026). */
36
+ paymentMethod?: "onsite" | "card" | "credit";
35
37
  cancellationRequestedAt: string | null;
36
38
  };
37
39
  export type MyCredits = {
@@ -102,7 +104,16 @@ export type CreditPaymentResult = {
102
104
  creditsLeft: number;
103
105
  nextExpiresAt: string | null;
104
106
  };
107
+ /** `cancelled: true` : résa par crédit annulée tout de suite, crédit rendu. Sinon, demande transmise au studio. */
105
108
  export type CancellationResult = {
106
109
  success: true;
110
+ cancelled: true;
111
+ recredit: {
112
+ extended: boolean;
113
+ expiresAt: string;
114
+ } | null;
115
+ } | {
116
+ success: true;
117
+ cancelled?: false;
107
118
  cancellationRequestedAt: string;
108
119
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koma-app/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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>",
@@ -24,7 +24,8 @@
24
24
  ".": {
25
25
  "types": "./dist/index.d.ts",
26
26
  "import": "./dist/index.js"
27
- }
27
+ },
28
+ "./package.json": "./package.json"
28
29
  },
29
30
  "files": [
30
31
  "dist",