@read-frog/api-contract 0.21.1 → 0.23.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/dist/index.js CHANGED
@@ -1,21 +1,119 @@
1
1
  import { eventIterator, oc } from "@orpc/contract";
2
- import { BETA_FEATURE_KEYS, EBOOK_ALLOWED_COVER_CONTENT_TYPES, NOTEBASE_COLUMN_MAX_WIDTH, NOTEBASE_COLUMN_MIN_WIDTH, SRS_REVIEW_DURATION_MS_MAX, activeScheduleStatusSchema, cardIdentityShape, cardMemoryStateShape, cardStateSchema, cardStateSchema as cardStateSchema$1, cardTemplateConfigSchema, cardTemplateCreatedBySchema, fsrsMemoryStateSchema, fsrsReviewLogSnapshotSchema, getVideoIdFromUrl, langCodeISO6393Schema, notebaseColumnConfigSchema, reviewRatingSchema, scheduleStatusSchema, scheduleStatusSchema as scheduleStatusSchema$1, schedulingParamsSchema, schedulingParamsShape, srsModelVersionSchema, srsStepSchema, srsWeightsSchema, transcriptSegmentSchema } from "@read-frog/definitions";
3
2
  import { z } from "zod";
4
- //#region src/schemas/beta-access.ts
5
- const BetaFeatureKeySchema = z.enum(BETA_FEATURE_KEYS);
6
- const BetaAccessStatusInputSchema = z.object({ featureKey: BetaFeatureKeySchema }).strict();
7
- const BetaAccessStatusOutputSchema = z.object({
8
- featureKey: BetaFeatureKeySchema,
9
- allowed: z.boolean()
10
- });
3
+ import { EBOOK_ALLOWED_COVER_CONTENT_TYPES, GATED_FEATURE_KEYS, NOTEBASE_COLUMN_MAX_WIDTH, NOTEBASE_COLUMN_MIN_WIDTH, SRS_REVIEW_DURATION_MS_MAX, activeScheduleStatusSchema, canonicalTimeZone, cardIdentityShape, cardMemoryStateShape, cardStateSchema, cardStateSchema as cardStateSchema$1, cardTemplateConfigSchema, cardTemplateCreatedBySchema, fsrsMemoryStateSchema, fsrsReviewLogSnapshotSchema, getVideoIdFromUrl, langCodeISO6393Schema, notebaseColumnConfigSchema, reviewRatingSchema, scheduleStatusSchema, scheduleStatusSchema as scheduleStatusSchema$1, schedulingParamsSchema, schedulingParamsShape, srsModelVersionSchema, srsStepSchema, srsWeightsSchema, transcriptSegmentSchema } from "@read-frog/definitions";
4
+ //#region src/schemas/app-locale.ts
5
+ /**
6
+ * The languages the website is in (`project.inlang/settings.json`; a test in
7
+ * apps/www keeps the two in step). Used wherever the server writes for a
8
+ * person: Stripe pages, emails, and the account's `locale`.
9
+ */
10
+ const appLocaleSchema = z.enum([
11
+ "en",
12
+ "es",
13
+ "ja",
14
+ "ko",
15
+ "ru",
16
+ "tr",
17
+ "vi",
18
+ "zh",
19
+ "zh-TW"
20
+ ]);
11
21
  //#endregion
12
- //#region src/contracts/beta-access.ts
13
- const betaAccessContract = { status: oc.route({
14
- method: "GET",
15
- path: "/beta-access/status",
16
- summary: "Get beta access status for a feature",
17
- tags: ["Beta Access"]
18
- }).input(BetaAccessStatusInputSchema).output(BetaAccessStatusOutputSchema) };
22
+ //#region src/schemas/billing.ts
23
+ const billingIntervalSchema = z.enum(["month", "year"]);
24
+ const billingSubscriptionStatusSchema = z.enum([
25
+ "incomplete",
26
+ "incomplete_expired",
27
+ "trialing",
28
+ "active",
29
+ "past_due",
30
+ "canceled",
31
+ "unpaid",
32
+ "paused"
33
+ ]);
34
+ const billingPlanSchema = z.enum([
35
+ "free",
36
+ "pro",
37
+ "ultra"
38
+ ]);
39
+ /**
40
+ * How many MCP tool calls each plan may make in a day (24 hours from the first
41
+ * one); `null` is no limit. Each `tools/call` counts once, whatever the tool.
42
+ *
43
+ * Read by the MCP server's gate AND by the website's copy, so the pages cannot
44
+ * promise calls the server refuses.
45
+ *
46
+ * Companion edit when this changes: the MCP docs under
47
+ * `apps/www/content/docs/mcp/` and `account-and-plans`, which state the numbers.
48
+ */
49
+ const MCP_DAILY_CALL_LIMITS = {
50
+ free: 10,
51
+ pro: 50,
52
+ ultra: null
53
+ };
54
+ const billingCheckoutPlanSchema = z.enum(["pro", "ultra"]);
55
+ const billingCurrencySchema = z.enum([
56
+ "usd",
57
+ "cad",
58
+ "cny"
59
+ ]);
60
+ const billingLocaleSchema = appLocaleSchema;
61
+ const billingAccessSourceSchema = z.enum(["subscription", "pass"]);
62
+ const billingScheduledChangeSchema = z.object({
63
+ plan: billingCheckoutPlanSchema,
64
+ interval: billingIntervalSchema,
65
+ effectiveAt: z.coerce.date()
66
+ }).strict();
67
+ /**
68
+ * The zone a payment deadline is shown in, as a date with no time. UTC−12 is
69
+ * the last zone to finish a day, and `dueBy` is the end of a day there, so the
70
+ * date it shows stays open in every customer's zone until their own midnight.
71
+ */
72
+ const BILLING_PAYMENT_DUE_TIME_ZONE = "Etc/GMT+12";
73
+ /**
74
+ * A renewal whose payment failed. The plan stays until `dueBy`; paying the
75
+ * invoice before then (or later, until the subscription is canceled) restores
76
+ * the subscription as if the payment had gone through.
77
+ */
78
+ const billingPaymentDueSchema = z.object({
79
+ /** The last instant of the plan; show it in BILLING_PAYMENT_DUE_TIME_ZONE. */
80
+ dueBy: z.coerce.date(),
81
+ /**
82
+ * The plan the payment keeps. Not `BillingStatus.plan`: past `dueBy` that
83
+ * already reads "free" while the invoice is still payable.
84
+ */
85
+ plan: billingCheckoutPlanSchema,
86
+ /** The Stripe-hosted page that pays the invoice; null if Stripe gave none. */
87
+ url: z.url().nullable()
88
+ }).strict();
89
+ const billingStatusSchema = z.object({
90
+ plan: billingPlanSchema,
91
+ status: billingSubscriptionStatusSchema.nullable(),
92
+ interval: billingIntervalSchema.nullable(),
93
+ currentPeriodEnd: z.coerce.date().nullable(),
94
+ /**
95
+ * When the subscription terminates, or null if it renews. Replaces the
96
+ * `cancelAtPeriodEnd` boolean: Stripe deprecated its counterpart and the
97
+ * Customer Portal no longer sets it, and the termination date is not always
98
+ * `currentPeriodEnd` — a stacked pass pushes that past the cancellation.
99
+ */
100
+ cancelAt: z.coerce.date().nullable(),
101
+ accessSource: billingAccessSourceSchema.nullable(),
102
+ scheduledChange: billingScheduledChangeSchema.nullable(),
103
+ paymentDue: billingPaymentDueSchema.nullable(),
104
+ unlimitedNotebaseNotes: z.boolean(),
105
+ notebaseNoteLimit: z.number().int().positive(),
106
+ notebaseNoteCount: z.number().int().min(0)
107
+ }).strict();
108
+ const billingCreateCheckoutSessionInputSchema = z.object({
109
+ currency: billingCurrencySchema,
110
+ interval: billingIntervalSchema,
111
+ locale: appLocaleSchema,
112
+ plan: billingCheckoutPlanSchema.default("pro")
113
+ }).strict();
114
+ const billingCreateCustomerPortalSessionInputSchema = z.object({ locale: appLocaleSchema }).strict();
115
+ const billingSessionUrlOutputSchema = z.object({ url: z.url() }).strict();
116
+ const billingCancelScheduledChangeOutputSchema = z.object({ success: z.literal(true) }).strict();
19
117
  //#endregion
20
118
  //#region src/schemas/hosted-ai.ts
21
119
  const HostedAiOutputFieldTypeSchema = z.enum(["string", "number"]);
@@ -152,12 +250,23 @@ const HOSTED_AI_CLIENT_STREAM_PART_TYPES = [
152
250
  * useful response rather than a validation error.
153
251
  */
154
252
  const HostedAiStatusInputSchema = z.object({});
253
+ /**
254
+ * `pro_required` means the Pro plan or any plan above it; `ultra_required`
255
+ * means Ultra. Appended last, so a client that predates a value falls back on
256
+ * its own default instead of misreading it.
257
+ */
155
258
  const HostedAiUnavailableReasonSchema = z.enum([
156
259
  "authentication_required",
157
260
  "ultra_required",
158
261
  "quota_exhausted",
159
- "service_unavailable"
262
+ "service_unavailable",
263
+ "pro_required"
160
264
  ]);
265
+ /**
266
+ * The cheapest plan an account would need to buy for something it cannot use
267
+ * now. Any plan above it works too, so `pro` reads as "Pro or Ultra".
268
+ */
269
+ const HostedAiUpgradePlanSchema = billingPlanSchema.exclude(["free"]);
161
270
  const HostedAiCreditPolicyIdSchema = z.enum([
162
271
  "custom-action-guest-daily-v1",
163
272
  "custom-action-user-daily-v1",
@@ -184,13 +293,16 @@ const HostedAiRateLimitErrorDataSchema = z.object({
184
293
  quotaScope: HostedAiQuotaScopeSchema
185
294
  });
186
295
  /**
296
+ * A recurring pool: the plan's credit for a day or a week, which refills at
297
+ * `resetAt`.
298
+ *
187
299
  * Deliberately free of dollar amounts and of the versioned policy id. Clients
188
300
  * render a consumption bar and a reset time, so a percentage and a period kind
189
301
  * are all they need, and neither leaks what a call costs us. `usedPercent`
190
302
  * counts settled spend only: including in-flight reservations would make the
191
303
  * bar jump forward and then back as each stream settles.
192
304
  */
193
- const HostedAiCreditStatusSchema = z.strictObject({
305
+ const HostedAiRecurringCreditStatusSchema = z.strictObject({
194
306
  periodKind: HostedAiCreditPeriodKindSchema,
195
307
  usedPercent: z.number().min(0).max(100),
196
308
  resetAt: z.iso.datetime().nullable(),
@@ -201,15 +313,42 @@ const HostedAiCreditStatusSchema = z.strictObject({
201
313
  */
202
314
  features: z.array(HostedAiFeatureSchema).min(1)
203
315
  });
316
+ /**
317
+ * A one-time pool, such as credit from a campaign or from support. It never
318
+ * refills: once spent or past `expiresAt` it is gone, so a client shows the
319
+ * expiry, not a reset. It is drawn on only after the plan's own pool for a
320
+ * feature is spent, or for a feature the plan does not fund. Listed until it
321
+ * expires, even when spent. Same fields as a recurring pool otherwise.
322
+ */
323
+ const HostedAiOneTimeCreditStatusSchema = z.strictObject({
324
+ periodKind: z.literal("once"),
325
+ usedPercent: z.number().min(0).max(100),
326
+ expiresAt: z.iso.datetime(),
327
+ features: z.array(HostedAiFeatureSchema).min(1)
328
+ });
329
+ /**
330
+ * One pool that can pay for Built-in AI, told apart by `periodKind`: a
331
+ * recurring `daily` or `weekly` pool refills at `resetAt`, a one-time (`once`)
332
+ * pool ends at `expiresAt`. Narrow on `periodKind` before reading either.
333
+ */
334
+ const HostedAiCreditPoolStatusSchema = z.discriminatedUnion("periodKind", [HostedAiRecurringCreditStatusSchema, HostedAiOneTimeCreditStatusSchema]);
204
335
  const HostedAiTierStatusSchema = z.strictObject({
205
336
  accessAllowed: z.boolean(),
206
337
  available: z.boolean(),
207
338
  unavailableReason: HostedAiUnavailableReasonSchema.nullable(),
208
339
  /**
209
- * Viewer-independent product fact: no non-Ultra account can ever use this
210
- * feature/tier, so signing in alone will not unlock it. Unlike the fields
211
- * above, this does not vary with the caller's identity or plan — clients use
212
- * it to label Ultra-only options rather than to gate the current user.
340
+ * The cheapest plan this account would need to use the tier, or null when it
341
+ * needs none: its plan or a one-time pool already covers it, or the tier is
342
+ * open to every signed-in account. For a guest it is the plan needed after
343
+ * signing in. Clients badge an option with it and offer that plan.
344
+ */
345
+ upgradeTo: HostedAiUpgradePlanSchema.nullable(),
346
+ /**
347
+ * @deprecated Read `upgradeTo`. Viewer-independent product fact: no
348
+ * non-Ultra account can ever use this feature/tier. Extensions released
349
+ * before `upgradeTo` badge options with it, including for Ultra accounts.
350
+ *
351
+ * TODO(2026-11-21): remove once those extensions have drained (#710).
213
352
  */
214
353
  requiresUltra: z.boolean(),
215
354
  modelRevision: z.string().trim().min(1)
@@ -219,7 +358,21 @@ const HostedAiFeatureStatusSchema = z.strictObject({
219
358
  advance: HostedAiTierStatusSchema
220
359
  });
221
360
  const HostedAiStatusOutputSchema = z.strictObject({
222
- credits: z.array(HostedAiCreditStatusSchema),
361
+ /**
362
+ * @deprecated Read `pools`. This lists the recurring pools only, never a
363
+ * one-time one: extensions released before mengxi-ream/read-frog#2395 look
364
+ * up a label for every entry's `periodKind`, and one they do not know
365
+ * crashes their usage page. They also throw if the field is missing.
366
+ *
367
+ * TODO(2026-11-07): remove once those extensions have drained (#710).
368
+ */
369
+ credits: z.array(HostedAiRecurringCreditStatusSchema),
370
+ /**
371
+ * Everything that can pay for a feature, in the order the server draws on it:
372
+ * the plan's recurring pools first, then one-time pools by soonest expiry. A
373
+ * feature can appear in several entries.
374
+ */
375
+ pools: z.array(HostedAiCreditPoolStatusSchema),
223
376
  features: z.strictObject({
224
377
  pageTranslation: HostedAiFeatureStatusSchema,
225
378
  customAction: HostedAiFeatureStatusSchema,
@@ -263,7 +416,11 @@ const CardTemplateNotebaseColumnInUseDataSchema = z.object({ templates: z.array(
263
416
  id: z.uuid(),
264
417
  name: z.string()
265
418
  }).strict()) }).strict();
266
- const HostedAiTierRestrictedDataSchema = z.strictObject({ modelTier: HostedAiModelTierSchema });
419
+ const HostedAiTierRestrictedDataSchema = z.strictObject({
420
+ modelTier: HostedAiModelTierSchema,
421
+ /** The cheapest plan that unlocks it; a client offers "Pro or Ultra" for `pro`. */
422
+ upgradeTo: HostedAiUpgradePlanSchema
423
+ });
267
424
  const HostedAiQuotaExhaustedDataSchema = z.strictObject({
268
425
  modelTier: HostedAiModelTierSchema,
269
426
  policyId: HostedAiCreditPolicyIdSchema,
@@ -297,18 +454,10 @@ const PUBLIC_APP_ERROR_DEFS = {
297
454
  message: "Built-in AI credit exhausted",
298
455
  status: 429
299
456
  },
300
- NOTEBASE_BETA_RESTRICTED: {
301
- message: "Notebase is currently in beta for selected accounts",
302
- status: 403
303
- },
304
457
  NOTEBASE_NOT_FOUND: {
305
458
  message: "Notebase not found",
306
459
  status: 404
307
460
  },
308
- VIDEO_TRANSCRIPTION_BETA_RESTRICTED: {
309
- message: "Video transcription is currently in beta for selected accounts",
310
- status: 403
311
- },
312
461
  VIDEO_TRANSCRIPTION_SUBSCRIPTION_REQUIRED: {
313
462
  message: "AI subtitles require a Pro or Ultra subscription",
314
463
  status: 403
@@ -461,6 +610,10 @@ const PUBLIC_APP_ERROR_DEFS = {
461
610
  EBOOK_UPLOAD_NOT_COMPLETED: {
462
611
  message: "Ebook upload has not been completed",
463
612
  status: 409
613
+ },
614
+ EMAIL_LINK_INVALID: {
615
+ message: "This email link is not valid",
616
+ status: 400
464
617
  }
465
618
  };
466
619
  function isPublicAppErrorCode(code) {
@@ -484,98 +637,6 @@ function pickPublicErrorMap(...codes) {
484
637
  }));
485
638
  }
486
639
  //#endregion
487
- //#region src/schemas/billing.ts
488
- const billingIntervalSchema = z.enum(["month", "year"]);
489
- const billingSubscriptionStatusSchema = z.enum([
490
- "incomplete",
491
- "incomplete_expired",
492
- "trialing",
493
- "active",
494
- "past_due",
495
- "canceled",
496
- "unpaid",
497
- "paused"
498
- ]);
499
- const billingPlanSchema = z.enum([
500
- "free",
501
- "pro",
502
- "ultra"
503
- ]);
504
- /**
505
- * Whether a plan may use a feature, given the plans that feature allows.
506
- *
507
- * An explicit set rather than a minimum tier: there is no rank table to keep in
508
- * step with the plan enum, and any combination is expressible by writing it
509
- * down. The cost is that nothing derives from it automatically -- a feature's
510
- * pricing-card placement is a companion edit, noted at each `*_ALLOWED_PLANS`.
511
- */
512
- function isPlanAllowed(plan, allowed) {
513
- return allowed.includes(plan);
514
- }
515
- /**
516
- * Plans that may use the remote MCP server.
517
- *
518
- * Read by the server-side gate AND by the website's copy, so the page cannot
519
- * promise access the API refuses. `satisfies` keeps the literal tuple type so
520
- * the UI can render the plan names from this constant instead of hardcoding
521
- * them.
522
- *
523
- * Companion edit when this changes: the feature bullet in
524
- * `apps/www/src/routes/pricing.tsx` lives on the lowest allowed plan's card
525
- * (higher cards inherit it through their "everything in <lower plan>" line).
526
- */
527
- const MCP_ALLOWED_PLANS = ["ultra"];
528
- const billingCheckoutPlanSchema = z.enum(["pro", "ultra"]);
529
- const billingCurrencySchema = z.enum([
530
- "usd",
531
- "cad",
532
- "cny"
533
- ]);
534
- const billingLocaleSchema = z.enum([
535
- "en",
536
- "es",
537
- "ja",
538
- "ko",
539
- "ru",
540
- "tr",
541
- "vi",
542
- "zh",
543
- "zh-TW"
544
- ]);
545
- const billingAccessSourceSchema = z.enum(["subscription", "pass"]);
546
- const billingScheduledChangeSchema = z.object({
547
- plan: billingCheckoutPlanSchema,
548
- interval: billingIntervalSchema,
549
- effectiveAt: z.coerce.date()
550
- }).strict();
551
- const billingStatusSchema = z.object({
552
- plan: billingPlanSchema,
553
- status: billingSubscriptionStatusSchema.nullable(),
554
- interval: billingIntervalSchema.nullable(),
555
- currentPeriodEnd: z.coerce.date().nullable(),
556
- /**
557
- * When the subscription terminates, or null if it renews. Replaces the
558
- * `cancelAtPeriodEnd` boolean: Stripe deprecated its counterpart and the
559
- * Customer Portal no longer sets it, and the termination date is not always
560
- * `currentPeriodEnd` — a stacked pass pushes that past the cancellation.
561
- */
562
- cancelAt: z.coerce.date().nullable(),
563
- accessSource: billingAccessSourceSchema.nullable(),
564
- scheduledChange: billingScheduledChangeSchema.nullable(),
565
- unlimitedNotebaseNotes: z.boolean(),
566
- notebaseNoteLimit: z.number().int().positive(),
567
- notebaseNoteCount: z.number().int().min(0)
568
- }).strict();
569
- const billingCreateCheckoutSessionInputSchema = z.object({
570
- currency: billingCurrencySchema,
571
- interval: billingIntervalSchema,
572
- locale: billingLocaleSchema,
573
- plan: billingCheckoutPlanSchema.default("pro")
574
- }).strict();
575
- const billingCreateCustomerPortalSessionInputSchema = z.object({ locale: billingLocaleSchema }).strict();
576
- const billingSessionUrlOutputSchema = z.object({ url: z.url() }).strict();
577
- const billingCancelScheduledChangeOutputSchema = z.object({ success: z.literal(true) }).strict();
578
- //#endregion
579
640
  //#region src/contracts/billing.ts
580
641
  const billingProcedure = oc.errors(pickPublicErrorMap("BILLING_NOT_CONFIGURED", "BILLING_CUSTOMER_NOT_FOUND", "BILLING_PASS_ACTIVE", "BILLING_CHANGE_SCHEDULED"));
581
642
  const billingContract = {
@@ -797,20 +858,24 @@ const ebookRequestUploadInputSchema = z.object({
797
858
  title: z.string().min(1).max(500),
798
859
  author: z.string().max(500).optional(),
799
860
  language: z.string().max(35).optional(),
800
- coverContentType: ebookCoverContentTypeSchema.optional()
861
+ fileByteSize: z.number().int().min(1),
862
+ cover: z.object({
863
+ contentType: ebookCoverContentTypeSchema,
864
+ byteSize: z.number().int().min(1)
865
+ }).strict().optional()
801
866
  }).strict();
802
867
  /**
803
- * S3 POST form policy. `fields` must be appended to the form in iteration order
804
- * with the file last; S3 ignores anything sent after the `file` part.
868
+ * A signed PUT: send the file to `url` with exactly `headers`. The signature
869
+ * covers the file's type and exact size, so storage refuses any other file.
805
870
  */
806
- const ebookPresignedPostSchema = z.object({
871
+ const ebookPresignedUploadSchema = z.object({
807
872
  url: z.url(),
808
- fields: z.record(z.string(), z.string())
873
+ headers: z.record(z.string(), z.string())
809
874
  }).strict();
810
875
  const ebookRequestUploadOutputSchema = z.object({
811
876
  ebookId: z.uuid(),
812
- upload: ebookPresignedPostSchema,
813
- coverUpload: ebookPresignedPostSchema.nullable(),
877
+ upload: ebookPresignedUploadSchema,
878
+ coverUpload: ebookPresignedUploadSchema.nullable(),
814
879
  expiresAt: z.coerce.date()
815
880
  }).strict();
816
881
  const ebookFinalizeUploadInputSchema = z.object({ ebookId: z.uuid() }).strict();
@@ -850,7 +915,7 @@ const ebookContract = {
850
915
  summary: "Get an ebook with reading progress",
851
916
  tags: ["Ebooks"]
852
917
  }).input(ebookGetInputSchema).output(ebookGetOutputSchema),
853
- requestUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_LIMIT_EXCEEDED")).route({
918
+ requestUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_LIMIT_EXCEEDED", "EBOOK_FILE_TOO_LARGE")).route({
854
919
  method: "POST",
855
920
  path: "/ebooks/uploads",
856
921
  summary: "Request presigned upload URLs for a new ebook",
@@ -888,6 +953,95 @@ const ebookContract = {
888
953
  }).input(ebookDeleteInputSchema).output(ebookDeleteOutputSchema)
889
954
  };
890
955
  //#endregion
956
+ //#region src/schemas/email-preferences.ts
957
+ /** A category's key, such as `promotions`. */
958
+ const emailCategoryKeySchema = z.string().max(64).regex(/^[a-z][a-z0-9_]*$/);
959
+ /** The token in an email's unsubscribe link. */
960
+ const emailLinkTokenSchema = z.string().min(1).max(1024);
961
+ const emailCategoryStateSchema = z.object({
962
+ key: z.string(),
963
+ name: z.string(),
964
+ description: z.string().nullable(),
965
+ commercial: z.boolean(),
966
+ required: z.boolean(),
967
+ subscribed: z.boolean()
968
+ }).strict();
969
+ const emailPreferencesStateSchema = z.object({
970
+ categories: z.array(emailCategoryStateSchema),
971
+ unsubscribedAll: z.boolean()
972
+ }).strict();
973
+ /**
974
+ * What the page a link opens shows on top of the state: whose preferences they
975
+ * are, without the full address, and the category the link was for, if any.
976
+ */
977
+ const emailPreferencesByTokenStateSchema = z.object({
978
+ ...emailPreferencesStateSchema.shape,
979
+ maskedEmail: z.string(),
980
+ highlightCategory: z.string().nullable()
981
+ }).strict();
982
+ const emailPreferencesChangesShape = {
983
+ categories: z.record(emailCategoryKeySchema, z.boolean()).optional(),
984
+ unsubscribedAll: z.boolean().optional()
985
+ };
986
+ const emailPreferencesGetInputSchema = z.object({ locale: appLocaleSchema }).strict();
987
+ const emailPreferencesUpdateInputSchema = z.object({
988
+ locale: appLocaleSchema,
989
+ ...emailPreferencesChangesShape
990
+ }).strict();
991
+ const emailPreferencesGetByTokenInputSchema = z.object({
992
+ token: emailLinkTokenSchema,
993
+ locale: appLocaleSchema
994
+ }).strict();
995
+ const emailPreferencesUpdateByTokenInputSchema = z.object({
996
+ token: emailLinkTokenSchema,
997
+ locale: appLocaleSchema,
998
+ ...emailPreferencesChangesShape
999
+ }).strict();
1000
+ //#endregion
1001
+ //#region src/contracts/email-preferences.ts
1002
+ const emailPreferencesContract = {
1003
+ get: oc.route({
1004
+ method: "GET",
1005
+ path: "/users/me/email-preferences",
1006
+ summary: "Get which emails the authenticated user receives",
1007
+ tags: ["Email preferences"]
1008
+ }).input(emailPreferencesGetInputSchema).output(emailPreferencesStateSchema),
1009
+ update: oc.route({
1010
+ method: "PATCH",
1011
+ path: "/users/me/email-preferences",
1012
+ summary: "Change which emails the authenticated user receives",
1013
+ tags: ["Email preferences"]
1014
+ }).input(emailPreferencesUpdateInputSchema).output(emailPreferencesStateSchema),
1015
+ getByToken: oc.route({
1016
+ method: "POST",
1017
+ path: "/email-preferences/by-token",
1018
+ summary: "Get the email preferences an email link is for",
1019
+ tags: ["Email preferences"]
1020
+ }).errors(pickPublicErrorMap("EMAIL_LINK_INVALID")).input(emailPreferencesGetByTokenInputSchema).output(emailPreferencesByTokenStateSchema),
1021
+ updateByToken: oc.route({
1022
+ method: "POST",
1023
+ path: "/email-preferences/by-token/update",
1024
+ summary: "Change the email preferences an email link is for",
1025
+ tags: ["Email preferences"]
1026
+ }).errors(pickPublicErrorMap("EMAIL_LINK_INVALID")).input(emailPreferencesUpdateByTokenInputSchema).output(emailPreferencesByTokenStateSchema)
1027
+ };
1028
+ //#endregion
1029
+ //#region src/schemas/feature-access.ts
1030
+ const GatedFeatureKeySchema = z.enum(GATED_FEATURE_KEYS);
1031
+ const FeatureAccessStatusInputSchema = z.object({ featureKey: GatedFeatureKeySchema }).strict();
1032
+ const FeatureAccessStatusOutputSchema = z.object({
1033
+ featureKey: GatedFeatureKeySchema,
1034
+ allowed: z.boolean()
1035
+ });
1036
+ //#endregion
1037
+ //#region src/contracts/feature-access.ts
1038
+ const featureAccessContract = { status: oc.route({
1039
+ method: "GET",
1040
+ path: "/feature-access/status",
1041
+ summary: "Get whether the caller can use a gated feature",
1042
+ tags: ["Feature Access"]
1043
+ }).input(FeatureAccessStatusInputSchema).output(FeatureAccessStatusOutputSchema) };
1044
+ //#endregion
891
1045
  //#region src/contracts/hosted-ai.ts
892
1046
  const hostedAiStreamErrors = pickPublicErrorMap("HOSTED_AI_TIER_RESTRICTED", "HOSTED_AI_QUOTA_EXHAUSTED");
893
1047
  const hostedAiContract = {
@@ -1265,6 +1419,7 @@ const notebaseSchema = z.object({
1265
1419
  srsEnableFuzz: schedulingParamsShape.enableFuzz,
1266
1420
  srsWeights: srsWeightsSchema.nullable(),
1267
1421
  srsModelVersion: srsModelVersionSchema,
1422
+ srsSleepingAt: z.date().nullable(),
1268
1423
  createdAt: z.date(),
1269
1424
  updatedAt: z.date()
1270
1425
  });
@@ -1325,6 +1480,11 @@ const NotebaseUpdateOutputSchema = z.object({
1325
1480
  notebase: notebaseSchema,
1326
1481
  txid: z.number()
1327
1482
  });
1483
+ const NotebaseSetSleepInputSchema = z.object({
1484
+ id: z.uuid(),
1485
+ enabled: z.boolean()
1486
+ }).strict();
1487
+ const NotebaseSetSleepOutputSchema = z.object({ txid: z.number().nullable() });
1328
1488
  const NotebaseDeleteInputSchema = z.object({ id: z.uuid() });
1329
1489
  const NotebaseDeleteOutputSchema = deletionResultSchema;
1330
1490
  const NotebaseGetInputSchema = z.object({ id: z.uuid() });
@@ -1393,6 +1553,13 @@ const notebaseContract = {
1393
1553
  description: "Update the supplied name or public study settings of an owned notebase, preserving omitted properties.",
1394
1554
  tags: ["Notebases"]
1395
1555
  }).errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND")).input(NotebaseUpdateInputSchema).output(NotebaseUpdateOutputSchema),
1556
+ setSleep: defineAgentProcedure({
1557
+ method: "POST",
1558
+ path: "/notebases/{id}/sleep",
1559
+ summary: "Set notebase sleep",
1560
+ description: "Put an owned notebase to sleep (enabled=true) or wake it (enabled=false). A sleeping notebase is left out of the combined review; its cards, memory states and review history are unchanged and it can still be reviewed directly. A request matching the current state succeeds without a change.",
1561
+ tags: ["Notebases"]
1562
+ }).errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND")).input(NotebaseSetSleepInputSchema).output(NotebaseSetSleepOutputSchema),
1396
1563
  delete: defineAgentProcedure({
1397
1564
  method: "DELETE",
1398
1565
  path: "/notebases/{id}",
@@ -1565,8 +1732,14 @@ const speechSynthesizeInputSchema = z.object({
1565
1732
  language: langCodeISO6393Schema.optional(),
1566
1733
  voice: speechVoiceNameSchema.optional()
1567
1734
  }).strict();
1568
- /** The audio, as an MP3 file. */
1569
- const speechSynthesizeOutputSchema = z.file();
1735
+ /**
1736
+ * Where to download the audio, an MP3: a link to fetch at once, which stops
1737
+ * working at `expiresAt`.
1738
+ */
1739
+ const speechSynthesizeOutputSchema = z.object({
1740
+ url: z.url(),
1741
+ expiresAt: z.coerce.date()
1742
+ }).strict();
1570
1743
  //#endregion
1571
1744
  //#region src/contracts/speech.ts
1572
1745
  const speechContract = {
@@ -1591,7 +1764,7 @@ const speechContract = {
1591
1764
  synthesize: oc.route({
1592
1765
  method: "POST",
1593
1766
  path: "/speech/synthesize",
1594
- summary: "Read a text aloud, as MP3 audio",
1767
+ summary: "Read a text aloud, and link to its MP3 audio",
1595
1768
  tags: ["Speech"]
1596
1769
  }).input(speechSynthesizeInputSchema).output(speechSynthesizeOutputSchema)
1597
1770
  };
@@ -1621,6 +1794,24 @@ const timezoneSchema = z.string().trim().min(1).refine((timezone) => {
1621
1794
  return false;
1622
1795
  }
1623
1796
  }, "Invalid timezone");
1797
+ /**
1798
+ * The zone a call reckons days in, under the name an account's zone is stored
1799
+ * under (`canonicalTimeZone`): "Asia/Calcutta" arrives as "Asia/Kolkata" and
1800
+ * "CST" as "America/Chicago", names that Temporal and a Debian Postgres both
1801
+ * read. A fixed offset ("+08:00") is refused, as Postgres reads it with the
1802
+ * opposite sign and would put the call's days on the wrong side of UTC.
1803
+ */
1804
+ const canonicalTimezoneSchema = timezoneSchema.transform((timezone, ctx) => {
1805
+ const name = canonicalTimeZone(timezone);
1806
+ if (!name) {
1807
+ ctx.addIssue({
1808
+ code: "custom",
1809
+ message: "Use an IANA time zone identifier instead of a fixed UTC offset. See https://www.iana.org/time-zones"
1810
+ });
1811
+ return z.NEVER;
1812
+ }
1813
+ return name;
1814
+ });
1624
1815
  //#endregion
1625
1816
  //#region src/schemas/srs.ts
1626
1817
  const stepSchema = srsStepSchema;
@@ -1635,7 +1826,7 @@ const srsReviewInputSchema = z.object({
1635
1826
  id: z.uuid().optional(),
1636
1827
  rating: reviewRatingSchema,
1637
1828
  durationMs: z.number().int().min(0).max(SRS_REVIEW_DURATION_MS_MAX),
1638
- timezone: timezoneSchema
1829
+ timezone: canonicalTimezoneSchema
1639
1830
  }).strict();
1640
1831
  const srsRollbackReviewInputSchema = z.object({
1641
1832
  expectedReviewId: z.uuid().optional(),
@@ -1644,10 +1835,10 @@ const srsRollbackReviewInputSchema = z.object({
1644
1835
  const srsScheduleStatusStatsSchema = z.record(activeScheduleStatusSchema, z.number().int().min(0));
1645
1836
  const srsScheduleStatusStatsInputSchema = z.object({
1646
1837
  notebaseIds: z.array(z.uuid()).optional(),
1647
- timezone: timezoneSchema
1838
+ timezone: canonicalTimezoneSchema
1648
1839
  }).strict();
1649
1840
  const srsScheduleStatusStatsOutputSchema = z.record(z.uuid(), srsScheduleStatusStatsSchema);
1650
- const srsRecentNotebaseScheduleStatusStatsInputSchema = z.object({ timezone: timezoneSchema }).strict();
1841
+ const srsRecentNotebaseScheduleStatusStatsInputSchema = z.object({ timezone: canonicalTimezoneSchema }).strict();
1651
1842
  /** Null when the user has no notebase yet. */
1652
1843
  const srsRecentNotebaseScheduleStatusStatsOutputSchema = z.object({
1653
1844
  notebase: notebaseSummarySchema,
@@ -1848,7 +2039,7 @@ const statsInputSchema = z.object({
1848
2039
  notebaseIds: statsNotebaseIdsSchema.optional(),
1849
2040
  from: z.iso.date().optional(),
1850
2041
  to: z.iso.date(),
1851
- timezone: timezoneSchema
2042
+ timezone: canonicalTimezoneSchema
1852
2043
  }).strict().refine((input) => !input.from || input.from <= input.to, {
1853
2044
  message: "from must be before or equal to to",
1854
2045
  path: ["from"]
@@ -1888,6 +2079,13 @@ const userEnsureTimezoneOutputSchema = z.object({
1888
2079
  }).strict();
1889
2080
  const userUpdateTimezoneInputSchema = z.object({ timezone: timezoneSchema }).strict();
1890
2081
  const userUpdateTimezoneOutputSchema = z.object({ timezone: timezoneSchema }).strict();
2082
+ const userEnsureLocaleInputSchema = z.object({ locale: appLocaleSchema }).strict();
2083
+ const userEnsureLocaleOutputSchema = z.object({
2084
+ locale: appLocaleSchema,
2085
+ updated: z.boolean()
2086
+ }).strict();
2087
+ const userUpdateLocaleInputSchema = z.object({ locale: appLocaleSchema }).strict();
2088
+ const userUpdateLocaleOutputSchema = z.object({ locale: appLocaleSchema }).strict();
1891
2089
  //#endregion
1892
2090
  //#region src/contracts/user.ts
1893
2091
  const userContract = {
@@ -1902,7 +2100,19 @@ const userContract = {
1902
2100
  path: "/users/me/timezone",
1903
2101
  summary: "Update the authenticated user's timezone",
1904
2102
  tags: ["Users"]
1905
- }).input(userUpdateTimezoneInputSchema).output(userUpdateTimezoneOutputSchema)
2103
+ }).input(userUpdateTimezoneInputSchema).output(userUpdateTimezoneOutputSchema),
2104
+ ensureLocale: oc.route({
2105
+ method: "POST",
2106
+ path: "/users/me/locale/ensure",
2107
+ summary: "Ensure the authenticated user has a locale",
2108
+ tags: ["Users"]
2109
+ }).input(userEnsureLocaleInputSchema).output(userEnsureLocaleOutputSchema),
2110
+ updateLocale: oc.route({
2111
+ method: "PATCH",
2112
+ path: "/users/me/locale",
2113
+ summary: "Update the authenticated user's locale",
2114
+ tags: ["Users"]
2115
+ }).input(userUpdateLocaleInputSchema).output(userUpdateLocaleOutputSchema)
1906
2116
  };
1907
2117
  //#endregion
1908
2118
  //#region src/schemas/video-transcript.ts
@@ -1953,11 +2163,12 @@ const videoTranscriptUsageSchema = z.object({
1953
2163
  //#endregion
1954
2164
  //#region src/index.ts
1955
2165
  const contract = {
1956
- betaAccess: betaAccessContract,
1957
2166
  billing: billingContract,
1958
2167
  card: cardContract,
1959
2168
  cardTemplate: cardTemplateContract,
1960
2169
  ebook: ebookContract,
2170
+ emailPreferences: emailPreferencesContract,
2171
+ featureAccess: featureAccessContract,
1961
2172
  hostedAi: hostedAiContract,
1962
2173
  masteryGoal: masteryGoalContract,
1963
2174
  mcpConnection: mcpConnectionContract,
@@ -1996,6 +2207,6 @@ const contract = {
1996
2207
  }
1997
2208
  };
1998
2209
  //#endregion
1999
- export { BetaAccessStatusInputSchema, BetaAccessStatusOutputSchema, BetaFeatureKeySchema, CardGenerateInputSchema, CardGenerateOutputSchema, CardGetInputSchema, CardGetOutputSchema, CardListInputSchema, CardListOutputSchema, CardTemplateCreateInputSchema, CardTemplateCreateOutputSchema, CardTemplateDeleteInputSchema, CardTemplateDeleteOutputSchema, CardTemplateGetInputSchema, CardTemplateGetOutputSchema, CardTemplateInvalidColumnsDataSchema, CardTemplateInvalidLayoutDataSchema, CardTemplateListInputSchema, CardTemplateListOutputSchema, CardTemplateNotebaseColumnInUseDataSchema, CardTemplateUpdateInputSchema, CardTemplateUpdateOutputSchema, CellValidationFailedDataSchema, CellValidationFailureDetailsSchema, CellValidationFailureReasonSchema, DEFAULT_SPEECH_PREFERENCES, HOSTED_AI_CLIENT_STREAM_PART_TYPES, HOSTED_AI_NOTE_SUGGESTION_MAX_NOTES, HOSTED_AI_NOTE_SUGGESTION_MAX_NOTE_FIELDS, HostedAiCreditPeriodKindSchema, HostedAiCreditPolicyIdSchema, HostedAiCreditStatusSchema, HostedAiFeatureSchema, HostedAiFeatureStatusSchema, HostedAiModelTierSchema, HostedAiNoteSuggestionObjectSchema, HostedAiNoteSuggestionStreamInputSchema, HostedAiOutputFieldSchema, HostedAiOutputFieldTypeSchema, HostedAiQuotaExhaustedDataSchema, HostedAiQuotaScopeSchema, HostedAiRateLimitErrorDataSchema, HostedAiRequestIdSchema, HostedAiStatusInputSchema, HostedAiStatusOutputSchema, HostedAiStreamPartSchema, HostedAiStreamStructuredObjectInputSchema, HostedAiStreamTextInputSchema, HostedAiTierRestrictedDataSchema, HostedAiTierStatusSchema, HostedAiUnavailableReasonSchema, MASTERY_GOAL_TARGET_MAX, MCP_ALLOWED_PLANS, NOTEBASE_ROW_CREATE_MANY_MAX_ROWS, NOTEBASE_ROW_DELETE_MANY_MAX_ROWS, NOTEBASE_ROW_UPDATE_MANY_MAX_ROWS, NotebaseColumnCreateInputSchema, NotebaseColumnCreateOutputSchema, NotebaseColumnDeleteInputSchema, NotebaseColumnDeleteOutputSchema, NotebaseColumnReorderInputSchema, NotebaseColumnReorderOutputSchema, NotebaseColumnUpdateInputSchema, NotebaseColumnUpdateOutputSchema, NotebaseCreateInputSchema, NotebaseCreateOutputSchema, NotebaseDeleteInputSchema, NotebaseDeleteOutputSchema, NotebaseGetInputSchema, NotebaseGetOutputSchema, NotebaseGetSchemaInputSchema, NotebaseGetSchemaOutputSchema, NotebaseGetSummaryInputSchema, NotebaseGetSummaryOutputSchema, NotebaseListInputSchema, NotebaseListItemSchema, NotebaseListOutputSchema, NotebaseRowCreateInputSchema, NotebaseRowCreateManyInputSchema, NotebaseRowCreateManyOutputSchema, NotebaseRowCreateOutputSchema, NotebaseRowDeleteInputSchema, NotebaseRowDeleteManyInputSchema, NotebaseRowDeleteManyOutputSchema, NotebaseRowDeleteOutputSchema, NotebaseRowGetInputSchema, NotebaseRowGetOutputSchema, NotebaseRowListInputSchema, NotebaseRowListOutputSchema, NotebaseRowReorderInputSchema, NotebaseRowReorderOutputSchema, NotebaseRowUpdateInputSchema, NotebaseRowUpdateManyInputSchema, NotebaseRowUpdateManyOutputSchema, NotebaseRowUpdateOutputSchema, NotebaseUpdateInputSchema, NotebaseUpdateOutputSchema, PUBLIC_APP_ERROR_DEFS, SPEECH_DAILY_REQUEST_LIMITS, SPEECH_RATE_MAX, SPEECH_RATE_MIN, SPEECH_TEXT_MAX_LENGTH, SRS_REVIEW_CLIENT_ID_NAMESPACE, SRS_REVIEW_DURATION_MS_MAX, SpeechDailyLimitReachedDataSchema, activityStatsOutputSchema, billingAccessSourceSchema, billingCancelScheduledChangeOutputSchema, billingCheckoutPlanSchema, billingCreateCheckoutSessionInputSchema, billingCreateCustomerPortalSessionInputSchema, billingCurrencySchema, billingIntervalSchema, billingLocaleSchema, billingPlanSchema, billingScheduledChangeSchema, billingSessionUrlOutputSchema, billingStatusSchema, billingSubscriptionStatusSchema, cardSchema, cardStateSchema, cardTemplateSchema, contract, createSrsReviewClientId, defineAgentProcedure, deletionResultSchema, ebookCoverContentTypeSchema, ebookDeleteInputSchema, ebookDeleteOutputSchema, ebookDetailSchema, ebookFinalizeUploadInputSchema, ebookFinalizeUploadOutputSchema, ebookGetDownloadUrlInputSchema, ebookGetDownloadUrlOutputSchema, ebookGetInputSchema, ebookGetOutputSchema, ebookListInputSchema, ebookListItemSchema, ebookListOutputSchema, ebookPresignedPostSchema, ebookQuotaSchema, ebookRenameDataSchema, ebookRenameInputSchema, ebookRenameOutputSchema, ebookRequestUploadInputSchema, ebookRequestUploadOutputSchema, ebookStatusSchema, ebookUpdateProgressDataSchema, ebookUpdateProgressInputSchema, ebookUpdateProgressOutputSchema, expectedUpdatedAtSchema, getPublicErrorDefinition, isPlanAllowed, isPublicAppErrorCode, masteryGoalOutputSchema, masteryGoalTargetSchema, masteryGoalUpdateInputSchema, mcpConnectionListOutputSchema, mcpConnectionRevokeInputSchema, mcpConnectionRevokeOutputSchema, mcpConnectionSchema, notebaseActivityStatsItemSchema, notebaseActivityStatsOutputSchema, notebaseColumnCreateDataSchema, notebaseColumnSchema, notebaseColumnUpdateDataSchema, notebaseColumnWidthSchema, notebaseCreateDataSchema, notebaseRowCellsSchema, notebaseRowCreateDataSchema, notebaseRowGrowthStatsItemSchema, notebaseRowGrowthStatsOutputSchema, notebaseRowSchema, notebaseRowUpdateDataSchema, notebaseSchema, notebaseSummarySchema, notebaseUpdateDataSchema, notebaseViewConfigSchema, notebaseViewCreateDataSchema, notebaseViewFilterSchema, notebaseViewFiltersSchema, notebaseViewSchema, notebaseViewSortSchema, notebaseViewSortsSchema, notebaseViewTypeSchema, notebaseViewUpdateDataSchema, pageSchema, paginationShape, pickPublicErrorMap, renderedCardSchema, reviewRatingSchema, scheduleStatusSchema, schedulingParamsSchema, speechPreferencesSchema, speechPreferencesUpdateInputSchema, speechRateSchema, speechSynthesizeInputSchema, speechSynthesizeOutputSchema, speechVoiceGenderSchema, speechVoiceNameSchema, speechVoiceSchema, speechVoicesOutputSchema, srsAcknowledgeOptimizerResultsInputSchema, srsAcknowledgeOptimizerResultsOutputSchema, srsActivityStatsItemSchema, srsActivityStatsOutputSchema, srsListCardRevlogsInputSchema, srsListCardRevlogsOutputSchema, srsListUnreadOptimizerResultsInputSchema, srsListUnreadOptimizerResultsOutputSchema, srsManualCardStatusInputSchema, srsMemoryGrowthStatsItemSchema, srsMemoryGrowthStatsOutputSchema, srsOptimizerUnreadResultSchema, srsRecentNotebaseScheduleStatusStatsInputSchema, srsRecentNotebaseScheduleStatusStatsOutputSchema, srsReviewInputSchema, srsReviewOutputSchema, srsRevlogSchema, srsRevlogWithoutSnapshotSchema, srsRollbackReviewInputSchema, srsRollbackReviewOutputSchema, srsScheduleStatusStatsInputSchema, srsScheduleStatusStatsOutputSchema, srsScheduleStatusStatsSchema, srsSetCardBuriedInputSchema, srsSetCardBuriedOutputSchema, srsSetCardSuspendedInputSchema, srsSetCardSuspendedOutputSchema, srsTxidOutputSchema, statsInputSchema, stepSchema, timezoneSchema, userEnsureTimezoneInputSchema, userEnsureTimezoneOutputSchema, userUpdateTimezoneInputSchema, userUpdateTimezoneOutputSchema, videoTranscriptCreateInputSchema, videoTranscriptGetInputSchema, videoTranscriptResourceSchema, videoTranscriptStatusSchema, videoTranscriptSubtitlesSchema, videoTranscriptUsagePoolSchema, videoTranscriptUsageSchema };
2210
+ export { BILLING_PAYMENT_DUE_TIME_ZONE, CardGenerateInputSchema, CardGenerateOutputSchema, CardGetInputSchema, CardGetOutputSchema, CardListInputSchema, CardListOutputSchema, CardTemplateCreateInputSchema, CardTemplateCreateOutputSchema, CardTemplateDeleteInputSchema, CardTemplateDeleteOutputSchema, CardTemplateGetInputSchema, CardTemplateGetOutputSchema, CardTemplateInvalidColumnsDataSchema, CardTemplateInvalidLayoutDataSchema, CardTemplateListInputSchema, CardTemplateListOutputSchema, CardTemplateNotebaseColumnInUseDataSchema, CardTemplateUpdateInputSchema, CardTemplateUpdateOutputSchema, CellValidationFailedDataSchema, CellValidationFailureDetailsSchema, CellValidationFailureReasonSchema, DEFAULT_SPEECH_PREFERENCES, FeatureAccessStatusInputSchema, FeatureAccessStatusOutputSchema, GatedFeatureKeySchema, HOSTED_AI_CLIENT_STREAM_PART_TYPES, HOSTED_AI_NOTE_SUGGESTION_MAX_NOTES, HOSTED_AI_NOTE_SUGGESTION_MAX_NOTE_FIELDS, HostedAiCreditPeriodKindSchema, HostedAiCreditPolicyIdSchema, HostedAiCreditPoolStatusSchema, HostedAiFeatureSchema, HostedAiFeatureStatusSchema, HostedAiModelTierSchema, HostedAiNoteSuggestionObjectSchema, HostedAiNoteSuggestionStreamInputSchema, HostedAiOneTimeCreditStatusSchema, HostedAiOutputFieldSchema, HostedAiOutputFieldTypeSchema, HostedAiQuotaExhaustedDataSchema, HostedAiQuotaScopeSchema, HostedAiRateLimitErrorDataSchema, HostedAiRecurringCreditStatusSchema, HostedAiRequestIdSchema, HostedAiStatusInputSchema, HostedAiStatusOutputSchema, HostedAiStreamPartSchema, HostedAiStreamStructuredObjectInputSchema, HostedAiStreamTextInputSchema, HostedAiTierRestrictedDataSchema, HostedAiTierStatusSchema, HostedAiUnavailableReasonSchema, HostedAiUpgradePlanSchema, MASTERY_GOAL_TARGET_MAX, MCP_DAILY_CALL_LIMITS, NOTEBASE_ROW_CREATE_MANY_MAX_ROWS, NOTEBASE_ROW_DELETE_MANY_MAX_ROWS, NOTEBASE_ROW_UPDATE_MANY_MAX_ROWS, NotebaseColumnCreateInputSchema, NotebaseColumnCreateOutputSchema, NotebaseColumnDeleteInputSchema, NotebaseColumnDeleteOutputSchema, NotebaseColumnReorderInputSchema, NotebaseColumnReorderOutputSchema, NotebaseColumnUpdateInputSchema, NotebaseColumnUpdateOutputSchema, NotebaseCreateInputSchema, NotebaseCreateOutputSchema, NotebaseDeleteInputSchema, NotebaseDeleteOutputSchema, NotebaseGetInputSchema, NotebaseGetOutputSchema, NotebaseGetSchemaInputSchema, NotebaseGetSchemaOutputSchema, NotebaseGetSummaryInputSchema, NotebaseGetSummaryOutputSchema, NotebaseListInputSchema, NotebaseListItemSchema, NotebaseListOutputSchema, NotebaseRowCreateInputSchema, NotebaseRowCreateManyInputSchema, NotebaseRowCreateManyOutputSchema, NotebaseRowCreateOutputSchema, NotebaseRowDeleteInputSchema, NotebaseRowDeleteManyInputSchema, NotebaseRowDeleteManyOutputSchema, NotebaseRowDeleteOutputSchema, NotebaseRowGetInputSchema, NotebaseRowGetOutputSchema, NotebaseRowListInputSchema, NotebaseRowListOutputSchema, NotebaseRowReorderInputSchema, NotebaseRowReorderOutputSchema, NotebaseRowUpdateInputSchema, NotebaseRowUpdateManyInputSchema, NotebaseRowUpdateManyOutputSchema, NotebaseRowUpdateOutputSchema, NotebaseSetSleepInputSchema, NotebaseSetSleepOutputSchema, NotebaseUpdateInputSchema, NotebaseUpdateOutputSchema, PUBLIC_APP_ERROR_DEFS, SPEECH_DAILY_REQUEST_LIMITS, SPEECH_RATE_MAX, SPEECH_RATE_MIN, SPEECH_TEXT_MAX_LENGTH, SRS_REVIEW_CLIENT_ID_NAMESPACE, SRS_REVIEW_DURATION_MS_MAX, SpeechDailyLimitReachedDataSchema, activityStatsOutputSchema, appLocaleSchema, billingAccessSourceSchema, billingCancelScheduledChangeOutputSchema, billingCheckoutPlanSchema, billingCreateCheckoutSessionInputSchema, billingCreateCustomerPortalSessionInputSchema, billingCurrencySchema, billingIntervalSchema, billingLocaleSchema, billingPaymentDueSchema, billingPlanSchema, billingScheduledChangeSchema, billingSessionUrlOutputSchema, billingStatusSchema, billingSubscriptionStatusSchema, canonicalTimezoneSchema, cardSchema, cardStateSchema, cardTemplateSchema, contract, createSrsReviewClientId, defineAgentProcedure, deletionResultSchema, ebookCoverContentTypeSchema, ebookDeleteInputSchema, ebookDeleteOutputSchema, ebookDetailSchema, ebookFinalizeUploadInputSchema, ebookFinalizeUploadOutputSchema, ebookGetDownloadUrlInputSchema, ebookGetDownloadUrlOutputSchema, ebookGetInputSchema, ebookGetOutputSchema, ebookListInputSchema, ebookListItemSchema, ebookListOutputSchema, ebookPresignedUploadSchema, ebookQuotaSchema, ebookRenameDataSchema, ebookRenameInputSchema, ebookRenameOutputSchema, ebookRequestUploadInputSchema, ebookRequestUploadOutputSchema, ebookStatusSchema, ebookUpdateProgressDataSchema, ebookUpdateProgressInputSchema, ebookUpdateProgressOutputSchema, emailCategoryKeySchema, emailCategoryStateSchema, emailLinkTokenSchema, emailPreferencesByTokenStateSchema, emailPreferencesGetByTokenInputSchema, emailPreferencesGetInputSchema, emailPreferencesStateSchema, emailPreferencesUpdateByTokenInputSchema, emailPreferencesUpdateInputSchema, expectedUpdatedAtSchema, getPublicErrorDefinition, isPublicAppErrorCode, masteryGoalOutputSchema, masteryGoalTargetSchema, masteryGoalUpdateInputSchema, mcpConnectionListOutputSchema, mcpConnectionRevokeInputSchema, mcpConnectionRevokeOutputSchema, mcpConnectionSchema, notebaseActivityStatsItemSchema, notebaseActivityStatsOutputSchema, notebaseColumnCreateDataSchema, notebaseColumnSchema, notebaseColumnUpdateDataSchema, notebaseColumnWidthSchema, notebaseCreateDataSchema, notebaseRowCellsSchema, notebaseRowCreateDataSchema, notebaseRowGrowthStatsItemSchema, notebaseRowGrowthStatsOutputSchema, notebaseRowSchema, notebaseRowUpdateDataSchema, notebaseSchema, notebaseSummarySchema, notebaseUpdateDataSchema, notebaseViewConfigSchema, notebaseViewCreateDataSchema, notebaseViewFilterSchema, notebaseViewFiltersSchema, notebaseViewSchema, notebaseViewSortSchema, notebaseViewSortsSchema, notebaseViewTypeSchema, notebaseViewUpdateDataSchema, pageSchema, paginationShape, pickPublicErrorMap, renderedCardSchema, reviewRatingSchema, scheduleStatusSchema, schedulingParamsSchema, speechPreferencesSchema, speechPreferencesUpdateInputSchema, speechRateSchema, speechSynthesizeInputSchema, speechSynthesizeOutputSchema, speechVoiceGenderSchema, speechVoiceNameSchema, speechVoiceSchema, speechVoicesOutputSchema, srsAcknowledgeOptimizerResultsInputSchema, srsAcknowledgeOptimizerResultsOutputSchema, srsActivityStatsItemSchema, srsActivityStatsOutputSchema, srsListCardRevlogsInputSchema, srsListCardRevlogsOutputSchema, srsListUnreadOptimizerResultsInputSchema, srsListUnreadOptimizerResultsOutputSchema, srsManualCardStatusInputSchema, srsMemoryGrowthStatsItemSchema, srsMemoryGrowthStatsOutputSchema, srsOptimizerUnreadResultSchema, srsRecentNotebaseScheduleStatusStatsInputSchema, srsRecentNotebaseScheduleStatusStatsOutputSchema, srsReviewInputSchema, srsReviewOutputSchema, srsRevlogSchema, srsRevlogWithoutSnapshotSchema, srsRollbackReviewInputSchema, srsRollbackReviewOutputSchema, srsScheduleStatusStatsInputSchema, srsScheduleStatusStatsOutputSchema, srsScheduleStatusStatsSchema, srsSetCardBuriedInputSchema, srsSetCardBuriedOutputSchema, srsSetCardSuspendedInputSchema, srsSetCardSuspendedOutputSchema, srsTxidOutputSchema, statsInputSchema, stepSchema, timezoneSchema, userEnsureLocaleInputSchema, userEnsureLocaleOutputSchema, userEnsureTimezoneInputSchema, userEnsureTimezoneOutputSchema, userUpdateLocaleInputSchema, userUpdateLocaleOutputSchema, userUpdateTimezoneInputSchema, userUpdateTimezoneOutputSchema, videoTranscriptCreateInputSchema, videoTranscriptGetInputSchema, videoTranscriptResourceSchema, videoTranscriptStatusSchema, videoTranscriptSubtitlesSchema, videoTranscriptUsagePoolSchema, videoTranscriptUsageSchema };
2000
2211
 
2001
2212
  //# sourceMappingURL=index.js.map