@composable-os/pack-courses 0.1.0-beta.11 → 0.1.0-beta.13

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.
Files changed (30) hide show
  1. package/dist/automations.js +1 -2
  2. package/dist/blocks/courses-builder/course-builder.js +15 -21
  3. package/dist/blocks/courses-catalogue/catalogue.js +2 -3
  4. package/dist/blocks/courses-course/course-page.d.ts +6 -1
  5. package/dist/blocks/courses-course/course-page.js +73 -9
  6. package/dist/blocks/courses-my-courses/my-courses.d.ts +14 -1
  7. package/dist/blocks/courses-my-courses/my-courses.js +9 -1
  8. package/dist/blocks/courses-native-catalogue/catalogue-screen.js +3 -6
  9. package/dist/blocks/courses-native-course/course-screen.js +2 -2
  10. package/dist/blocks/courses-native-my-courses/my-courses-screen.d.ts +14 -1
  11. package/dist/blocks/courses-native-my-courses/my-courses-screen.js +16 -3
  12. package/dist/blocks/courses-native-player/lesson-screen.d.ts +1 -0
  13. package/dist/blocks/courses-native-player/lesson-screen.js +2 -2
  14. package/dist/blocks/courses-native-subscription/subscription-screen.js +2 -2
  15. package/dist/blocks/courses-player/player.d.ts +1 -1
  16. package/dist/blocks/courses-subscribe/subscribe.d.ts +6 -1
  17. package/dist/blocks/courses-subscribe/subscribe.js +80 -9
  18. package/dist/blocks/courses-subscription/my-subscription.d.ts +6 -4
  19. package/dist/blocks/courses-subscription/my-subscription.js +14 -49
  20. package/dist/client/index.d.ts +382 -10
  21. package/dist/client/index.js +24 -36
  22. package/dist/dashboards.d.ts +2 -0
  23. package/dist/dashboards.js +3 -3
  24. package/dist/index.d.ts +82 -3
  25. package/dist/index.js +68 -3
  26. package/dist/outline.d.ts +1 -3
  27. package/dist/outline.js +25 -16
  28. package/dist/tools.d.ts +7 -1
  29. package/dist/tools.js +130 -103
  30. package/package.json +3 -3
@@ -2,7 +2,8 @@ import { type ClientHolding, type PackClient } from "@composable-os/client";
2
2
  import type { z } from "@composable-os/sdk";
3
3
  import { type Lesson, type LessonKind, type Outline, type Section } from "../outline.ts";
4
4
  import type { buy, catalogue, course, endEnrolment, enrol, lesson, myCourses, plans, progress, startSession, stats } from "../tools.ts";
5
- export { completion, findLesson, lessonsOf, nextLesson, watchedToEnd } from "../outline.ts";
5
+ export { accountDay as day, formatMinor } from "@composable-os/client";
6
+ export { asOutline, completion, findLesson, lessonsOf, nextLesson, watchedToEnd, } from "../outline.ts";
6
7
  export type { Lesson, LessonKind, Outline, Section };
7
8
  type Io<T extends {
8
9
  input: z.ZodType;
@@ -12,6 +13,7 @@ type Io<T extends {
12
13
  output: z.output<T["output"]>;
13
14
  };
14
15
  export declare const COURSE = "courses.course";
16
+ export declare const PLAN = "courses.plan";
15
17
  /** What media.play answers (ADR 0476). */
16
18
  export interface Playback {
17
19
  id: string;
@@ -27,7 +29,6 @@ export interface Playback {
27
29
  label: string;
28
30
  }[];
29
31
  }
30
- export declare const PLAN = "courses.plan";
31
32
  /** A subscription as its payer reads it (`subscription.list`, stage 32a). */
32
33
  export interface CourseSubscription {
33
34
  id: string;
@@ -100,6 +101,11 @@ export type CoursesOperations = {
100
101
  returnUrl: string;
101
102
  email?: string;
102
103
  offerId?: string;
104
+ /**
105
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
106
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
107
+ */
108
+ agreements?: Record<string, unknown>[];
103
109
  };
104
110
  output: StartedSubscription;
105
111
  };
@@ -272,6 +278,7 @@ export type CoursesOperations = {
272
278
  };
273
279
  };
274
280
  type In<N extends keyof CoursesOperations> = CoursesOperations[N]["input"];
281
+ type Out<N extends keyof CoursesOperations> = CoursesOperations[N]["output"];
275
282
  export type CoursesClient = PackClient<CoursesOperations>;
276
283
  /** A token is asked for again this long before it expires. */
277
284
  export declare const PLAYBACK_REFRESH_BEFORE_MS: number;
@@ -282,13 +289,6 @@ export declare const PLAYBACK_REFRESH_BEFORE_MS: number;
282
289
  export declare function refreshInMs(expiresAt: string, now?: number): number;
283
290
  /** A price as the host gave it, in its currency (`99.00 AUD`). Display only: never worked out. */
284
291
  export declare function formatPrice(price: number | null | undefined, currency: string | null | undefined): string;
285
- /**
286
- * An amount the host gave in the currency's minor unit (a subscription's price per period), in
287
- * that currency: `29.00 AUD`. Display only: the minor unit's digits are the currency's own.
288
- */
289
- export declare function formatMinor(minor: number, currency: string): string;
290
- /** A date as a reader sees it (`3 Dec 2026`), from the host's ISO timestamp. Display only. */
291
- export declare function day(iso: string | null | undefined): string;
292
292
  /**
293
293
  * What a subscription's state means to its member, in words, from what the host reports. Display
294
294
  * only: whether it gives access is the host's (the seam), never worked out from this.
@@ -296,6 +296,8 @@ export declare function day(iso: string | null | undefined): string;
296
296
  export declare function subscriptionStatus(sub: CourseSubscription): string;
297
297
  /** Whether a subscription is still the member's to cancel, resume or pay (not ended). */
298
298
  export declare const isLive: (sub: CourseSubscription) => boolean;
299
+ /** A course's level (1 to 3) as a reader sees it: `Beginner`. Display only. */
300
+ export declare function levelName(level: number | null | undefined): string | null;
299
301
  /** A lesson's length as a reader sees it: `12 min`. Display only. */
300
302
  export declare function minutes(duration: number | null | undefined): string;
301
303
  /** Where a phone asks the host for a picture (the course cover): as the Content pack's. */
@@ -333,6 +335,10 @@ export type UseQuery = <T>(options: {
333
335
  data: T | undefined;
334
336
  isPending: boolean;
335
337
  error: unknown;
338
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
339
+ refetch?: () => Promise<{
340
+ data: T | undefined;
341
+ }>;
336
342
  };
337
343
  /** What a query hook returns, as `UseQuery` gives it. */
338
344
  export interface QueryResult<T> {
@@ -340,17 +346,19 @@ export interface QueryResult<T> {
340
346
  isPending: boolean;
341
347
  error: unknown;
342
348
  }
343
- type Out<N extends keyof CoursesOperations> = CoursesOperations[N]["output"];
344
349
  /** The app's `useMutation`, as far as these hooks use it. */
345
350
  export type UseMutation = <I, O>(options: {
346
351
  mutationKey: readonly unknown[];
347
352
  mutationFn: (input: I) => Promise<O>;
353
+ gcTime?: number;
348
354
  }) => {
349
355
  mutate(input: I): void;
350
356
  mutateAsync(input: I): Promise<O>;
351
357
  data: O | undefined;
352
358
  isPending: boolean;
353
359
  error: unknown;
360
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
361
+ reset?: () => void;
354
362
  };
355
363
  /**
356
364
  * The operations each hook calls (ADR 0453). The public's client gets the catalogue, the course
@@ -441,6 +449,55 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
441
449
  } | undefined;
442
450
  isPending: boolean;
443
451
  error: unknown;
452
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
453
+ refetch?: (() => Promise<{
454
+ data: {
455
+ themes: {
456
+ id: string;
457
+ name: string | null;
458
+ slug: string | null;
459
+ summary: string | null;
460
+ picture: {
461
+ [x: string]: unknown;
462
+ media: string;
463
+ alt?: string | undefined;
464
+ } | null;
465
+ }[];
466
+ courses: {
467
+ id: string;
468
+ title: string | null;
469
+ slug: string | null;
470
+ theme: string | null;
471
+ level: number | null;
472
+ summary: string | null;
473
+ cover: {
474
+ [x: string]: unknown;
475
+ media: string;
476
+ alt?: string | undefined;
477
+ } | null;
478
+ trailer: {
479
+ media: string;
480
+ poster?: string | undefined;
481
+ } | null;
482
+ price: number | null;
483
+ lessons: number;
484
+ }[];
485
+ bundles: {
486
+ id: string;
487
+ title: string | null;
488
+ slug: string | null;
489
+ summary: string | null;
490
+ cover: {
491
+ [x: string]: unknown;
492
+ media: string;
493
+ alt?: string | undefined;
494
+ } | null;
495
+ courses: string[];
496
+ price: number | null;
497
+ }[];
498
+ currency: string | null;
499
+ } | undefined;
500
+ }>) | undefined;
444
501
  };
445
502
  /** One published course by its address, with whether the caller holds it. */
446
503
  useCourse(slug: string | null): QueryResult<Out<"x.courses.course">>;
@@ -451,11 +508,13 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
451
508
  courseId?: string | undefined;
452
509
  bundleId?: string | undefined;
453
510
  email?: string | undefined;
511
+ agreements?: Record<string, unknown>[] | undefined;
454
512
  }): void;
455
513
  mutateAsync(input: {
456
514
  courseId?: string | undefined;
457
515
  bundleId?: string | undefined;
458
516
  email?: string | undefined;
517
+ agreements?: Record<string, unknown>[] | undefined;
459
518
  }): Promise<{
460
519
  id: string;
461
520
  state: string;
@@ -472,6 +531,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
472
531
  } | undefined;
473
532
  isPending: boolean;
474
533
  error: unknown;
534
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
535
+ reset?: () => void;
475
536
  };
476
537
  checkout: {
477
538
  mutate(input: {
@@ -491,6 +552,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
491
552
  } | undefined;
492
553
  isPending: boolean;
493
554
  error: unknown;
555
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
556
+ reset?: () => void;
494
557
  };
495
558
  };
496
559
  /** One lesson for a holder (or a free preview). */
@@ -540,6 +603,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
540
603
  } | undefined;
541
604
  isPending: boolean;
542
605
  error: unknown;
606
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
607
+ reset?: () => void;
543
608
  };
544
609
  /** What the caller holds, with progress. */
545
610
  useMyCourses(): {
@@ -571,6 +636,35 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
571
636
  } | undefined;
572
637
  isPending: boolean;
573
638
  error: unknown;
639
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
640
+ refetch?: (() => Promise<{
641
+ data: {
642
+ courses: {
643
+ id: string;
644
+ title: string | null;
645
+ slug: string | null;
646
+ theme: string | null;
647
+ level: number | null;
648
+ summary: string | null;
649
+ cover: {
650
+ [x: string]: unknown;
651
+ media: string;
652
+ alt?: string | undefined;
653
+ } | null;
654
+ trailer: {
655
+ media: string;
656
+ poster?: string | undefined;
657
+ } | null;
658
+ price: number | null;
659
+ lessons: number;
660
+ why: "bought" | "bundle" | "given" | "imported" | "subscription";
661
+ done: number;
662
+ counted: number;
663
+ complete: boolean;
664
+ continueWith: string | null;
665
+ }[];
666
+ } | undefined;
667
+ }>) | undefined;
574
668
  };
575
669
  /** A session lesson's own Programs session, once it is assigned. */
576
670
  useStartSession(courseId: string | null, lessonKey: string | null): QueryResult<Out<"x.courses.startSession">>;
@@ -601,6 +695,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
601
695
  } | undefined;
602
696
  isPending: boolean;
603
697
  error: unknown;
698
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
699
+ reset?: () => void;
604
700
  };
605
701
  /** Staff: end an enrolment staff gave or one imported. */
606
702
  useEndEnrolment(): {
@@ -623,6 +719,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
623
719
  } | undefined;
624
720
  isPending: boolean;
625
721
  error: unknown;
722
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
723
+ reset?: () => void;
626
724
  };
627
725
  /** Staff: enrolments and lessons done. */
628
726
  useStats(courseId?: string): {
@@ -642,6 +740,23 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
642
740
  } | undefined;
643
741
  isPending: boolean;
644
742
  error: unknown;
743
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
744
+ refetch?: (() => Promise<{
745
+ data: {
746
+ courses: {
747
+ courseId: string;
748
+ title: string | null;
749
+ active: number;
750
+ ended: number;
751
+ void: number;
752
+ lessonsDone: number;
753
+ }[];
754
+ byWeek: {
755
+ week: string;
756
+ done: number;
757
+ }[];
758
+ } | undefined;
759
+ }>) | undefined;
645
760
  };
646
761
  /** The course plans on offer, with the host's prices and trial days. */
647
762
  usePlans(): {
@@ -657,6 +772,19 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
657
772
  } | undefined;
658
773
  isPending: boolean;
659
774
  error: unknown;
775
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
776
+ refetch?: (() => Promise<{
777
+ data: {
778
+ plans: {
779
+ id: string;
780
+ title: string | null;
781
+ description: string | null;
782
+ price: number | null;
783
+ trialDays: number | null;
784
+ }[];
785
+ currency: string | null;
786
+ } | undefined;
787
+ }>) | undefined;
660
788
  };
661
789
  /**
662
790
  * Start a course subscription: the host opens the provider's page (web only). Whether the
@@ -671,6 +799,11 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
671
799
  returnUrl: string;
672
800
  email?: string;
673
801
  offerId?: string;
802
+ /**
803
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
804
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
805
+ */
806
+ agreements?: Record<string, unknown>[];
674
807
  }): void;
675
808
  mutateAsync(input: {
676
809
  plan: {
@@ -680,10 +813,17 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
680
813
  returnUrl: string;
681
814
  email?: string;
682
815
  offerId?: string;
816
+ /**
817
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
818
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
819
+ */
820
+ agreements?: Record<string, unknown>[];
683
821
  }): Promise<StartedSubscription>;
684
822
  data: StartedSubscription | undefined;
685
823
  isPending: boolean;
686
824
  error: unknown;
825
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
826
+ reset?: () => void;
687
827
  };
688
828
  /** The signed-in customer's own course subscriptions, newest first. */
689
829
  useMySubscriptions(): {
@@ -693,6 +833,13 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
693
833
  } | undefined;
694
834
  isPending: boolean;
695
835
  error: unknown;
836
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
837
+ refetch?: (() => Promise<{
838
+ data: {
839
+ items: CourseSubscription[];
840
+ nextCursor: string | null;
841
+ } | undefined;
842
+ }>) | undefined;
696
843
  };
697
844
  /**
698
845
  * The signed-in customer's own continuation offers (moving from another platform): free until
@@ -706,6 +853,12 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
706
853
  } | undefined;
707
854
  isPending: boolean;
708
855
  error: unknown;
856
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
857
+ refetch?: (() => Promise<{
858
+ data: {
859
+ offers: ContinuationOffer[];
860
+ } | undefined;
861
+ }>) | undefined;
709
862
  };
710
863
  /** End their own subscription when its period ends (web only). */
711
864
  useCancelSubscription(): {
@@ -726,6 +879,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
726
879
  } | undefined;
727
880
  isPending: boolean;
728
881
  error: unknown;
882
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
883
+ reset?: () => void;
729
884
  };
730
885
  /** Undo that, before the period ends (web only). */
731
886
  useResumeSubscription(): {
@@ -744,6 +899,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
744
899
  } | undefined;
745
900
  isPending: boolean;
746
901
  error: unknown;
902
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
903
+ reset?: () => void;
747
904
  };
748
905
  /** The provider's portal for their card and past invoices (web only, never in a frame). */
749
906
  useBillingPortal(): {
@@ -760,6 +917,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
760
917
  } | undefined;
761
918
  isPending: boolean;
762
919
  error: unknown;
920
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
921
+ reset?: () => void;
763
922
  };
764
923
  /** Staff: a course's working copy, as the builder edits it. */
765
924
  useWorkingCopy(courseId: string): {
@@ -769,6 +928,13 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
769
928
  } | undefined;
770
929
  isPending: boolean;
771
930
  error: unknown;
931
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
932
+ refetch?: (() => Promise<{
933
+ data: {
934
+ id: string;
935
+ values: Record<string, unknown>;
936
+ } | undefined;
937
+ }>) | undefined;
772
938
  };
773
939
  /** Staff: save the course's working copy (its outline). */
774
940
  useSaveOutline(): {
@@ -791,6 +957,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
791
957
  } | undefined;
792
958
  isPending: boolean;
793
959
  error: unknown;
960
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
961
+ reset?: () => void;
794
962
  };
795
963
  /** Staff: publish the course (a person; an assistant's request waits for one). */
796
964
  usePublishCourse(): {
@@ -813,6 +981,8 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
813
981
  } | undefined;
814
982
  isPending: boolean;
815
983
  error: unknown;
984
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
985
+ reset?: () => void;
816
986
  };
817
987
  /** Staff: the library's ready videos, to pick a lesson's video. */
818
988
  useLibraryVideos(): {
@@ -825,6 +995,16 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
825
995
  } | undefined;
826
996
  isPending: boolean;
827
997
  error: unknown;
998
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
999
+ refetch?: (() => Promise<{
1000
+ data: {
1001
+ items: {
1002
+ id: string;
1003
+ values: Record<string, unknown>;
1004
+ }[];
1005
+ nextCursor: string | null;
1006
+ } | undefined;
1007
+ }>) | undefined;
828
1008
  };
829
1009
  /** Staff: the published Programs programs, to pick a session lesson's program. */
830
1010
  usePublishedPrograms(): {
@@ -837,6 +1017,16 @@ export declare function createCoursesHooks<C extends ClientHolding>(react: {
837
1017
  } | undefined;
838
1018
  isPending: boolean;
839
1019
  error: unknown;
1020
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1021
+ refetch?: (() => Promise<{
1022
+ data: {
1023
+ items: {
1024
+ id: string;
1025
+ title?: string | null;
1026
+ values: Record<string, unknown>;
1027
+ }[];
1028
+ } | undefined;
1029
+ }>) | undefined;
840
1030
  };
841
1031
  }, {
842
1032
  readonly useCatalogue: readonly ["x.courses.catalogue"];
@@ -917,6 +1107,55 @@ declare function allCoursesHooks(react: {
917
1107
  } | undefined;
918
1108
  isPending: boolean;
919
1109
  error: unknown;
1110
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1111
+ refetch?: (() => Promise<{
1112
+ data: {
1113
+ themes: {
1114
+ id: string;
1115
+ name: string | null;
1116
+ slug: string | null;
1117
+ summary: string | null;
1118
+ picture: {
1119
+ [x: string]: unknown;
1120
+ media: string;
1121
+ alt?: string | undefined;
1122
+ } | null;
1123
+ }[];
1124
+ courses: {
1125
+ id: string;
1126
+ title: string | null;
1127
+ slug: string | null;
1128
+ theme: string | null;
1129
+ level: number | null;
1130
+ summary: string | null;
1131
+ cover: {
1132
+ [x: string]: unknown;
1133
+ media: string;
1134
+ alt?: string | undefined;
1135
+ } | null;
1136
+ trailer: {
1137
+ media: string;
1138
+ poster?: string | undefined;
1139
+ } | null;
1140
+ price: number | null;
1141
+ lessons: number;
1142
+ }[];
1143
+ bundles: {
1144
+ id: string;
1145
+ title: string | null;
1146
+ slug: string | null;
1147
+ summary: string | null;
1148
+ cover: {
1149
+ [x: string]: unknown;
1150
+ media: string;
1151
+ alt?: string | undefined;
1152
+ } | null;
1153
+ courses: string[];
1154
+ price: number | null;
1155
+ }[];
1156
+ currency: string | null;
1157
+ } | undefined;
1158
+ }>) | undefined;
920
1159
  };
921
1160
  /** One published course by its address, with whether the caller holds it. */
922
1161
  useCourse(slug: string | null): QueryResult<Out<"x.courses.course">>;
@@ -927,11 +1166,13 @@ declare function allCoursesHooks(react: {
927
1166
  courseId?: string | undefined;
928
1167
  bundleId?: string | undefined;
929
1168
  email?: string | undefined;
1169
+ agreements?: Record<string, unknown>[] | undefined;
930
1170
  }): void;
931
1171
  mutateAsync(input: {
932
1172
  courseId?: string | undefined;
933
1173
  bundleId?: string | undefined;
934
1174
  email?: string | undefined;
1175
+ agreements?: Record<string, unknown>[] | undefined;
935
1176
  }): Promise<{
936
1177
  id: string;
937
1178
  state: string;
@@ -948,6 +1189,8 @@ declare function allCoursesHooks(react: {
948
1189
  } | undefined;
949
1190
  isPending: boolean;
950
1191
  error: unknown;
1192
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1193
+ reset?: () => void;
951
1194
  };
952
1195
  checkout: {
953
1196
  mutate(input: {
@@ -967,6 +1210,8 @@ declare function allCoursesHooks(react: {
967
1210
  } | undefined;
968
1211
  isPending: boolean;
969
1212
  error: unknown;
1213
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1214
+ reset?: () => void;
970
1215
  };
971
1216
  };
972
1217
  /** One lesson for a holder (or a free preview). */
@@ -1016,6 +1261,8 @@ declare function allCoursesHooks(react: {
1016
1261
  } | undefined;
1017
1262
  isPending: boolean;
1018
1263
  error: unknown;
1264
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1265
+ reset?: () => void;
1019
1266
  };
1020
1267
  /** What the caller holds, with progress. */
1021
1268
  useMyCourses(): {
@@ -1047,6 +1294,35 @@ declare function allCoursesHooks(react: {
1047
1294
  } | undefined;
1048
1295
  isPending: boolean;
1049
1296
  error: unknown;
1297
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1298
+ refetch?: (() => Promise<{
1299
+ data: {
1300
+ courses: {
1301
+ id: string;
1302
+ title: string | null;
1303
+ slug: string | null;
1304
+ theme: string | null;
1305
+ level: number | null;
1306
+ summary: string | null;
1307
+ cover: {
1308
+ [x: string]: unknown;
1309
+ media: string;
1310
+ alt?: string | undefined;
1311
+ } | null;
1312
+ trailer: {
1313
+ media: string;
1314
+ poster?: string | undefined;
1315
+ } | null;
1316
+ price: number | null;
1317
+ lessons: number;
1318
+ why: "bought" | "bundle" | "given" | "imported" | "subscription";
1319
+ done: number;
1320
+ counted: number;
1321
+ complete: boolean;
1322
+ continueWith: string | null;
1323
+ }[];
1324
+ } | undefined;
1325
+ }>) | undefined;
1050
1326
  };
1051
1327
  /** A session lesson's own Programs session, once it is assigned. */
1052
1328
  useStartSession(courseId: string | null, lessonKey: string | null): QueryResult<Out<"x.courses.startSession">>;
@@ -1077,6 +1353,8 @@ declare function allCoursesHooks(react: {
1077
1353
  } | undefined;
1078
1354
  isPending: boolean;
1079
1355
  error: unknown;
1356
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1357
+ reset?: () => void;
1080
1358
  };
1081
1359
  /** Staff: end an enrolment staff gave or one imported. */
1082
1360
  useEndEnrolment(): {
@@ -1099,6 +1377,8 @@ declare function allCoursesHooks(react: {
1099
1377
  } | undefined;
1100
1378
  isPending: boolean;
1101
1379
  error: unknown;
1380
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1381
+ reset?: () => void;
1102
1382
  };
1103
1383
  /** Staff: enrolments and lessons done. */
1104
1384
  useStats(courseId?: string): {
@@ -1118,6 +1398,23 @@ declare function allCoursesHooks(react: {
1118
1398
  } | undefined;
1119
1399
  isPending: boolean;
1120
1400
  error: unknown;
1401
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1402
+ refetch?: (() => Promise<{
1403
+ data: {
1404
+ courses: {
1405
+ courseId: string;
1406
+ title: string | null;
1407
+ active: number;
1408
+ ended: number;
1409
+ void: number;
1410
+ lessonsDone: number;
1411
+ }[];
1412
+ byWeek: {
1413
+ week: string;
1414
+ done: number;
1415
+ }[];
1416
+ } | undefined;
1417
+ }>) | undefined;
1121
1418
  };
1122
1419
  /** The course plans on offer, with the host's prices and trial days. */
1123
1420
  usePlans(): {
@@ -1133,6 +1430,19 @@ declare function allCoursesHooks(react: {
1133
1430
  } | undefined;
1134
1431
  isPending: boolean;
1135
1432
  error: unknown;
1433
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1434
+ refetch?: (() => Promise<{
1435
+ data: {
1436
+ plans: {
1437
+ id: string;
1438
+ title: string | null;
1439
+ description: string | null;
1440
+ price: number | null;
1441
+ trialDays: number | null;
1442
+ }[];
1443
+ currency: string | null;
1444
+ } | undefined;
1445
+ }>) | undefined;
1136
1446
  };
1137
1447
  /**
1138
1448
  * Start a course subscription: the host opens the provider's page (web only). Whether the
@@ -1147,6 +1457,11 @@ declare function allCoursesHooks(react: {
1147
1457
  returnUrl: string;
1148
1458
  email?: string;
1149
1459
  offerId?: string;
1460
+ /**
1461
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
1462
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
1463
+ */
1464
+ agreements?: Record<string, unknown>[];
1150
1465
  }): void;
1151
1466
  mutateAsync(input: {
1152
1467
  plan: {
@@ -1156,10 +1471,17 @@ declare function allCoursesHooks(react: {
1156
1471
  returnUrl: string;
1157
1472
  email?: string;
1158
1473
  offerId?: string;
1474
+ /**
1475
+ * A guest only: what they agreed to on the way (stage 44, ADR 0644), each
1476
+ * { versionId, typedName, signature?, answers? }, as the host's refusal asked.
1477
+ */
1478
+ agreements?: Record<string, unknown>[];
1159
1479
  }): Promise<StartedSubscription>;
1160
1480
  data: StartedSubscription | undefined;
1161
1481
  isPending: boolean;
1162
1482
  error: unknown;
1483
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1484
+ reset?: () => void;
1163
1485
  };
1164
1486
  /** The signed-in customer's own course subscriptions, newest first. */
1165
1487
  useMySubscriptions(): {
@@ -1169,6 +1491,13 @@ declare function allCoursesHooks(react: {
1169
1491
  } | undefined;
1170
1492
  isPending: boolean;
1171
1493
  error: unknown;
1494
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1495
+ refetch?: (() => Promise<{
1496
+ data: {
1497
+ items: CourseSubscription[];
1498
+ nextCursor: string | null;
1499
+ } | undefined;
1500
+ }>) | undefined;
1172
1501
  };
1173
1502
  /**
1174
1503
  * The signed-in customer's own continuation offers (moving from another platform): free until
@@ -1182,6 +1511,12 @@ declare function allCoursesHooks(react: {
1182
1511
  } | undefined;
1183
1512
  isPending: boolean;
1184
1513
  error: unknown;
1514
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1515
+ refetch?: (() => Promise<{
1516
+ data: {
1517
+ offers: ContinuationOffer[];
1518
+ } | undefined;
1519
+ }>) | undefined;
1185
1520
  };
1186
1521
  /** End their own subscription when its period ends (web only). */
1187
1522
  useCancelSubscription(): {
@@ -1202,6 +1537,8 @@ declare function allCoursesHooks(react: {
1202
1537
  } | undefined;
1203
1538
  isPending: boolean;
1204
1539
  error: unknown;
1540
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1541
+ reset?: () => void;
1205
1542
  };
1206
1543
  /** Undo that, before the period ends (web only). */
1207
1544
  useResumeSubscription(): {
@@ -1220,6 +1557,8 @@ declare function allCoursesHooks(react: {
1220
1557
  } | undefined;
1221
1558
  isPending: boolean;
1222
1559
  error: unknown;
1560
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1561
+ reset?: () => void;
1223
1562
  };
1224
1563
  /** The provider's portal for their card and past invoices (web only, never in a frame). */
1225
1564
  useBillingPortal(): {
@@ -1236,6 +1575,8 @@ declare function allCoursesHooks(react: {
1236
1575
  } | undefined;
1237
1576
  isPending: boolean;
1238
1577
  error: unknown;
1578
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1579
+ reset?: () => void;
1239
1580
  };
1240
1581
  /** Staff: a course's working copy, as the builder edits it. */
1241
1582
  useWorkingCopy(courseId: string): {
@@ -1245,6 +1586,13 @@ declare function allCoursesHooks(react: {
1245
1586
  } | undefined;
1246
1587
  isPending: boolean;
1247
1588
  error: unknown;
1589
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1590
+ refetch?: (() => Promise<{
1591
+ data: {
1592
+ id: string;
1593
+ values: Record<string, unknown>;
1594
+ } | undefined;
1595
+ }>) | undefined;
1248
1596
  };
1249
1597
  /** Staff: save the course's working copy (its outline). */
1250
1598
  useSaveOutline(): {
@@ -1267,6 +1615,8 @@ declare function allCoursesHooks(react: {
1267
1615
  } | undefined;
1268
1616
  isPending: boolean;
1269
1617
  error: unknown;
1618
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1619
+ reset?: () => void;
1270
1620
  };
1271
1621
  /** Staff: publish the course (a person; an assistant's request waits for one). */
1272
1622
  usePublishCourse(): {
@@ -1289,6 +1639,8 @@ declare function allCoursesHooks(react: {
1289
1639
  } | undefined;
1290
1640
  isPending: boolean;
1291
1641
  error: unknown;
1642
+ /** Forgets the call: its variables and its answer (TanStack Query's `reset`). */
1643
+ reset?: () => void;
1292
1644
  };
1293
1645
  /** Staff: the library's ready videos, to pick a lesson's video. */
1294
1646
  useLibraryVideos(): {
@@ -1301,6 +1653,16 @@ declare function allCoursesHooks(react: {
1301
1653
  } | undefined;
1302
1654
  isPending: boolean;
1303
1655
  error: unknown;
1656
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1657
+ refetch?: (() => Promise<{
1658
+ data: {
1659
+ items: {
1660
+ id: string;
1661
+ values: Record<string, unknown>;
1662
+ }[];
1663
+ nextCursor: string | null;
1664
+ } | undefined;
1665
+ }>) | undefined;
1304
1666
  };
1305
1667
  /** Staff: the published Programs programs, to pick a session lesson's program. */
1306
1668
  usePublishedPrograms(): {
@@ -1313,6 +1675,16 @@ declare function allCoursesHooks(react: {
1313
1675
  } | undefined;
1314
1676
  isPending: boolean;
1315
1677
  error: unknown;
1678
+ /** Asks again now (TanStack Query's `refetch`): the subscribe block's offers after a sign-in. */
1679
+ refetch?: (() => Promise<{
1680
+ data: {
1681
+ items: {
1682
+ id: string;
1683
+ title?: string | null;
1684
+ values: Record<string, unknown>;
1685
+ }[];
1686
+ } | undefined;
1687
+ }>) | undefined;
1316
1688
  };
1317
1689
  };
1318
1690
  /** Every hook of this entry. A block takes the ones it calls: `Pick<CoursesHooks, "useLesson">`. */