@read-frog/api-contract 0.24.0 → 0.26.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,7 +1,7 @@
1
1
  import { eventIterator, oc } from "@orpc/contract";
2
2
  import { z } from "zod";
3
- import { EBOOK_ALLOWED_COVER_CONTENT_TYPES, GATED_FEATURE_KEYS, NOTEBASE_COLUMN_MAX_WIDTH, NOTEBASE_COLUMN_MIN_WIDTH, PDF_TRANSLATION_MAX_BATCH_FILES, POSTPONE_DAMAGE_THRESHOLD, SRS_REVIEW_DURATION_MS_MAX, activeScheduleStatusSchema, canonicalTimeZone, cardIdentityShape, cardMemoryStateShape, cardStateSchema, cardStateSchema as cardStateSchema$1, cardTemplateConfigSchema, cardTemplateCreatedBySchema, checkoutAttributionInputSchema, fsrsMemoryStateSchema, fsrsReviewLogSnapshotSchema, getVideoIdFromUrl, langCodeISO6393Schema, notebaseColumnConfigSchema, reviewRatingSchema, scheduleStatusSchema, scheduleStatusSchema as scheduleStatusSchema$1, schedulingParamsSchema, schedulingParamsShape, srsModelVersionSchema, srsSleepSourceSchema, srsStepSchema, srsWeightsSchema, transcriptSegmentSchema } from "@read-frog/definitions";
4
- //#region src/schemas/app-locale.ts
3
+ import { EBOOK_ALLOWED_COVER_CONTENT_TYPES, GATED_FEATURE_KEYS, MEDIA_ASSET_STATUS_VALUES, MEDIA_CONTENT_TYPES, NOTEBASE_COLUMN_MAX_WIDTH, NOTEBASE_COLUMN_MIN_WIDTH, PDF_TRANSLATION_MAX_BATCH_FILES, POSTPONE_DAMAGE_THRESHOLD, SRS_REVIEW_DURATION_MS_MAX, activeScheduleStatusSchema, canonicalTimeZone, cardIdentityShape, cardMemoryStateShape, cardStateSchema, cardStateSchema as cardStateSchema$1, cardTemplateConfigSchema, cardTemplateCreatedBySchema, checkoutAttributionInputSchema, fsrsMemoryStateSchema, fsrsReviewLogSnapshotSchema, getVideoIdFromUrl, langCodeISO6393Schema, noteCreatedViaSchema, noteOriginInputSchema, noteOriginSchema, notebaseColumnConfigSchema, reviewRatingSchema, scheduleStatusSchema, scheduleStatusSchema as scheduleStatusSchema$1, schedulingParamsSchema, schedulingParamsShape, srsModelVersionSchema, srsSleepSourceSchema, srsStepSchema, srsWeightsSchema, transcriptSegmentSchema } from "@read-frog/definitions";
4
+ // src/schemas/app-locale.ts
5
5
  /**
6
6
  * The languages the website is in (`project.inlang/settings.json`; a test in
7
7
  * apps/www keeps the two in step). Used wherever the server writes for a
@@ -18,8 +18,7 @@ const appLocaleSchema = z.enum([
18
18
  "zh",
19
19
  "zh-TW"
20
20
  ]);
21
- //#endregion
22
- //#region src/schemas/billing.ts
21
+ // src/schemas/billing.ts
23
22
  const billingIntervalSchema = z.enum(["month", "year"]);
24
23
  const billingSubscriptionStatusSchema = z.enum([
25
24
  "incomplete",
@@ -51,6 +50,21 @@ const MCP_DAILY_CALL_LIMITS = {
51
50
  pro: 50,
52
51
  ultra: null
53
52
  };
53
+ /**
54
+ * How many ebooks each plan may keep at once. Free keeps one, so it reads one
55
+ * book at a time; deleting a book frees its place for the next.
56
+ *
57
+ * Read by the API's upload gate AND by the website's copy (the pricing page),
58
+ * so the pages cannot promise books the server refuses.
59
+ *
60
+ * Companion edit when this changes: `account-and-plans` under
61
+ * `apps/www/content/docs/`, which states the numbers.
62
+ */
63
+ const EBOOK_LIMIT_BY_PLAN = {
64
+ free: 1,
65
+ pro: 10,
66
+ ultra: 80
67
+ };
54
68
  const billingCheckoutPlanSchema = z.enum(["pro", "ultra"]);
55
69
  const billingCurrencySchema = z.enum([
56
70
  "usd",
@@ -116,8 +130,7 @@ const billingCreateCheckoutSessionInputSchema = z.object({
116
130
  const billingCreateCustomerPortalSessionInputSchema = z.object({ locale: appLocaleSchema }).strict();
117
131
  const billingSessionUrlOutputSchema = z.object({ url: z.url() }).strict();
118
132
  const billingCancelScheduledChangeOutputSchema = z.object({ success: z.literal(true) }).strict();
119
- //#endregion
120
- //#region src/schemas/hosted-ai.ts
133
+ // src/schemas/hosted-ai.ts
121
134
  const HostedAiOutputFieldTypeSchema = z.enum(["string", "number"]);
122
135
  const HostedAiOutputFieldSchema = z.strictObject({
123
136
  name: z.string().trim().min(1).max(80),
@@ -391,8 +404,7 @@ const HostedAiStatusOutputSchema = z.strictObject({
391
404
  languageDetection: HostedAiFeatureStatusSchema
392
405
  })
393
406
  });
394
- //#endregion
395
- //#region src/schemas/pdf-translation.ts
407
+ // src/schemas/pdf-translation.ts
396
408
  const pdfTranslationJobStatusSchema = z.enum([
397
409
  "queued",
398
410
  "running",
@@ -510,13 +522,18 @@ const PdfTranslationUploadErrorDataSchema = z.strictObject({
510
522
  uploadId: z.uuid(),
511
523
  jobId: z.uuid().optional()
512
524
  });
513
- //#endregion
514
- //#region src/public-errors.ts
525
+ // src/public-errors.ts
515
526
  const CellValidationFailureReasonSchema = z.enum([
516
527
  "unknown_notebase_column",
517
528
  "type_mismatch",
518
529
  "invalid_select_option",
519
- "invalid_date_format"
530
+ "invalid_date_format",
531
+ "empty_cloze_answer",
532
+ "unclosed_cloze",
533
+ "invalid_cloze_ordinal",
534
+ "cloze_crosses_math",
535
+ "cloze_splits_math_pair",
536
+ "too_many_cloze_groups"
520
537
  ]);
521
538
  const CellValidationFailureDetailsSchema = z.object({
522
539
  expectedFormat: z.string().optional(),
@@ -530,7 +547,9 @@ const CellValidationFailedDataSchema = z.object({
530
547
  details: CellValidationFailureDetailsSchema,
531
548
  reason: CellValidationFailureReasonSchema,
532
549
  /** Index of the failing row within a batch input (createMany / updateMany / initialRows). */
533
- rowIndex: z.number().int().min(0).optional()
550
+ rowIndex: z.number().int().min(0).optional(),
551
+ /** The failing note, when the check ran over stored notes (a column type change). */
552
+ notebaseRowId: z.string().optional()
534
553
  }).strict();
535
554
  const CardTemplateInvalidColumnsDataSchema = z.object({ notebaseColumnIds: z.array(z.string()) }).strict();
536
555
  const CardTemplateInvalidLayoutDataSchema = z.object({ errors: z.array(z.object({
@@ -559,6 +578,10 @@ const SpeechDailyLimitReachedDataSchema = z.strictObject({
559
578
  resetAt: z.iso.datetime()
560
579
  });
561
580
  const PUBLIC_APP_ERROR_DEFS = {
581
+ CARD_DELETE_UNSUPPORTED: {
582
+ message: "This card cannot be deleted independently of its note.",
583
+ status: 400
584
+ },
562
585
  RESOURCE_UPDATE_CONFLICT: {
563
586
  message: "The resource changed. Read it again before updating.",
564
587
  status: 409
@@ -738,10 +761,6 @@ const PUBLIC_APP_ERROR_DEFS = {
738
761
  message: "Concurrent position conflict, please retry",
739
762
  status: 409
740
763
  },
741
- EBOOK_BETA_RESTRICTED: {
742
- message: "Ebooks are currently in beta for selected accounts",
743
- status: 403
744
- },
745
764
  EBOOK_NOT_FOUND: {
746
765
  message: "Ebook not found",
747
766
  status: 404
@@ -758,6 +777,26 @@ const PUBLIC_APP_ERROR_DEFS = {
758
777
  message: "Ebook upload has not been completed",
759
778
  status: 409
760
779
  },
780
+ MEDIA_BETA_RESTRICTED: {
781
+ message: "Media uploads are currently in beta for selected accounts",
782
+ status: 403
783
+ },
784
+ MEDIA_NOT_FOUND: {
785
+ message: "Media file not found",
786
+ status: 404
787
+ },
788
+ MEDIA_FILE_TOO_LARGE: {
789
+ message: "Media file exceeds the maximum allowed size",
790
+ status: 413
791
+ },
792
+ MEDIA_QUOTA_EXCEEDED: {
793
+ message: "Not enough media storage space left on your plan",
794
+ status: 403
795
+ },
796
+ MEDIA_UPLOAD_NOT_COMPLETED: {
797
+ message: "Media upload has not been completed",
798
+ status: 409
799
+ },
761
800
  EMAIL_LINK_INVALID: {
762
801
  message: "This email link is not valid",
763
802
  status: 400
@@ -854,8 +893,7 @@ function pickPublicErrorMap(...codes) {
854
893
  }];
855
894
  }));
856
895
  }
857
- //#endregion
858
- //#region src/contracts/billing.ts
896
+ // src/contracts/billing.ts
859
897
  const billingProcedure = oc.errors(pickPublicErrorMap("BILLING_NOT_CONFIGURED", "BILLING_CUSTOMER_NOT_FOUND", "BILLING_PASS_ACTIVE", "BILLING_CHANGE_SCHEDULED", "BILLING_CHECKOUT_CONFLICT"));
860
898
  const billingContract = {
861
899
  status: billingProcedure.route({
@@ -883,8 +921,7 @@ const billingContract = {
883
921
  tags: ["Billing"]
884
922
  }).output(billingCancelScheduledChangeOutputSchema)
885
923
  };
886
- //#endregion
887
- //#region src/contracts/shared.ts
924
+ // src/contracts/shared.ts
888
925
  /**
889
926
  * Declares a procedure that is exposed to agents as an MCP tool, not only to
890
927
  * the REST/OpenAPI surface.
@@ -900,8 +937,7 @@ function defineAgentProcedure(route) {
900
937
  description: route.description
901
938
  }).route(route);
902
939
  }
903
- //#endregion
904
- //#region src/schemas/pagination.ts
940
+ // src/schemas/pagination.ts
905
941
  const paginationShape = {
906
942
  limit: z.number().int().min(1).max(500).optional(),
907
943
  offset: z.number().int().min(0).optional()
@@ -912,15 +948,13 @@ function pageSchema(itemSchema) {
912
948
  hasMore: z.boolean()
913
949
  });
914
950
  }
915
- //#endregion
916
- //#region src/schemas/resource-mutation.ts
951
+ // src/schemas/resource-mutation.ts
917
952
  const expectedUpdatedAtSchema = z.iso.datetime({ offset: true });
918
953
  const deletionResultSchema = z.object({
919
954
  id: z.uuid(),
920
955
  txid: z.number()
921
956
  });
922
- //#endregion
923
- //#region src/schemas/card.ts
957
+ // src/schemas/card.ts
924
958
  const cardTemplateSchema = z.object({
925
959
  id: z.uuid(),
926
960
  notebaseId: z.uuid(),
@@ -972,6 +1006,12 @@ const CardListInputSchema = z.object({
972
1006
  const CardListOutputSchema = pageSchema(renderedCardSchema);
973
1007
  const CardGetInputSchema = z.object({ id: z.uuid() });
974
1008
  const CardGetOutputSchema = renderedCardSchema;
1009
+ const CardDeleteInputSchema = z.strictObject({
1010
+ id: z.uuid(),
1011
+ expectedVariantKey: z.string().min(1),
1012
+ expectedRowUpdatedAt: expectedUpdatedAtSchema
1013
+ });
1014
+ const CardDeleteOutputSchema = z.object({ txid: z.number() });
975
1015
  const CardGenerateInputSchema = z.object({
976
1016
  notebaseId: z.uuid(),
977
1017
  templateId: z.uuid().optional()
@@ -980,9 +1020,14 @@ const CardGenerateOutputSchema = z.object({
980
1020
  created: z.number().int().min(0),
981
1021
  txid: z.number()
982
1022
  });
983
- //#endregion
984
- //#region src/contracts/card.ts
1023
+ // src/contracts/card.ts
985
1024
  const cardContract = {
1025
+ delete: oc.errors(pickPublicErrorMap("CARD_NOT_FOUND", "NOTEBASE_NOT_FOUND", "CARD_DELETE_UNSUPPORTED", "RESOURCE_UPDATE_CONFLICT", "CELL_VALIDATION_FAILED")).route({
1026
+ method: "DELETE",
1027
+ path: "/cards/{id}",
1028
+ summary: "Delete card",
1029
+ tags: ["Cards"]
1030
+ }).input(CardDeleteInputSchema).output(CardDeleteOutputSchema),
986
1031
  list: defineAgentProcedure({
987
1032
  method: "GET",
988
1033
  path: "/cards",
@@ -1004,8 +1049,7 @@ const cardContract = {
1004
1049
  tags: ["Cards"]
1005
1050
  }).input(CardGenerateInputSchema).output(CardGenerateOutputSchema)
1006
1051
  };
1007
- //#endregion
1008
- //#region src/contracts/card-template.ts
1052
+ // src/contracts/card-template.ts
1009
1053
  const cardTemplateContract = {
1010
1054
  list: defineAgentProcedure({
1011
1055
  method: "GET",
@@ -1043,8 +1087,7 @@ const cardTemplateContract = {
1043
1087
  tags: ["Card Templates"]
1044
1088
  }).errors(pickPublicErrorMap("CARD_TEMPLATE_NOT_FOUND")).input(CardTemplateDeleteInputSchema).output(CardTemplateDeleteOutputSchema)
1045
1089
  };
1046
- //#endregion
1047
- //#region src/schemas/ebook.ts
1090
+ // src/schemas/ebook.ts
1048
1091
  const ebookStatusSchema = z.enum(["pending", "ready"]);
1049
1092
  const ebookCoverContentTypeSchema = z.enum(EBOOK_ALLOWED_COVER_CONTENT_TYPES);
1050
1093
  const ebookListItemSchema = z.object({
@@ -1080,7 +1123,14 @@ const ebookRequestUploadInputSchema = z.object({
1080
1123
  cover: z.object({
1081
1124
  contentType: ebookCoverContentTypeSchema,
1082
1125
  byteSize: z.number().int().min(1)
1083
- }).strict().optional()
1126
+ }).strict().optional(),
1127
+ /**
1128
+ * The client's key for this upload. Asking again with the same key, after
1129
+ * an answer that never arrived or for a retry, returns the same pending
1130
+ * book with fresh targets instead of reserving another place in the
1131
+ * library's allowance.
1132
+ */
1133
+ uploadKey: z.uuid().optional()
1084
1134
  }).strict();
1085
1135
  /**
1086
1136
  * A signed PUT: send the file to `url` with exactly `headers`. The signature
@@ -1117,61 +1167,59 @@ const ebookRenameInputSchema = ebookRenameDataSchema.extend({ id: z.uuid() });
1117
1167
  const ebookRenameOutputSchema = z.object({ ebook: ebookListItemSchema }).strict();
1118
1168
  const ebookDeleteInputSchema = z.object({ id: z.uuid() }).strict();
1119
1169
  const ebookDeleteOutputSchema = z.object({ id: z.uuid() }).strict();
1120
- //#endregion
1121
- //#region src/contracts/ebook.ts
1170
+ // src/contracts/ebook.ts
1122
1171
  const ebookProcedure = oc;
1123
1172
  const ebookContract = {
1124
- list: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED")).route({
1173
+ list: ebookProcedure.route({
1125
1174
  method: "GET",
1126
1175
  path: "/ebooks",
1127
1176
  summary: "List ebooks with quota",
1128
1177
  tags: ["Ebooks"]
1129
1178
  }).input(ebookListInputSchema).output(ebookListOutputSchema),
1130
- get: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1179
+ get: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1131
1180
  method: "GET",
1132
1181
  path: "/ebooks/{id}",
1133
1182
  summary: "Get an ebook with reading progress",
1134
1183
  tags: ["Ebooks"]
1135
1184
  }).input(ebookGetInputSchema).output(ebookGetOutputSchema),
1136
- requestUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_LIMIT_EXCEEDED", "EBOOK_FILE_TOO_LARGE")).route({
1185
+ requestUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_LIMIT_EXCEEDED", "EBOOK_FILE_TOO_LARGE")).route({
1137
1186
  method: "POST",
1138
1187
  path: "/ebooks/uploads",
1139
1188
  summary: "Request presigned upload URLs for a new ebook",
1140
1189
  tags: ["Ebooks"]
1141
1190
  }).input(ebookRequestUploadInputSchema).output(ebookRequestUploadOutputSchema),
1142
- finalizeUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND", "EBOOK_UPLOAD_NOT_COMPLETED", "EBOOK_FILE_TOO_LARGE")).route({
1191
+ finalizeUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND", "EBOOK_UPLOAD_NOT_COMPLETED", "EBOOK_FILE_TOO_LARGE")).route({
1143
1192
  method: "POST",
1144
1193
  path: "/ebooks/{ebookId}/finalize",
1145
1194
  summary: "Finalize an ebook upload",
1146
1195
  tags: ["Ebooks"]
1147
1196
  }).input(ebookFinalizeUploadInputSchema).output(ebookFinalizeUploadOutputSchema),
1148
- getDownloadUrl: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1197
+ getDownloadUrl: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1149
1198
  method: "GET",
1150
1199
  path: "/ebooks/{id}/download-url",
1151
1200
  summary: "Get a presigned download URL for an ebook",
1152
1201
  tags: ["Ebooks"]
1153
1202
  }).input(ebookGetDownloadUrlInputSchema).output(ebookGetDownloadUrlOutputSchema),
1154
- updateProgress: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1203
+ updateProgress: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1155
1204
  method: "PATCH",
1156
1205
  path: "/ebooks/{id}/progress",
1157
1206
  summary: "Update ebook reading progress",
1158
1207
  tags: ["Ebooks"]
1159
1208
  }).input(ebookUpdateProgressInputSchema).output(ebookUpdateProgressOutputSchema),
1160
- rename: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1209
+ rename: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1161
1210
  method: "PATCH",
1162
1211
  path: "/ebooks/{id}",
1163
1212
  summary: "Rename an ebook",
1164
1213
  tags: ["Ebooks"]
1165
1214
  }).input(ebookRenameInputSchema).output(ebookRenameOutputSchema),
1166
- delete: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1215
+ delete: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1167
1216
  method: "DELETE",
1168
1217
  path: "/ebooks/{id}",
1169
1218
  summary: "Delete an ebook",
1170
1219
  tags: ["Ebooks"]
1171
1220
  }).input(ebookDeleteInputSchema).output(ebookDeleteOutputSchema)
1172
1221
  };
1173
- //#endregion
1174
- //#region src/schemas/email-preferences.ts
1222
+ // src/schemas/email-preferences.ts
1175
1223
  /** A category's key, such as `promotions`. */
1176
1224
  const emailCategoryKeySchema = z.string().max(64).regex(/^[a-z][a-z0-9_]*$/);
1177
1225
  /** The token in an email's unsubscribe link. */
@@ -1241,8 +1289,7 @@ const emailPreferencesUpdateByTokenInputSchema = z.object({
1241
1289
  locale: appLocaleSchema,
1242
1290
  ...emailPreferencesChangesShape
1243
1291
  }).strict();
1244
- //#endregion
1245
- //#region src/contracts/email-preferences.ts
1292
+ // src/contracts/email-preferences.ts
1246
1293
  const emailPreferencesContract = {
1247
1294
  get: oc.route({
1248
1295
  method: "GET",
@@ -1269,24 +1316,21 @@ const emailPreferencesContract = {
1269
1316
  tags: ["Email preferences"]
1270
1317
  }).errors(pickPublicErrorMap("EMAIL_LINK_INVALID")).input(emailPreferencesUpdateByTokenInputSchema).output(emailPreferencesByTokenStateSchema)
1271
1318
  };
1272
- //#endregion
1273
- //#region src/schemas/feature-access.ts
1319
+ // src/schemas/feature-access.ts
1274
1320
  const GatedFeatureKeySchema = z.enum(GATED_FEATURE_KEYS);
1275
1321
  const FeatureAccessStatusInputSchema = z.object({ featureKey: GatedFeatureKeySchema }).strict();
1276
1322
  const FeatureAccessStatusOutputSchema = z.object({
1277
1323
  featureKey: GatedFeatureKeySchema,
1278
1324
  allowed: z.boolean()
1279
1325
  });
1280
- //#endregion
1281
- //#region src/contracts/feature-access.ts
1326
+ // src/contracts/feature-access.ts
1282
1327
  const featureAccessContract = { status: oc.route({
1283
1328
  method: "GET",
1284
1329
  path: "/feature-access/status",
1285
1330
  summary: "Get whether the caller can use a gated feature",
1286
1331
  tags: ["Feature Access"]
1287
1332
  }).input(FeatureAccessStatusInputSchema).output(FeatureAccessStatusOutputSchema) };
1288
- //#endregion
1289
- //#region src/contracts/hosted-ai.ts
1333
+ // src/contracts/hosted-ai.ts
1290
1334
  const hostedAiStreamErrors = pickPublicErrorMap("HOSTED_AI_TIER_RESTRICTED", "HOSTED_AI_QUOTA_EXHAUSTED");
1291
1335
  const hostedAiContract = {
1292
1336
  pools: oc.route({
@@ -1359,8 +1403,7 @@ const hostedAiContract = {
1359
1403
  tags: ["Hosted AI"]
1360
1404
  }).input(HostedAiNoteSuggestionStreamInputSchema).output(eventIterator(HostedAiStreamPartSchema)).errors(hostedAiStreamErrors) }
1361
1405
  };
1362
- //#endregion
1363
- //#region src/schemas/mastery-goal.ts
1406
+ // src/schemas/mastery-goal.ts
1364
1407
  const MASTERY_GOAL_TARGET_MAX = 1e6;
1365
1408
  /** How many mastered cards to aim for: the cards `stats.srsMemoryGrowth` counts. */
1366
1409
  const masteryGoalTargetSchema = z.number().int().min(1).max(MASTERY_GOAL_TARGET_MAX);
@@ -1368,8 +1411,7 @@ const masteryGoalTargetSchema = z.number().int().min(1).max(MASTERY_GOAL_TARGET_
1368
1411
  const masteryGoalUpdateInputSchema = z.object({ target: masteryGoalTargetSchema.nullable() }).strict();
1369
1412
  /** The goal's target, or `null` while none is set. */
1370
1413
  const masteryGoalOutputSchema = z.object({ target: masteryGoalTargetSchema.nullable() }).strict();
1371
- //#endregion
1372
- //#region src/contracts/mastery-goal.ts
1414
+ // src/contracts/mastery-goal.ts
1373
1415
  const masteryGoalContract = {
1374
1416
  get: oc.route({
1375
1417
  method: "GET",
@@ -1384,8 +1426,7 @@ const masteryGoalContract = {
1384
1426
  tags: ["Goals"]
1385
1427
  }).input(masteryGoalUpdateInputSchema).output(masteryGoalOutputSchema)
1386
1428
  };
1387
- //#endregion
1388
- //#region src/schemas/mcp-connection.ts
1429
+ // src/schemas/mcp-connection.ts
1389
1430
  const mcpConnectionSchema = z.object({
1390
1431
  /** OAuth client identifier. For a CIMD client this is an https URL. */
1391
1432
  clientId: z.string(),
@@ -1405,8 +1446,20 @@ const mcpConnectionSchema = z.object({
1405
1446
  const mcpConnectionListOutputSchema = z.array(mcpConnectionSchema);
1406
1447
  const mcpConnectionRevokeInputSchema = z.object({ clientId: z.string().min(1) }).strict();
1407
1448
  const mcpConnectionRevokeOutputSchema = z.object({ clientId: z.string() }).strict();
1408
- //#endregion
1409
- //#region src/contracts/mcp-connection.ts
1449
+ /**
1450
+ * How many MCP tool calls the caller has used of their plan's
1451
+ * `MCP_DAILY_CALL_LIMITS`, read without counting one. The window is 24 hours
1452
+ * from the first call in it, not a calendar day.
1453
+ */
1454
+ const mcpCallUsageSchema = z.object({
1455
+ /** Calls used in the current window, at most `limit`. */
1456
+ usedCalls: z.number().int().min(0),
1457
+ /** null: the plan has no daily limit. */
1458
+ limit: z.number().int().positive().nullable(),
1459
+ /** When the current 24-hour window ends; null when no window is open or there is no limit. */
1460
+ resetAt: z.iso.datetime().nullable()
1461
+ }).strict();
1462
+ // src/contracts/mcp-connection.ts
1410
1463
  const mcpConnectionContract = {
1411
1464
  list: oc.route({
1412
1465
  method: "GET",
@@ -1419,10 +1472,95 @@ const mcpConnectionContract = {
1419
1472
  path: "/mcp-connections/revoke",
1420
1473
  summary: "Withdraw a client's authorization and revoke its tokens",
1421
1474
  tags: ["MCP Connections"]
1422
- }).input(mcpConnectionRevokeInputSchema).output(mcpConnectionRevokeOutputSchema)
1475
+ }).input(mcpConnectionRevokeInputSchema).output(mcpConnectionRevokeOutputSchema),
1476
+ usage: oc.route({
1477
+ method: "GET",
1478
+ path: "/mcp-connections/usage",
1479
+ summary: "Get the MCP tool calls the caller has used of their plan's daily limit",
1480
+ tags: ["MCP Connections"]
1481
+ }).input(z.object({}).strict()).output(mcpCallUsageSchema)
1423
1482
  };
1424
- //#endregion
1425
- //#region src/schemas/notebase-column.ts
1483
+ // src/schemas/media.ts
1484
+ const mediaContentTypeSchema = z.enum(MEDIA_CONTENT_TYPES);
1485
+ const mediaAssetStatusSchema = z.enum(MEDIA_ASSET_STATUS_VALUES);
1486
+ /** Why the worker rejected an upload. */
1487
+ const mediaFailureCodeSchema = z.enum([
1488
+ "unsupported_format",
1489
+ "invalid_file",
1490
+ "file_too_large",
1491
+ "image_too_large",
1492
+ "audio_too_long",
1493
+ "quota_exceeded",
1494
+ "processing_failed"
1495
+ ]);
1496
+ const mediaAssetMetadataSchema = z.discriminatedUnion("kind", [z.object({
1497
+ kind: z.literal("image"),
1498
+ width: z.number().int(),
1499
+ height: z.number().int()
1500
+ }).strict(), z.object({
1501
+ kind: z.literal("audio"),
1502
+ durationMs: z.number().int()
1503
+ }).strict()]);
1504
+ const mediaAssetSchema = z.object({
1505
+ id: z.uuid(),
1506
+ /** What a cell stores to reference the asset; null until it is ready. */
1507
+ uri: z.string().nullable(),
1508
+ status: mediaAssetStatusSchema,
1509
+ contentType: z.string().nullable(),
1510
+ fileByteSize: z.number().int(),
1511
+ metadata: mediaAssetMetadataSchema.nullable(),
1512
+ failureCode: mediaFailureCodeSchema.nullable(),
1513
+ createdAt: z.coerce.date()
1514
+ }).strict();
1515
+ const mediaRequestUploadInputSchema = z.object({
1516
+ contentType: mediaContentTypeSchema,
1517
+ byteSize: z.number().int().min(1)
1518
+ }).strict();
1519
+ const mediaRequestUploadOutputSchema = z.object({
1520
+ assetId: z.uuid(),
1521
+ /** A signed PUT: send the file to `url` with exactly `headers`. */
1522
+ upload: z.object({
1523
+ url: z.url(),
1524
+ headers: z.record(z.string(), z.string())
1525
+ }).strict(),
1526
+ expiresAt: z.coerce.date()
1527
+ }).strict();
1528
+ const mediaAssetIdInputSchema = z.object({ id: z.uuid() }).strict();
1529
+ const mediaAssetOutputSchema = z.object({ asset: mediaAssetSchema }).strict();
1530
+ const mediaUsageOutputSchema = z.object({
1531
+ usedBytes: z.number().int().min(0),
1532
+ /** Held by uploads that are not done yet. */
1533
+ reservedBytes: z.number().int().min(0),
1534
+ limitBytes: z.number().int().min(0)
1535
+ }).strict();
1536
+ // src/contracts/media.ts
1537
+ const mediaContract = {
1538
+ requestUpload: oc.errors(pickPublicErrorMap("MEDIA_BETA_RESTRICTED", "MEDIA_FILE_TOO_LARGE", "MEDIA_QUOTA_EXCEEDED")).route({
1539
+ method: "POST",
1540
+ path: "/media/uploads",
1541
+ summary: "Reserve space and get a signed upload URL for a media file",
1542
+ tags: ["Media"]
1543
+ }).input(mediaRequestUploadInputSchema).output(mediaRequestUploadOutputSchema),
1544
+ completeUpload: oc.errors(pickPublicErrorMap("MEDIA_BETA_RESTRICTED", "MEDIA_NOT_FOUND", "MEDIA_UPLOAD_NOT_COMPLETED")).route({
1545
+ method: "POST",
1546
+ path: "/media/{id}/complete",
1547
+ summary: "Queue an uploaded media file for validation",
1548
+ tags: ["Media"]
1549
+ }).input(mediaAssetIdInputSchema).output(mediaAssetOutputSchema),
1550
+ get: oc.errors(pickPublicErrorMap("MEDIA_BETA_RESTRICTED", "MEDIA_NOT_FOUND")).route({
1551
+ method: "GET",
1552
+ path: "/media/{id}",
1553
+ summary: "Get a media asset and its upload status",
1554
+ tags: ["Media"]
1555
+ }).input(mediaAssetIdInputSchema).output(mediaAssetOutputSchema),
1556
+ usage: oc.errors(pickPublicErrorMap("MEDIA_BETA_RESTRICTED")).route({
1557
+ method: "GET",
1558
+ path: "/media/usage",
1559
+ summary: "Get the media space used, reserved and allowed",
1560
+ tags: ["Media"]
1561
+ }).input(z.object({}).strict()).output(mediaUsageOutputSchema)
1562
+ };
1563
+ // src/schemas/notebase-column.ts
1426
1564
  const notebaseColumnWidthSchema = z.number().int().min(NOTEBASE_COLUMN_MIN_WIDTH).max(NOTEBASE_COLUMN_MAX_WIDTH);
1427
1565
  const notebaseColumnSchema = z.object({
1428
1566
  id: z.string(),
@@ -1471,20 +1609,28 @@ const NotebaseColumnReorderInputSchema = z.object({
1471
1609
  ids: z.array(z.uuid())
1472
1610
  });
1473
1611
  const NotebaseColumnReorderOutputSchema = z.object({ txid: z.number() });
1474
- //#endregion
1475
- //#region src/schemas/notebase-row.ts
1612
+ // src/schemas/notebase-row.ts
1476
1613
  const notebaseRowCellsSchema = z.record(z.string(), z.unknown());
1477
1614
  const notebaseRowSchema = z.object({
1478
1615
  id: z.string(),
1479
1616
  notebaseId: z.string(),
1480
1617
  cells: notebaseRowCellsSchema,
1481
1618
  position: z.number(),
1619
+ origin: noteOriginSchema.nullish().describe("Where the note's content came from, set when it was created: a web page (url, title), a book on the user's shelf (ebookId, its title then, and cfi, the EPUB location of the selection), or a video (url, title, seconds into it). Null when it has none, or when it was created before this was recorded."),
1620
+ createdVia: noteCreatedViaSchema.nullish().describe("Which client created the note: \"web\", \"extension\", \"mobile\", \"mcp\" (with the MCP client's id and the name it registered under) or \"unknown\". Null for notes created before this was recorded."),
1482
1621
  createdAt: z.coerce.date(),
1483
1622
  updatedAt: z.coerce.date()
1484
1623
  });
1624
+ /**
1625
+ * Where a new note's content came from; see `noteOriginInputSchema`. Optional
1626
+ * metadata never costs the note: an origin that does not parse is dropped and
1627
+ * the note is saved without one.
1628
+ */
1629
+ const notebaseRowOriginInputSchema = noteOriginInputSchema.optional().catch(void 0).describe("Where the note's content came from: a web page or video by its http(s) URL, or a book on the user's shelf by its id. Stored once and never edited. Optional: an origin that cannot be used is left out and the note is still saved.");
1485
1630
  const notebaseRowCreateDataSchema = z.object({
1486
1631
  id: z.uuid().optional(),
1487
- cells: notebaseRowCellsSchema.optional()
1632
+ cells: notebaseRowCellsSchema.optional(),
1633
+ origin: notebaseRowOriginInputSchema
1488
1634
  }).strict();
1489
1635
  const notebaseRowUpdateDataSchema = z.object({
1490
1636
  cells: notebaseRowCellsSchema.optional(),
@@ -1534,6 +1680,8 @@ const NotebaseRowUpdateOutputSchema = z.object({
1534
1680
  notebaseId: z.uuid(),
1535
1681
  cells: notebaseRowCellsSchema,
1536
1682
  position: z.number().int(),
1683
+ origin: notebaseRowSchema.shape.origin,
1684
+ createdVia: notebaseRowSchema.shape.createdVia,
1537
1685
  createdAt: z.date(),
1538
1686
  updatedAt: z.date(),
1539
1687
  txid: z.number()
@@ -1595,8 +1743,7 @@ const NotebaseRowListInputSchema = z.object({
1595
1743
  const NotebaseRowListOutputSchema = pageSchema(notebaseRowSchema);
1596
1744
  const NotebaseRowGetInputSchema = z.object({ id: z.uuid() });
1597
1745
  const NotebaseRowGetOutputSchema = notebaseRowSchema;
1598
- //#endregion
1599
- //#region src/schemas/notebase-view.ts
1746
+ // src/schemas/notebase-view.ts
1600
1747
  const notebaseViewTypeSchema = z.enum([
1601
1748
  "table",
1602
1749
  "kanban",
@@ -1645,8 +1792,7 @@ const notebaseViewSchema = z.object({
1645
1792
  createdAt: z.coerce.date(),
1646
1793
  updatedAt: z.coerce.date()
1647
1794
  });
1648
- //#endregion
1649
- //#region src/schemas/notebase.ts
1795
+ // src/schemas/notebase.ts
1650
1796
  const NotebaseListInputSchema = z.object({});
1651
1797
  const notebaseSummarySchema = z.object({
1652
1798
  id: z.string(),
@@ -1676,7 +1822,8 @@ const notebaseSchema = z.object({
1676
1822
  });
1677
1823
  const notebaseInitialRowSchema = z.object({
1678
1824
  id: z.uuid().optional(),
1679
- cells: z.record(z.string(), z.unknown())
1825
+ cells: z.record(z.string(), z.unknown()),
1826
+ origin: notebaseRowOriginInputSchema
1680
1827
  }).strict();
1681
1828
  const notebaseCreateDataSchema = z.object({
1682
1829
  id: z.uuid().optional(),
@@ -1760,8 +1907,7 @@ const NotebaseGetSchemaOutputSchema = z.object({
1760
1907
  updatedAt: z.coerce.date(),
1761
1908
  notebaseColumns: z.array(notebaseColumnSchema)
1762
1909
  });
1763
- //#endregion
1764
- //#region src/contracts/notebase.ts
1910
+ // src/contracts/notebase.ts
1765
1911
  const notebaseContract = {
1766
1912
  list: defineAgentProcedure({
1767
1913
  method: "GET",
@@ -1819,8 +1965,7 @@ const notebaseContract = {
1819
1965
  tags: ["Notebases"]
1820
1966
  }).errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND")).input(NotebaseDeleteInputSchema).output(NotebaseDeleteOutputSchema)
1821
1967
  };
1822
- //#endregion
1823
- //#region src/contracts/notebase-column.ts
1968
+ // src/contracts/notebase-column.ts
1824
1969
  const notebaseColumnContract = {
1825
1970
  create: defineAgentProcedure({
1826
1971
  method: "POST",
@@ -1850,8 +1995,7 @@ const notebaseColumnContract = {
1850
1995
  tags: ["Notebase Columns"]
1851
1996
  }).input(NotebaseColumnReorderInputSchema).output(NotebaseColumnReorderOutputSchema)
1852
1997
  };
1853
- //#endregion
1854
- //#region src/contracts/notebase-row.ts
1998
+ // src/contracts/notebase-row.ts
1855
1999
  const notebaseRowContract = {
1856
2000
  list: defineAgentProcedure({
1857
2001
  method: "GET",
@@ -1885,14 +2029,14 @@ const notebaseRowContract = {
1885
2029
  method: "PATCH",
1886
2030
  path: "/notebase-rows/{notebaseRowId}",
1887
2031
  summary: "Update note",
1888
- description: "Merge supplied fields into an owned note, preserving omitted fields. Use null to clear a field. expectedUpdatedAt guards against editing stale data; reread on a modification conflict.",
2032
+ description: "Merge supplied fields into an owned note, preserving omitted fields. Use null to clear a field. expectedUpdatedAt guards against editing stale data; reread on a modification conflict. In a cloze field, a deletion's number ({{c1::…}}) is its card's identity: keep the numbers of the deletions you keep, and leave any gaps for the save to close. Renumbering them yourself hands a card's review history to other text, and can delete it.",
1889
2033
  tags: ["Notebase Rows"]
1890
2034
  }).errors(pickPublicErrorMap("NOTEBASE_ROW_NOT_FOUND", "CELL_VALIDATION_FAILED")).errors(pickPublicErrorMap("RESOURCE_UPDATE_CONFLICT")).input(NotebaseRowUpdateInputSchema).output(NotebaseRowUpdateOutputSchema),
1891
2035
  updateMany: defineAgentProcedure({
1892
2036
  method: "PATCH",
1893
2037
  path: "/notebase-rows/batch",
1894
2038
  summary: "Update notes",
1895
- description: "Update 1–50 notes atomically in one owned notebase. Each row supplies its ID and fields to merge; omitted fields are preserved and null clears a field. Supply each note's expectedUpdatedAt to guard against stale edits. A missing row, invalid field or modification conflict rolls back the whole batch. Items are returned in input order.",
2039
+ description: "Update 1–50 notes atomically in one owned notebase. Each row supplies its ID and fields to merge; omitted fields are preserved and null clears a field. Supply each note's expectedUpdatedAt to guard against stale edits. A missing row, invalid field or modification conflict rolls back the whole batch. Items are returned in input order. In a cloze field, a deletion's number ({{c1::…}}) is its card's identity: keep the numbers of the deletions you keep, and leave any gaps for the save to close. Renumbering them yourself hands a card's review history to other text, and can delete it.",
1896
2040
  tags: ["Notebase Rows"]
1897
2041
  }).errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND", "NOTEBASE_ROW_NOT_FOUND", "CELL_VALIDATION_FAILED")).errors(pickPublicErrorMap("RESOURCE_UPDATE_CONFLICT")).input(NotebaseRowUpdateManyInputSchema).output(NotebaseRowUpdateManyOutputSchema),
1898
2042
  delete: defineAgentProcedure({
@@ -1916,8 +2060,7 @@ const notebaseRowContract = {
1916
2060
  tags: ["Notebase Rows"]
1917
2061
  }).input(NotebaseRowReorderInputSchema).output(NotebaseRowReorderOutputSchema)
1918
2062
  };
1919
- //#endregion
1920
- //#region src/contracts/pdf-translation.ts
2063
+ // src/contracts/pdf-translation.ts
1921
2064
  const pdfTranslationProcedure = oc.errors(pickPublicErrorMap("PDF_TRANSLATION_UNAVAILABLE"));
1922
2065
  const pdfTranslationContract = {
1923
2066
  status: pdfTranslationProcedure.route({
@@ -1975,8 +2118,7 @@ const pdfTranslationContract = {
1975
2118
  tags: ["PDF Translation"]
1976
2119
  }).input(pdfTranslationJobIdInputSchema).output(pdfTranslationDeleteOutputSchema)
1977
2120
  };
1978
- //#endregion
1979
- //#region src/schemas/speech.ts
2121
+ // src/schemas/speech.ts
1980
2122
  /** The longest text one request reads aloud. */
1981
2123
  const SPEECH_TEXT_MAX_LENGTH = 500;
1982
2124
  /**
@@ -2050,8 +2192,7 @@ const speechSynthesizeOutputSchema = z.object({
2050
2192
  url: z.url(),
2051
2193
  expiresAt: z.coerce.date()
2052
2194
  }).strict();
2053
- //#endregion
2054
- //#region src/contracts/speech.ts
2195
+ // src/contracts/speech.ts
2055
2196
  const speechContract = {
2056
2197
  getPreferences: oc.route({
2057
2198
  method: "GET",
@@ -2078,8 +2219,7 @@ const speechContract = {
2078
2219
  tags: ["Speech"]
2079
2220
  }).input(speechSynthesizeInputSchema).output(speechSynthesizeOutputSchema)
2080
2221
  };
2081
- //#endregion
2082
- //#region src/schemas/timezone.ts
2222
+ // src/schemas/timezone.ts
2083
2223
  const timezoneFormatters = /* @__PURE__ */ new Map();
2084
2224
  function toCacheKey(timezone) {
2085
2225
  return timezone.replace(/[A-Z]/g, (letter) => letter.toLowerCase());
@@ -2122,8 +2262,7 @@ const canonicalTimezoneSchema = timezoneSchema.transform((timezone, ctx) => {
2122
2262
  }
2123
2263
  return name;
2124
2264
  });
2125
- //#endregion
2126
- //#region src/schemas/srs.ts
2265
+ // src/schemas/srs.ts
2127
2266
  const stepSchema = srsStepSchema;
2128
2267
  const SRS_REVIEW_CLIENT_ID_NAMESPACE = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
2129
2268
  const srsReviewClientIdNamePrefix = "readfrog:srs-review";
@@ -2189,7 +2328,7 @@ const srsListCardRevlogsOutputSchema = z.object({
2189
2328
  const srsReviewOutputSchema = z.object({
2190
2329
  card: cardSchema,
2191
2330
  revlog: srsRevlogSchema,
2192
- txid: z.number(),
2331
+ txid: z.number().nullable(),
2193
2332
  created: z.boolean()
2194
2333
  });
2195
2334
  const srsRollbackReviewOutputSchema = z.object({
@@ -2359,8 +2498,7 @@ const srsRescheduleApplyOutputSchema = z.object({
2359
2498
  reviewsPerDay: schedulingParamsShape.reviewsPerDay
2360
2499
  });
2361
2500
  const srsApplyPostponeOutputSchema = srsRescheduleApplyOutputSchema;
2362
- //#endregion
2363
- //#region src/contracts/srs.ts
2501
+ // src/contracts/srs.ts
2364
2502
  const srsContract = {
2365
2503
  scheduleStatusStats: defineAgentProcedure({
2366
2504
  method: "GET",
@@ -2436,8 +2574,7 @@ const srsContract = {
2436
2574
  tags: ["SRS"]
2437
2575
  }).input(srsApplyPostponeInputSchema).output(srsApplyPostponeOutputSchema)
2438
2576
  };
2439
- //#endregion
2440
- //#region src/schemas/notebase-stats.ts
2577
+ // src/schemas/notebase-stats.ts
2441
2578
  const notebaseActivityStatsItemSchema = z.object({
2442
2579
  date: z.iso.date(),
2443
2580
  notes: z.number().int().nonnegative()
@@ -2451,8 +2588,7 @@ const notebaseRowGrowthStatsOutputSchema = z.object({
2451
2588
  baseTotal: z.number().int().nonnegative(),
2452
2589
  daily: z.array(notebaseRowGrowthStatsItemSchema)
2453
2590
  }).strict();
2454
- //#endregion
2455
- //#region src/schemas/srs-stats.ts
2591
+ // src/schemas/srs-stats.ts
2456
2592
  const srsActivityStatsItemSchema = z.object({
2457
2593
  date: z.iso.date(),
2458
2594
  answers: z.number().int().nonnegative(),
@@ -2470,8 +2606,7 @@ const srsMemoryGrowthStatsOutputSchema = z.object({
2470
2606
  baseTotal: z.number().int().nonnegative(),
2471
2607
  daily: z.array(srsMemoryGrowthStatsItemSchema)
2472
2608
  }).strict();
2473
- //#endregion
2474
- //#region src/schemas/stats.ts
2609
+ // src/schemas/stats.ts
2475
2610
  const statsNotebaseIdsSchema = z.array(z.uuid()).min(1).transform((ids) => Array.from(new Set(ids)));
2476
2611
  const statsInputSchema = z.object({
2477
2612
  notebaseIds: statsNotebaseIdsSchema.optional(),
@@ -2486,8 +2621,7 @@ const activityStatsOutputSchema = z.object({
2486
2621
  srs: srsActivityStatsOutputSchema,
2487
2622
  notebase: notebaseActivityStatsOutputSchema
2488
2623
  }).strict();
2489
- //#endregion
2490
- //#region src/contracts/stats.ts
2624
+ // src/contracts/stats.ts
2491
2625
  const statsContract = {
2492
2626
  activity: oc.errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND")).route({
2493
2627
  method: "GET",
@@ -2515,8 +2649,89 @@ const statsContract = {
2515
2649
  tags: ["Statistics"]
2516
2650
  }).errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND")).input(srsBacklogStatsInputSchema).output(srsBacklogStatsOutputSchema)
2517
2651
  };
2518
- //#endregion
2519
- //#region src/schemas/user.ts
2652
+ // src/schemas/web-sync.ts
2653
+ /** The shapes the web app syncs, by their names in `@repo/electric-contract`. */
2654
+ const webSyncShapeSchema = z.enum([
2655
+ "notebases",
2656
+ "notebaseColumns",
2657
+ "notebaseRows",
2658
+ "cardTemplates",
2659
+ "cards",
2660
+ "revlogs",
2661
+ "mediaAssets"
2662
+ ]);
2663
+ /** The write whose change the page waited to see come back over Electric. */
2664
+ const webSyncOperationSchema = z.enum([
2665
+ "review",
2666
+ "reviewReplay",
2667
+ "undo",
2668
+ "bury",
2669
+ "suspend",
2670
+ "deleteNote",
2671
+ "deleteCard",
2672
+ "insert",
2673
+ "update",
2674
+ "delete",
2675
+ "setSleep",
2676
+ "srsSettings",
2677
+ "cardStatus",
2678
+ "createTemplate",
2679
+ "updateTemplate"
2680
+ ]);
2681
+ /** How the shape that lagged was receiving live changes. */
2682
+ const webSyncTransportSchema = z.enum(["sse", "longPoll"]);
2683
+ /**
2684
+ * A write wait is only reported once its first wait ran out: `recovered` when
2685
+ * reconnecting the lagging shapes brought the change, `failed` when the page
2686
+ * gave up on it.
2687
+ */
2688
+ const webSyncWriteOutcomeSchema = z.enum(["recovered", "failed"]);
2689
+ const webSyncStreamErrorTypeSchema = z.enum([
2690
+ "unauthorized",
2691
+ "forbidden",
2692
+ "badRequest",
2693
+ "clientError",
2694
+ "missingHeaders",
2695
+ "unexpected"
2696
+ ]);
2697
+ /** `initial` before the shape first loaded, when the page shows the error at once. */
2698
+ const webSyncStreamPhaseSchema = z.enum(["initial", "live"]);
2699
+ const webSyncPageSchema = z.enum(["reviewCombined", "reviewNotebase"]);
2700
+ const webSyncUnavailableReasonSchema = z.enum([
2701
+ "syncTimeout",
2702
+ "streamFailed",
2703
+ "notebaseGone"
2704
+ ]);
2705
+ const webSyncEventSchema = z.discriminatedUnion("type", [
2706
+ z.object({
2707
+ type: z.literal("writeWait"),
2708
+ operation: webSyncOperationSchema,
2709
+ outcome: webSyncWriteOutcomeSchema,
2710
+ transport: webSyncTransportSchema
2711
+ }).strict(),
2712
+ z.object({
2713
+ type: z.literal("streamError"),
2714
+ shape: webSyncShapeSchema,
2715
+ errorType: webSyncStreamErrorTypeSchema,
2716
+ phase: webSyncStreamPhaseSchema
2717
+ }).strict(),
2718
+ z.object({
2719
+ type: z.literal("unavailable"),
2720
+ page: webSyncPageSchema,
2721
+ reason: webSyncUnavailableReasonSchema
2722
+ }).strict()
2723
+ ]);
2724
+ /** A page sends what happened within a second or so as one batch. */
2725
+ const WEB_SYNC_REPORT_MAX_EVENTS = 20;
2726
+ const reportWebSyncInputSchema = z.object({ events: z.array(webSyncEventSchema).min(1).max(20) }).strict();
2727
+ // src/contracts/telemetry.ts
2728
+ const telemetryContract = { reportWebSync: oc.route({
2729
+ method: "POST",
2730
+ path: "/telemetry/web-sync",
2731
+ summary: "Report problems the web app had keeping its synced data live",
2732
+ tags: ["Telemetry"]
2733
+ }).input(reportWebSyncInputSchema).output(z.void()) };
2734
+ // src/schemas/user.ts
2520
2735
  const userEnsureTimezoneInputSchema = z.object({ timezone: timezoneSchema }).strict();
2521
2736
  const userEnsureTimezoneOutputSchema = z.object({
2522
2737
  timezone: timezoneSchema,
@@ -2531,8 +2746,7 @@ const userEnsureLocaleOutputSchema = z.object({
2531
2746
  }).strict();
2532
2747
  const userUpdateLocaleInputSchema = z.object({ locale: appLocaleSchema }).strict();
2533
2748
  const userUpdateLocaleOutputSchema = z.object({ locale: appLocaleSchema }).strict();
2534
- //#endregion
2535
- //#region src/contracts/user.ts
2749
+ // src/contracts/user.ts
2536
2750
  const userContract = {
2537
2751
  ensureTimezone: oc.route({
2538
2752
  method: "POST",
@@ -2559,8 +2773,7 @@ const userContract = {
2559
2773
  tags: ["Users"]
2560
2774
  }).input(userUpdateLocaleInputSchema).output(userUpdateLocaleOutputSchema)
2561
2775
  };
2562
- //#endregion
2563
- //#region src/schemas/video-transcript.ts
2776
+ // src/schemas/video-transcript.ts
2564
2777
  const videoTranscriptStatusSchema = z.enum([
2565
2778
  "pending",
2566
2779
  "processing",
@@ -2605,8 +2818,7 @@ const videoTranscriptUsageSchema = z.object({
2605
2818
  plan: billingPlanSchema,
2606
2819
  pools: z.array(videoTranscriptUsagePoolSchema)
2607
2820
  });
2608
- //#endregion
2609
- //#region src/index.ts
2821
+ // src/index.ts
2610
2822
  const contract = {
2611
2823
  billing: billingContract,
2612
2824
  card: cardContract,
@@ -2617,6 +2829,7 @@ const contract = {
2617
2829
  hostedAi: hostedAiContract,
2618
2830
  masteryGoal: masteryGoalContract,
2619
2831
  mcpConnection: mcpConnectionContract,
2832
+ media: mediaContract,
2620
2833
  notebase: notebaseContract,
2621
2834
  notebaseColumn: notebaseColumnContract,
2622
2835
  notebaseRow: notebaseRowContract,
@@ -2624,6 +2837,7 @@ const contract = {
2624
2837
  speech: speechContract,
2625
2838
  srs: srsContract,
2626
2839
  stats: statsContract,
2840
+ telemetry: telemetryContract,
2627
2841
  user: userContract,
2628
2842
  videoTranscript: {
2629
2843
  create: oc.errors(pickPublicErrorMap("VIDEO_TRANSCRIPTION_QUOTA_EXCEEDED", "VIDEO_TRANSCRIPTION_SUBSCRIPTION_REQUIRED", "VIDEO_TRANSCRIPTION_PAYMENT_REQUIRED", "VIDEO_TRANSCRIPTION_UNSUPPORTED_LENGTH")).route({
@@ -2652,7 +2866,6 @@ const contract = {
2652
2866
  }).input(videoTranscriptGetInputSchema).output(videoTranscriptSubtitlesSchema)
2653
2867
  }
2654
2868
  };
2655
- //#endregion
2656
- 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, HostedAiCreditPoolsInputSchema, HostedAiCreditPoolsOutputSchema, 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, PRACTICE_REMINDER_CATEGORY_KEY, PRACTICE_REMINDER_DEFAULT_TIME, PRACTICE_REMINDER_TIMES, PUBLIC_APP_ERROR_DEFS, PdfTranslationInsufficientCreditDataSchema, PdfTranslationUploadErrorDataSchema, 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, flattenStepSchema, 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, pdfTranslationDeleteOutputSchema, pdfTranslationDownloadOutputSchema, pdfTranslationGetOutputSchema, pdfTranslationJobIdInputSchema, pdfTranslationJobResourceSchema, pdfTranslationJobStatusSchema, pdfTranslationListInputSchema, pdfTranslationListOutputSchema, pdfTranslationOutputInputSchema, pdfTranslationOutputVariantSchema, pdfTranslationPreviewOutputSchema, pdfTranslationRequestUploadInputSchema, pdfTranslationRequestUploadOutputSchema, pdfTranslationStatusInputSchema, pdfTranslationStatusOutputSchema, pdfTranslationSubmitInputSchema, pdfTranslationSubmitOutputSchema, pickPublicErrorMap, postponePlanSchema, postponeStepSchema, postponeSummarySchema, practiceReminderTimeSchema, remindersPreferencesSchema, renderedCardSchema, reviewRatingSchema, scheduleStatusSchema, schedulingParamsSchema, speechPreferencesSchema, speechPreferencesUpdateInputSchema, speechRateSchema, speechSynthesizeInputSchema, speechSynthesizeOutputSchema, speechVoiceGenderSchema, speechVoiceNameSchema, speechVoiceSchema, speechVoicesOutputSchema, spreadDaySchema, srsAcknowledgeOptimizerResultsInputSchema, srsAcknowledgeOptimizerResultsOutputSchema, srsActivityStatsItemSchema, srsActivityStatsOutputSchema, srsApplyPostponeInputSchema, srsApplyPostponeOutputSchema, srsBacklogStatsInputSchema, srsBacklogStatsOutputSchema, srsBacklogStatsSchema, srsListCardRevlogsInputSchema, srsListCardRevlogsOutputSchema, srsListUnreadOptimizerResultsInputSchema, srsListUnreadOptimizerResultsOutputSchema, srsManualCardStatusInputSchema, srsMemoryGrowthStatsItemSchema, srsMemoryGrowthStatsOutputSchema, srsOptimizerUnreadResultSchema, srsPreviewPostponeInputSchema, srsPreviewPostponeOutputSchema, srsRecentNotebaseScheduleStatusStatsInputSchema, srsRecentNotebaseScheduleStatusStatsOutputSchema, srsRescheduleApplyOutputSchema, 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 };
2869
+ export { BILLING_PAYMENT_DUE_TIME_ZONE, CardDeleteInputSchema, CardDeleteOutputSchema, 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, EBOOK_LIMIT_BY_PLAN, 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, HostedAiCreditPoolsInputSchema, HostedAiCreditPoolsOutputSchema, 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, PRACTICE_REMINDER_CATEGORY_KEY, PRACTICE_REMINDER_DEFAULT_TIME, PRACTICE_REMINDER_TIMES, PUBLIC_APP_ERROR_DEFS, PdfTranslationInsufficientCreditDataSchema, PdfTranslationUploadErrorDataSchema, 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, WEB_SYNC_REPORT_MAX_EVENTS, 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, flattenStepSchema, getPublicErrorDefinition, isPublicAppErrorCode, masteryGoalOutputSchema, masteryGoalTargetSchema, masteryGoalUpdateInputSchema, mcpCallUsageSchema, mcpConnectionListOutputSchema, mcpConnectionRevokeInputSchema, mcpConnectionRevokeOutputSchema, mcpConnectionSchema, mediaAssetIdInputSchema, mediaAssetMetadataSchema, mediaAssetOutputSchema, mediaAssetSchema, mediaAssetStatusSchema, mediaContentTypeSchema, mediaFailureCodeSchema, mediaRequestUploadInputSchema, mediaRequestUploadOutputSchema, mediaUsageOutputSchema, notebaseActivityStatsItemSchema, notebaseActivityStatsOutputSchema, notebaseColumnCreateDataSchema, notebaseColumnSchema, notebaseColumnUpdateDataSchema, notebaseColumnWidthSchema, notebaseCreateDataSchema, notebaseRowCellsSchema, notebaseRowCreateDataSchema, notebaseRowGrowthStatsItemSchema, notebaseRowGrowthStatsOutputSchema, notebaseRowOriginInputSchema, notebaseRowSchema, notebaseRowUpdateDataSchema, notebaseSchema, notebaseSummarySchema, notebaseUpdateDataSchema, notebaseViewConfigSchema, notebaseViewCreateDataSchema, notebaseViewFilterSchema, notebaseViewFiltersSchema, notebaseViewSchema, notebaseViewSortSchema, notebaseViewSortsSchema, notebaseViewTypeSchema, notebaseViewUpdateDataSchema, pageSchema, paginationShape, pdfTranslationDeleteOutputSchema, pdfTranslationDownloadOutputSchema, pdfTranslationGetOutputSchema, pdfTranslationJobIdInputSchema, pdfTranslationJobResourceSchema, pdfTranslationJobStatusSchema, pdfTranslationListInputSchema, pdfTranslationListOutputSchema, pdfTranslationOutputInputSchema, pdfTranslationOutputVariantSchema, pdfTranslationPreviewOutputSchema, pdfTranslationRequestUploadInputSchema, pdfTranslationRequestUploadOutputSchema, pdfTranslationStatusInputSchema, pdfTranslationStatusOutputSchema, pdfTranslationSubmitInputSchema, pdfTranslationSubmitOutputSchema, pickPublicErrorMap, postponePlanSchema, postponeStepSchema, postponeSummarySchema, practiceReminderTimeSchema, remindersPreferencesSchema, renderedCardSchema, reportWebSyncInputSchema, reviewRatingSchema, scheduleStatusSchema, schedulingParamsSchema, speechPreferencesSchema, speechPreferencesUpdateInputSchema, speechRateSchema, speechSynthesizeInputSchema, speechSynthesizeOutputSchema, speechVoiceGenderSchema, speechVoiceNameSchema, speechVoiceSchema, speechVoicesOutputSchema, spreadDaySchema, srsAcknowledgeOptimizerResultsInputSchema, srsAcknowledgeOptimizerResultsOutputSchema, srsActivityStatsItemSchema, srsActivityStatsOutputSchema, srsApplyPostponeInputSchema, srsApplyPostponeOutputSchema, srsBacklogStatsInputSchema, srsBacklogStatsOutputSchema, srsBacklogStatsSchema, srsListCardRevlogsInputSchema, srsListCardRevlogsOutputSchema, srsListUnreadOptimizerResultsInputSchema, srsListUnreadOptimizerResultsOutputSchema, srsManualCardStatusInputSchema, srsMemoryGrowthStatsItemSchema, srsMemoryGrowthStatsOutputSchema, srsOptimizerUnreadResultSchema, srsPreviewPostponeInputSchema, srsPreviewPostponeOutputSchema, srsRecentNotebaseScheduleStatusStatsInputSchema, srsRecentNotebaseScheduleStatusStatsOutputSchema, srsRescheduleApplyOutputSchema, 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, webSyncEventSchema, webSyncOperationSchema, webSyncPageSchema, webSyncShapeSchema, webSyncStreamErrorTypeSchema, webSyncStreamPhaseSchema, webSyncTransportSchema, webSyncUnavailableReasonSchema, webSyncWriteOutcomeSchema };
2657
2870
 
2658
2871
  //# sourceMappingURL=index.js.map