@composable-os/pack-memberships 0.1.0-beta.11 → 0.1.0-beta.14

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.
@@ -1,4 +1,4 @@
1
- import { type ClientHolding, type PackClient } from "@composable-os/client";
1
+ import { type ClientHolding, formatMinor, type PackClient, type UseMutation, type UseQuery } from "@composable-os/client";
2
2
  import type { z } from "@composable-os/sdk";
3
3
  import type { buy, givePass, holdings, mine, passTypes, plans, voidPass } from "../tools.ts";
4
4
  type Io<T extends {
@@ -11,6 +11,7 @@ type Io<T extends {
11
11
  export declare const PLAN = "memberships.plan";
12
12
  export declare const MEMBERSHIP = "memberships.membership";
13
13
  export declare const PASS = "memberships.pass";
14
+ export declare const PASSTYPE = "memberships.passtype";
14
15
  /** A subscription as its payer reads it (`subscription.list`, stage 32a). */
15
16
  export interface MembershipSubscription {
16
17
  id: string;
@@ -52,6 +53,56 @@ export interface SubscriptionChange {
52
53
  /** What came of ending a pause early: refused or unknown, staff ask again. */
53
54
  endOutcome?: "sent" | "pending" | "unknown" | "refused" | null;
54
55
  }
56
+ /** Why cooling off is not offered (`subscription.coolingOff`'s `why`). */
57
+ export type NotOffered = "not_covered" | "off" | "continuation" | "ended" | "window_passed" | "used" | "nothing_paid";
58
+ /** Whether a subscription may be cooled off, as the host says (stage 44 step 7, ADR 0647). */
59
+ export interface CoolingOffStatus {
60
+ subscriptionId: string;
61
+ /** The host says the payer may end it now for a full refund: the only reason to show the button. */
62
+ offered: boolean;
63
+ why: NotOffered | null;
64
+ days: number;
65
+ /** The last day of the window, `YYYY-MM-DD` in the business's time zone. */
66
+ until: string | null;
67
+ endsAt: string | null;
68
+ /** Paid and not refunded, in minor units. */
69
+ refund: number;
70
+ currency: string;
71
+ coolOff: {
72
+ state: "asked" | "ended" | "lapsed";
73
+ asked: "sent" | "pending" | "unknown" | "refused" | null;
74
+ askedBy: "payer" | "staff";
75
+ askedAt: string;
76
+ /** Open until then; if nothing ended by it, it lapses and the ordinary cancel works. */
77
+ deadline: string;
78
+ endedAt: string | null;
79
+ finished: boolean;
80
+ /** Staff asked to finish a lapsed one, not yet confirmed by the payment provider. */
81
+ finishing: "asked" | "sent" | "pending" | "unknown" | "stuck" | null;
82
+ /** A cancel of it waits for a person at the payments gatekeeper: nobody may ask again. */
83
+ waiting: boolean;
84
+ lapsedBecause: "deadline" | "action" | "end_time" | "used" | null;
85
+ /** The host says this caller may ask the provider again now. */
86
+ askAgain: boolean;
87
+ /** Under way: the ordinary cancel waits. */
88
+ open: boolean;
89
+ /** Admins were told it is stuck. */
90
+ staffTold: boolean;
91
+ /** What it owes back (owed, once ended), and what has been refunded of that. */
92
+ paid: number;
93
+ refunded: number;
94
+ refunds: "waiting" | "refunded" | "held" | null;
95
+ } | null;
96
+ }
97
+ /** What subscription.coolOff answers. */
98
+ export interface CooledOff {
99
+ id: string;
100
+ /** lapsed: staff asked to finish one, not yet confirmed. */
101
+ state: "asked" | "ended" | "lapsed";
102
+ asked: "sent" | "pending" | "unknown" | null;
103
+ refund: number;
104
+ currency: string;
105
+ }
55
106
  /** What subscription.change answers. */
56
107
  export interface RequestedChange {
57
108
  id: string;
@@ -100,6 +151,42 @@ export type MembershipsOperations = {
100
151
  "x.memberships.voidPass": {
101
152
  kind: "mutation";
102
153
  } & Io<typeof voidPass>;
154
+ "me.family": {
155
+ kind: "query";
156
+ input: Record<string, never>;
157
+ output: {
158
+ self: {
159
+ personId: string;
160
+ name: string;
161
+ };
162
+ dependants: {
163
+ personId: string;
164
+ name: string;
165
+ }[];
166
+ guardians: {
167
+ personId: string;
168
+ name: string;
169
+ }[];
170
+ };
171
+ };
172
+ "record.list": {
173
+ kind: "query";
174
+ input: {
175
+ object: string;
176
+ sort?: {
177
+ field: string;
178
+ direction?: "asc" | "desc";
179
+ };
180
+ limit?: number;
181
+ };
182
+ output: {
183
+ items: {
184
+ id: string;
185
+ values: Record<string, unknown>;
186
+ }[];
187
+ nextCursor: string | null;
188
+ };
189
+ };
103
190
  "order.checkout": {
104
191
  kind: "mutation";
105
192
  input: {
@@ -121,6 +208,11 @@ export type MembershipsOperations = {
121
208
  returnUrl: string;
122
209
  email?: string;
123
210
  offerId?: string;
211
+ /**
212
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
213
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
214
+ */
215
+ agreements?: Record<string, unknown>[];
124
216
  };
125
217
  output: StartedSubscription;
126
218
  };
@@ -174,6 +266,22 @@ export type MembershipsOperations = {
174
266
  };
175
267
  output: RequestedChange;
176
268
  };
269
+ "subscription.coolingOff": {
270
+ kind: "query";
271
+ input: {
272
+ ids: string[];
273
+ };
274
+ output: {
275
+ items: CoolingOffStatus[];
276
+ };
277
+ };
278
+ "subscription.coolOff": {
279
+ kind: "mutation";
280
+ input: {
281
+ id: string;
282
+ };
283
+ output: CooledOff;
284
+ };
177
285
  "subscription.pause": {
178
286
  kind: "mutation";
179
287
  input: {
@@ -243,6 +351,36 @@ export declare const canChangePlan: (sub: MembershipSubscription) => boolean;
243
351
  export declare function changeRefusalWords(details: {
244
352
  rule?: unknown;
245
353
  } | undefined): string;
354
+ /** A price in minor units as the host gave it (`1999` AUD is `$19.99`). Display only. */
355
+ export { formatMinor };
356
+ /** A `YYYY-MM-DD` day as a reader sees it (`3 Dec 2026`), never shifted by the reader's zone. */
357
+ export declare function localDay(date: string | null | undefined): string;
358
+ /**
359
+ * The words beside the cancel button while the host offers cooling off: "You can cancel for a
360
+ * full refund until 3 Dec 2026". Null when it is not offered. Display only: the window is the
361
+ * host's (`subscription.coolingOff`), never worked out here.
362
+ */
363
+ export declare function coolingOffWords(status: CoolingOffStatus | undefined): string | null;
364
+ /**
365
+ * Why a member who might have expected it cannot cool off, in words: the period has passed, or
366
+ * they cooled off before. Null otherwise (no cooling off on the plan or for them, or a free trial,
367
+ * where the ordinary cancel ends it at no charge). Display only, from the host's `why`.
368
+ */
369
+ export declare function coolingOffClosedWords(status: CoolingOffStatus | undefined): string | null;
370
+ /**
371
+ * Where a cooling off asked for has got, in words, from the host's record. Null when none was
372
+ * asked.
373
+ */
374
+ export declare function coolOffProgressWords(status: CoolingOffStatus | undefined,
375
+ /** Name the amounts (the web); the app, which shows no money, leaves them out. */
376
+ { amounts }?: {
377
+ amounts?: boolean;
378
+ }): string | null;
379
+ /** What a payer is told when the host refuses cooling off (its `reason`). Display only. */
380
+ export declare function coolOffRefusalWords(details: {
381
+ rule?: unknown;
382
+ reason?: unknown;
383
+ } | undefined): string;
246
384
  /** Whether a subscription is still the payer's to cancel, resume or pay (not ended). */
247
385
  export declare const isLive: (sub: MembershipSubscription) => boolean;
248
386
  /** What a member is told when the host refuses a pass (its `rule` and `reason`). Display only. */
@@ -250,27 +388,7 @@ export declare function refusalWords(details: {
250
388
  rule?: unknown;
251
389
  reason?: unknown;
252
390
  } | undefined): string;
253
- /** The app's `useQuery`, as far as these hooks use it. */
254
- export type UseQuery = <T>(options: {
255
- queryKey: readonly unknown[];
256
- queryFn: () => Promise<T>;
257
- enabled?: boolean;
258
- }) => {
259
- data: T | undefined;
260
- isPending: boolean;
261
- error: unknown;
262
- };
263
- /** The app's `useMutation`, as far as these hooks use it. */
264
- export type UseMutation = <I, O>(options: {
265
- mutationKey: readonly unknown[];
266
- mutationFn: (input: I) => Promise<O>;
267
- }) => {
268
- mutate(input: I): void;
269
- mutateAsync(input: I): Promise<O>;
270
- data: O | undefined;
271
- isPending: boolean;
272
- error: unknown;
273
- };
391
+ export type { UseMutation, UseQuery } from "@composable-os/client";
274
392
  /**
275
393
  * The operations each hook calls (ADR 0453). The public's client gets the plans, the pass types,
276
394
  * buying and subscribing; a customer's client also what they hold and their subscriptions; the
@@ -281,9 +399,11 @@ export declare const MEMBERSHIPS_HOOKS_CALL: {
281
399
  readonly usePassTypes: readonly ["x.memberships.passTypes"];
282
400
  readonly useBuyPass: readonly ["x.memberships.buy", "order.checkout"];
283
401
  readonly useMine: readonly ["x.memberships.mine"];
402
+ readonly useFamily: readonly ["me.family"];
284
403
  readonly useHoldings: readonly ["x.memberships.holdings"];
285
404
  readonly useGivePass: readonly ["x.memberships.givePass"];
286
405
  readonly useVoidPass: readonly ["x.memberships.voidPass"];
406
+ readonly useStaffPassTypes: readonly ["record.list"];
287
407
  readonly useSubscribe: readonly ["subscription.start"];
288
408
  readonly useMySubscriptions: readonly ["subscription.list"];
289
409
  readonly useCancelSubscription: readonly ["subscription.cancel"];
@@ -293,6 +413,8 @@ export declare const MEMBERSHIPS_HOOKS_CALL: {
293
413
  readonly usePauseSubscription: readonly ["subscription.pause"];
294
414
  readonly useUnpauseSubscription: readonly ["subscription.unpause"];
295
415
  readonly useSubscriptionsOf: readonly ["subscription.list"];
416
+ readonly useCoolingOff: readonly ["subscription.coolingOff"];
417
+ readonly useCoolOff: readonly ["subscription.coolOff"];
296
418
  };
297
419
  /**
298
420
  * Hooks for a React or React Native app:
@@ -324,6 +446,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
324
446
  } | undefined;
325
447
  isPending: boolean;
326
448
  error: unknown;
449
+ refetch?: () => unknown;
327
450
  };
328
451
  /** The passes on sale, with the host's prices. */
329
452
  usePassTypes(): {
@@ -346,6 +469,23 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
346
469
  } | undefined;
347
470
  isPending: boolean;
348
471
  error: unknown;
472
+ refetch?: () => unknown;
473
+ };
474
+ /**
475
+ * Staff: every pass type, by title, for giving one by hand (stage 47). The staff client's
476
+ * record read; a customer's client cannot back it.
477
+ */
478
+ useStaffPassTypes(): {
479
+ data: {
480
+ items: {
481
+ id: string;
482
+ values: Record<string, unknown>;
483
+ }[];
484
+ nextCursor: string | null;
485
+ } | undefined;
486
+ isPending: boolean;
487
+ error: unknown;
488
+ refetch?: () => unknown;
349
489
  };
350
490
  /** Start an order for a pass; then `checkout` it on the provider's page (web only). */
351
491
  useBuyPass(): {
@@ -353,10 +493,12 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
353
493
  mutate(input: {
354
494
  passTypeId: string;
355
495
  email?: string | undefined;
496
+ agreements?: Record<string, unknown>[] | undefined;
356
497
  }): void;
357
498
  mutateAsync(input: {
358
499
  passTypeId: string;
359
500
  email?: string | undefined;
501
+ agreements?: Record<string, unknown>[] | undefined;
360
502
  }): Promise<{
361
503
  id: string;
362
504
  state: string;
@@ -373,6 +515,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
373
515
  } | undefined;
374
516
  isPending: boolean;
375
517
  error: unknown;
518
+ reset?: () => void;
376
519
  };
377
520
  checkout: {
378
521
  mutate(input: {
@@ -392,10 +535,14 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
392
535
  } | undefined;
393
536
  isPending: boolean;
394
537
  error: unknown;
538
+ reset?: () => void;
395
539
  };
396
540
  };
397
- /** The signed-in member's memberships and passes, with the host's count of what is left. */
398
- useMine(): {
541
+ /**
542
+ * The signed-in member's memberships and passes, with the host's count of what is left; with
543
+ * a child's id (from `useFamily`), that child's, where the host shows them to a guardian.
544
+ */
545
+ useMine(personId?: string): {
399
546
  data: {
400
547
  holdings: {
401
548
  classTypes: string[];
@@ -422,6 +569,27 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
422
569
  } | undefined;
423
570
  isPending: boolean;
424
571
  error: unknown;
572
+ refetch?: () => unknown;
573
+ };
574
+ /** Who the member acts for: themselves and the children the gym linked to them. */
575
+ useFamily(): {
576
+ data: {
577
+ self: {
578
+ personId: string;
579
+ name: string;
580
+ };
581
+ dependants: {
582
+ personId: string;
583
+ name: string;
584
+ }[];
585
+ guardians: {
586
+ personId: string;
587
+ name: string;
588
+ }[];
589
+ } | undefined;
590
+ isPending: boolean;
591
+ error: unknown;
592
+ refetch?: () => unknown;
425
593
  };
426
594
  /** Staff: one person's memberships and passes. */
427
595
  useHoldings(personId: string): {
@@ -451,6 +619,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
451
619
  } | undefined;
452
620
  isPending: boolean;
453
621
  error: unknown;
622
+ refetch?: () => unknown;
454
623
  };
455
624
  /** Staff (a person): give a pass by hand, with a reason. */
456
625
  useGivePass(): {
@@ -477,6 +646,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
477
646
  } | undefined;
478
647
  isPending: boolean;
479
648
  error: unknown;
649
+ reset?: () => void;
480
650
  };
481
651
  /** Staff (a person): void a pass given by hand, with a reason. */
482
652
  useVoidPass(): {
@@ -499,6 +669,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
499
669
  } | undefined;
500
670
  isPending: boolean;
501
671
  error: unknown;
672
+ reset?: () => void;
502
673
  };
503
674
  /** Start a membership: the host opens the provider's page (web only); the trial is the host's. */
504
675
  useSubscribe(): {
@@ -510,6 +681,11 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
510
681
  returnUrl: string;
511
682
  email?: string;
512
683
  offerId?: string;
684
+ /**
685
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
686
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
687
+ */
688
+ agreements?: Record<string, unknown>[];
513
689
  }): void;
514
690
  mutateAsync(input: {
515
691
  plan: {
@@ -519,10 +695,16 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
519
695
  returnUrl: string;
520
696
  email?: string;
521
697
  offerId?: string;
698
+ /**
699
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
700
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
701
+ */
702
+ agreements?: Record<string, unknown>[];
522
703
  }): Promise<StartedSubscription>;
523
704
  data: StartedSubscription | undefined;
524
705
  isPending: boolean;
525
706
  error: unknown;
707
+ reset?: () => void;
526
708
  };
527
709
  /** The signed-in payer's own membership subscriptions, newest first. */
528
710
  useMySubscriptions(): {
@@ -532,6 +714,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
532
714
  } | undefined;
533
715
  isPending: boolean;
534
716
  error: unknown;
717
+ refetch?: () => unknown;
535
718
  };
536
719
  /** End their own membership when its period ends (web only). */
537
720
  useCancelSubscription(): {
@@ -552,6 +735,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
552
735
  } | undefined;
553
736
  isPending: boolean;
554
737
  error: unknown;
738
+ reset?: () => void;
555
739
  };
556
740
  /** Undo that, before the period ends (web only). */
557
741
  useResumeSubscription(): {
@@ -570,6 +754,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
570
754
  } | undefined;
571
755
  isPending: boolean;
572
756
  error: unknown;
757
+ reset?: () => void;
573
758
  };
574
759
  /** The provider's portal for their card and past invoices (web only, never in a frame). */
575
760
  useBillingPortal(): {
@@ -586,6 +771,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
586
771
  } | undefined;
587
772
  isPending: boolean;
588
773
  error: unknown;
774
+ reset?: () => void;
589
775
  };
590
776
  /**
591
777
  * Move their own membership to another plan (web only): the host decides an upgrade (now,
@@ -605,6 +791,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
605
791
  data: RequestedChange | undefined;
606
792
  isPending: boolean;
607
793
  error: unknown;
794
+ reset?: () => void;
608
795
  };
609
796
  /** Staff (a person): pause a membership from now or a date until a date, with a reason. */
610
797
  usePauseSubscription(): {
@@ -637,6 +824,7 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
637
824
  } | undefined;
638
825
  isPending: boolean;
639
826
  error: unknown;
827
+ reset?: () => void;
640
828
  };
641
829
  /** Staff (a person): end a pause now, or withdraw one not yet started. */
642
830
  useUnpauseSubscription(): {
@@ -659,6 +847,32 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
659
847
  } | undefined;
660
848
  isPending: boolean;
661
849
  error: unknown;
850
+ reset?: () => void;
851
+ };
852
+ /**
853
+ * Whether each of these subscriptions may be ended in its cooling-off period, and how far one
854
+ * asked for has got. The host decides; a block shows the button only when `offered`.
855
+ */
856
+ useCoolingOff(ids: readonly string[]): {
857
+ data: {
858
+ items: CoolingOffStatus[];
859
+ } | undefined;
860
+ isPending: boolean;
861
+ error: unknown;
862
+ refetch?: () => unknown;
863
+ };
864
+ /** End their own membership in its cooling-off period, for a full refund (web only). */
865
+ useCoolOff(): {
866
+ mutate(input: {
867
+ id: string;
868
+ }): void;
869
+ mutateAsync(input: {
870
+ id: string;
871
+ }): Promise<CooledOff>;
872
+ data: CooledOff | undefined;
873
+ isPending: boolean;
874
+ error: unknown;
875
+ reset?: () => void;
662
876
  };
663
877
  /** Staff: the membership subscriptions one person holds. */
664
878
  useSubscriptionsOf(personId: string): {
@@ -668,15 +882,18 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
668
882
  } | undefined;
669
883
  isPending: boolean;
670
884
  error: unknown;
885
+ refetch?: () => unknown;
671
886
  };
672
887
  }, {
673
888
  readonly usePlans: readonly ["x.memberships.plans"];
674
889
  readonly usePassTypes: readonly ["x.memberships.passTypes"];
675
890
  readonly useBuyPass: readonly ["x.memberships.buy", "order.checkout"];
676
891
  readonly useMine: readonly ["x.memberships.mine"];
892
+ readonly useFamily: readonly ["me.family"];
677
893
  readonly useHoldings: readonly ["x.memberships.holdings"];
678
894
  readonly useGivePass: readonly ["x.memberships.givePass"];
679
895
  readonly useVoidPass: readonly ["x.memberships.voidPass"];
896
+ readonly useStaffPassTypes: readonly ["record.list"];
680
897
  readonly useSubscribe: readonly ["subscription.start"];
681
898
  readonly useMySubscriptions: readonly ["subscription.list"];
682
899
  readonly useCancelSubscription: readonly ["subscription.cancel"];
@@ -686,6 +903,8 @@ export declare function createMembershipsHooks<C extends ClientHolding>(react: {
686
903
  readonly usePauseSubscription: readonly ["subscription.pause"];
687
904
  readonly useUnpauseSubscription: readonly ["subscription.unpause"];
688
905
  readonly useSubscriptionsOf: readonly ["subscription.list"];
906
+ readonly useCoolingOff: readonly ["subscription.coolingOff"];
907
+ readonly useCoolOff: readonly ["subscription.coolOff"];
689
908
  }, import("@composable-os/client").OperationsOf<C>>;
690
909
  declare function allMembershipsHooks(react: {
691
910
  useQuery: UseQuery;
@@ -712,6 +931,7 @@ declare function allMembershipsHooks(react: {
712
931
  } | undefined;
713
932
  isPending: boolean;
714
933
  error: unknown;
934
+ refetch?: () => unknown;
715
935
  };
716
936
  /** The passes on sale, with the host's prices. */
717
937
  usePassTypes(): {
@@ -734,6 +954,23 @@ declare function allMembershipsHooks(react: {
734
954
  } | undefined;
735
955
  isPending: boolean;
736
956
  error: unknown;
957
+ refetch?: () => unknown;
958
+ };
959
+ /**
960
+ * Staff: every pass type, by title, for giving one by hand (stage 47). The staff client's
961
+ * record read; a customer's client cannot back it.
962
+ */
963
+ useStaffPassTypes(): {
964
+ data: {
965
+ items: {
966
+ id: string;
967
+ values: Record<string, unknown>;
968
+ }[];
969
+ nextCursor: string | null;
970
+ } | undefined;
971
+ isPending: boolean;
972
+ error: unknown;
973
+ refetch?: () => unknown;
737
974
  };
738
975
  /** Start an order for a pass; then `checkout` it on the provider's page (web only). */
739
976
  useBuyPass(): {
@@ -741,10 +978,12 @@ declare function allMembershipsHooks(react: {
741
978
  mutate(input: {
742
979
  passTypeId: string;
743
980
  email?: string | undefined;
981
+ agreements?: Record<string, unknown>[] | undefined;
744
982
  }): void;
745
983
  mutateAsync(input: {
746
984
  passTypeId: string;
747
985
  email?: string | undefined;
986
+ agreements?: Record<string, unknown>[] | undefined;
748
987
  }): Promise<{
749
988
  id: string;
750
989
  state: string;
@@ -761,6 +1000,7 @@ declare function allMembershipsHooks(react: {
761
1000
  } | undefined;
762
1001
  isPending: boolean;
763
1002
  error: unknown;
1003
+ reset?: () => void;
764
1004
  };
765
1005
  checkout: {
766
1006
  mutate(input: {
@@ -780,10 +1020,14 @@ declare function allMembershipsHooks(react: {
780
1020
  } | undefined;
781
1021
  isPending: boolean;
782
1022
  error: unknown;
1023
+ reset?: () => void;
783
1024
  };
784
1025
  };
785
- /** The signed-in member's memberships and passes, with the host's count of what is left. */
786
- useMine(): {
1026
+ /**
1027
+ * The signed-in member's memberships and passes, with the host's count of what is left; with
1028
+ * a child's id (from `useFamily`), that child's, where the host shows them to a guardian.
1029
+ */
1030
+ useMine(personId?: string): {
787
1031
  data: {
788
1032
  holdings: {
789
1033
  classTypes: string[];
@@ -810,6 +1054,27 @@ declare function allMembershipsHooks(react: {
810
1054
  } | undefined;
811
1055
  isPending: boolean;
812
1056
  error: unknown;
1057
+ refetch?: () => unknown;
1058
+ };
1059
+ /** Who the member acts for: themselves and the children the gym linked to them. */
1060
+ useFamily(): {
1061
+ data: {
1062
+ self: {
1063
+ personId: string;
1064
+ name: string;
1065
+ };
1066
+ dependants: {
1067
+ personId: string;
1068
+ name: string;
1069
+ }[];
1070
+ guardians: {
1071
+ personId: string;
1072
+ name: string;
1073
+ }[];
1074
+ } | undefined;
1075
+ isPending: boolean;
1076
+ error: unknown;
1077
+ refetch?: () => unknown;
813
1078
  };
814
1079
  /** Staff: one person's memberships and passes. */
815
1080
  useHoldings(personId: string): {
@@ -839,6 +1104,7 @@ declare function allMembershipsHooks(react: {
839
1104
  } | undefined;
840
1105
  isPending: boolean;
841
1106
  error: unknown;
1107
+ refetch?: () => unknown;
842
1108
  };
843
1109
  /** Staff (a person): give a pass by hand, with a reason. */
844
1110
  useGivePass(): {
@@ -865,6 +1131,7 @@ declare function allMembershipsHooks(react: {
865
1131
  } | undefined;
866
1132
  isPending: boolean;
867
1133
  error: unknown;
1134
+ reset?: () => void;
868
1135
  };
869
1136
  /** Staff (a person): void a pass given by hand, with a reason. */
870
1137
  useVoidPass(): {
@@ -887,6 +1154,7 @@ declare function allMembershipsHooks(react: {
887
1154
  } | undefined;
888
1155
  isPending: boolean;
889
1156
  error: unknown;
1157
+ reset?: () => void;
890
1158
  };
891
1159
  /** Start a membership: the host opens the provider's page (web only); the trial is the host's. */
892
1160
  useSubscribe(): {
@@ -898,6 +1166,11 @@ declare function allMembershipsHooks(react: {
898
1166
  returnUrl: string;
899
1167
  email?: string;
900
1168
  offerId?: string;
1169
+ /**
1170
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
1171
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
1172
+ */
1173
+ agreements?: Record<string, unknown>[];
901
1174
  }): void;
902
1175
  mutateAsync(input: {
903
1176
  plan: {
@@ -907,10 +1180,16 @@ declare function allMembershipsHooks(react: {
907
1180
  returnUrl: string;
908
1181
  email?: string;
909
1182
  offerId?: string;
1183
+ /**
1184
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
1185
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
1186
+ */
1187
+ agreements?: Record<string, unknown>[];
910
1188
  }): Promise<StartedSubscription>;
911
1189
  data: StartedSubscription | undefined;
912
1190
  isPending: boolean;
913
1191
  error: unknown;
1192
+ reset?: () => void;
914
1193
  };
915
1194
  /** The signed-in payer's own membership subscriptions, newest first. */
916
1195
  useMySubscriptions(): {
@@ -920,6 +1199,7 @@ declare function allMembershipsHooks(react: {
920
1199
  } | undefined;
921
1200
  isPending: boolean;
922
1201
  error: unknown;
1202
+ refetch?: () => unknown;
923
1203
  };
924
1204
  /** End their own membership when its period ends (web only). */
925
1205
  useCancelSubscription(): {
@@ -940,6 +1220,7 @@ declare function allMembershipsHooks(react: {
940
1220
  } | undefined;
941
1221
  isPending: boolean;
942
1222
  error: unknown;
1223
+ reset?: () => void;
943
1224
  };
944
1225
  /** Undo that, before the period ends (web only). */
945
1226
  useResumeSubscription(): {
@@ -958,6 +1239,7 @@ declare function allMembershipsHooks(react: {
958
1239
  } | undefined;
959
1240
  isPending: boolean;
960
1241
  error: unknown;
1242
+ reset?: () => void;
961
1243
  };
962
1244
  /** The provider's portal for their card and past invoices (web only, never in a frame). */
963
1245
  useBillingPortal(): {
@@ -974,6 +1256,7 @@ declare function allMembershipsHooks(react: {
974
1256
  } | undefined;
975
1257
  isPending: boolean;
976
1258
  error: unknown;
1259
+ reset?: () => void;
977
1260
  };
978
1261
  /**
979
1262
  * Move their own membership to another plan (web only): the host decides an upgrade (now,
@@ -993,6 +1276,7 @@ declare function allMembershipsHooks(react: {
993
1276
  data: RequestedChange | undefined;
994
1277
  isPending: boolean;
995
1278
  error: unknown;
1279
+ reset?: () => void;
996
1280
  };
997
1281
  /** Staff (a person): pause a membership from now or a date until a date, with a reason. */
998
1282
  usePauseSubscription(): {
@@ -1025,6 +1309,7 @@ declare function allMembershipsHooks(react: {
1025
1309
  } | undefined;
1026
1310
  isPending: boolean;
1027
1311
  error: unknown;
1312
+ reset?: () => void;
1028
1313
  };
1029
1314
  /** Staff (a person): end a pause now, or withdraw one not yet started. */
1030
1315
  useUnpauseSubscription(): {
@@ -1047,6 +1332,32 @@ declare function allMembershipsHooks(react: {
1047
1332
  } | undefined;
1048
1333
  isPending: boolean;
1049
1334
  error: unknown;
1335
+ reset?: () => void;
1336
+ };
1337
+ /**
1338
+ * Whether each of these subscriptions may be ended in its cooling-off period, and how far one
1339
+ * asked for has got. The host decides; a block shows the button only when `offered`.
1340
+ */
1341
+ useCoolingOff(ids: readonly string[]): {
1342
+ data: {
1343
+ items: CoolingOffStatus[];
1344
+ } | undefined;
1345
+ isPending: boolean;
1346
+ error: unknown;
1347
+ refetch?: () => unknown;
1348
+ };
1349
+ /** End their own membership in its cooling-off period, for a full refund (web only). */
1350
+ useCoolOff(): {
1351
+ mutate(input: {
1352
+ id: string;
1353
+ }): void;
1354
+ mutateAsync(input: {
1355
+ id: string;
1356
+ }): Promise<CooledOff>;
1357
+ data: CooledOff | undefined;
1358
+ isPending: boolean;
1359
+ error: unknown;
1360
+ reset?: () => void;
1050
1361
  };
1051
1362
  /** Staff: the membership subscriptions one person holds. */
1052
1363
  useSubscriptionsOf(personId: string): {
@@ -1056,8 +1367,8 @@ declare function allMembershipsHooks(react: {
1056
1367
  } | undefined;
1057
1368
  isPending: boolean;
1058
1369
  error: unknown;
1370
+ refetch?: () => unknown;
1059
1371
  };
1060
1372
  };
1061
1373
  /** Every hook of this entry. A block takes the ones it calls: `Pick<MembershipsHooks, "useMine">`. */
1062
1374
  export type MembershipsHooks = ReturnType<typeof allMembershipsHooks>;
1063
- export {};