@read-frog/api-contract 0.24.0 → 0.25.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, 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,8 +522,7 @@ 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",
@@ -738,10 +749,6 @@ const PUBLIC_APP_ERROR_DEFS = {
738
749
  message: "Concurrent position conflict, please retry",
739
750
  status: 409
740
751
  },
741
- EBOOK_BETA_RESTRICTED: {
742
- message: "Ebooks are currently in beta for selected accounts",
743
- status: 403
744
- },
745
752
  EBOOK_NOT_FOUND: {
746
753
  message: "Ebook not found",
747
754
  status: 404
@@ -758,6 +765,26 @@ const PUBLIC_APP_ERROR_DEFS = {
758
765
  message: "Ebook upload has not been completed",
759
766
  status: 409
760
767
  },
768
+ MEDIA_BETA_RESTRICTED: {
769
+ message: "Media uploads are currently in beta for selected accounts",
770
+ status: 403
771
+ },
772
+ MEDIA_NOT_FOUND: {
773
+ message: "Media file not found",
774
+ status: 404
775
+ },
776
+ MEDIA_FILE_TOO_LARGE: {
777
+ message: "Media file exceeds the maximum allowed size",
778
+ status: 413
779
+ },
780
+ MEDIA_QUOTA_EXCEEDED: {
781
+ message: "Not enough media storage space left on your plan",
782
+ status: 403
783
+ },
784
+ MEDIA_UPLOAD_NOT_COMPLETED: {
785
+ message: "Media upload has not been completed",
786
+ status: 409
787
+ },
761
788
  EMAIL_LINK_INVALID: {
762
789
  message: "This email link is not valid",
763
790
  status: 400
@@ -854,8 +881,7 @@ function pickPublicErrorMap(...codes) {
854
881
  }];
855
882
  }));
856
883
  }
857
- //#endregion
858
- //#region src/contracts/billing.ts
884
+ // src/contracts/billing.ts
859
885
  const billingProcedure = oc.errors(pickPublicErrorMap("BILLING_NOT_CONFIGURED", "BILLING_CUSTOMER_NOT_FOUND", "BILLING_PASS_ACTIVE", "BILLING_CHANGE_SCHEDULED", "BILLING_CHECKOUT_CONFLICT"));
860
886
  const billingContract = {
861
887
  status: billingProcedure.route({
@@ -883,8 +909,7 @@ const billingContract = {
883
909
  tags: ["Billing"]
884
910
  }).output(billingCancelScheduledChangeOutputSchema)
885
911
  };
886
- //#endregion
887
- //#region src/contracts/shared.ts
912
+ // src/contracts/shared.ts
888
913
  /**
889
914
  * Declares a procedure that is exposed to agents as an MCP tool, not only to
890
915
  * the REST/OpenAPI surface.
@@ -900,8 +925,7 @@ function defineAgentProcedure(route) {
900
925
  description: route.description
901
926
  }).route(route);
902
927
  }
903
- //#endregion
904
- //#region src/schemas/pagination.ts
928
+ // src/schemas/pagination.ts
905
929
  const paginationShape = {
906
930
  limit: z.number().int().min(1).max(500).optional(),
907
931
  offset: z.number().int().min(0).optional()
@@ -912,15 +936,13 @@ function pageSchema(itemSchema) {
912
936
  hasMore: z.boolean()
913
937
  });
914
938
  }
915
- //#endregion
916
- //#region src/schemas/resource-mutation.ts
939
+ // src/schemas/resource-mutation.ts
917
940
  const expectedUpdatedAtSchema = z.iso.datetime({ offset: true });
918
941
  const deletionResultSchema = z.object({
919
942
  id: z.uuid(),
920
943
  txid: z.number()
921
944
  });
922
- //#endregion
923
- //#region src/schemas/card.ts
945
+ // src/schemas/card.ts
924
946
  const cardTemplateSchema = z.object({
925
947
  id: z.uuid(),
926
948
  notebaseId: z.uuid(),
@@ -980,8 +1002,7 @@ const CardGenerateOutputSchema = z.object({
980
1002
  created: z.number().int().min(0),
981
1003
  txid: z.number()
982
1004
  });
983
- //#endregion
984
- //#region src/contracts/card.ts
1005
+ // src/contracts/card.ts
985
1006
  const cardContract = {
986
1007
  list: defineAgentProcedure({
987
1008
  method: "GET",
@@ -1004,8 +1025,7 @@ const cardContract = {
1004
1025
  tags: ["Cards"]
1005
1026
  }).input(CardGenerateInputSchema).output(CardGenerateOutputSchema)
1006
1027
  };
1007
- //#endregion
1008
- //#region src/contracts/card-template.ts
1028
+ // src/contracts/card-template.ts
1009
1029
  const cardTemplateContract = {
1010
1030
  list: defineAgentProcedure({
1011
1031
  method: "GET",
@@ -1043,8 +1063,7 @@ const cardTemplateContract = {
1043
1063
  tags: ["Card Templates"]
1044
1064
  }).errors(pickPublicErrorMap("CARD_TEMPLATE_NOT_FOUND")).input(CardTemplateDeleteInputSchema).output(CardTemplateDeleteOutputSchema)
1045
1065
  };
1046
- //#endregion
1047
- //#region src/schemas/ebook.ts
1066
+ // src/schemas/ebook.ts
1048
1067
  const ebookStatusSchema = z.enum(["pending", "ready"]);
1049
1068
  const ebookCoverContentTypeSchema = z.enum(EBOOK_ALLOWED_COVER_CONTENT_TYPES);
1050
1069
  const ebookListItemSchema = z.object({
@@ -1080,7 +1099,14 @@ const ebookRequestUploadInputSchema = z.object({
1080
1099
  cover: z.object({
1081
1100
  contentType: ebookCoverContentTypeSchema,
1082
1101
  byteSize: z.number().int().min(1)
1083
- }).strict().optional()
1102
+ }).strict().optional(),
1103
+ /**
1104
+ * The client's key for this upload. Asking again with the same key, after
1105
+ * an answer that never arrived or for a retry, returns the same pending
1106
+ * book with fresh targets instead of reserving another place in the
1107
+ * library's allowance.
1108
+ */
1109
+ uploadKey: z.uuid().optional()
1084
1110
  }).strict();
1085
1111
  /**
1086
1112
  * A signed PUT: send the file to `url` with exactly `headers`. The signature
@@ -1117,61 +1143,59 @@ const ebookRenameInputSchema = ebookRenameDataSchema.extend({ id: z.uuid() });
1117
1143
  const ebookRenameOutputSchema = z.object({ ebook: ebookListItemSchema }).strict();
1118
1144
  const ebookDeleteInputSchema = z.object({ id: z.uuid() }).strict();
1119
1145
  const ebookDeleteOutputSchema = z.object({ id: z.uuid() }).strict();
1120
- //#endregion
1121
- //#region src/contracts/ebook.ts
1146
+ // src/contracts/ebook.ts
1122
1147
  const ebookProcedure = oc;
1123
1148
  const ebookContract = {
1124
- list: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED")).route({
1149
+ list: ebookProcedure.route({
1125
1150
  method: "GET",
1126
1151
  path: "/ebooks",
1127
1152
  summary: "List ebooks with quota",
1128
1153
  tags: ["Ebooks"]
1129
1154
  }).input(ebookListInputSchema).output(ebookListOutputSchema),
1130
- get: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1155
+ get: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1131
1156
  method: "GET",
1132
1157
  path: "/ebooks/{id}",
1133
1158
  summary: "Get an ebook with reading progress",
1134
1159
  tags: ["Ebooks"]
1135
1160
  }).input(ebookGetInputSchema).output(ebookGetOutputSchema),
1136
- requestUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_LIMIT_EXCEEDED", "EBOOK_FILE_TOO_LARGE")).route({
1161
+ requestUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_LIMIT_EXCEEDED", "EBOOK_FILE_TOO_LARGE")).route({
1137
1162
  method: "POST",
1138
1163
  path: "/ebooks/uploads",
1139
1164
  summary: "Request presigned upload URLs for a new ebook",
1140
1165
  tags: ["Ebooks"]
1141
1166
  }).input(ebookRequestUploadInputSchema).output(ebookRequestUploadOutputSchema),
1142
- finalizeUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND", "EBOOK_UPLOAD_NOT_COMPLETED", "EBOOK_FILE_TOO_LARGE")).route({
1167
+ finalizeUpload: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND", "EBOOK_UPLOAD_NOT_COMPLETED", "EBOOK_FILE_TOO_LARGE")).route({
1143
1168
  method: "POST",
1144
1169
  path: "/ebooks/{ebookId}/finalize",
1145
1170
  summary: "Finalize an ebook upload",
1146
1171
  tags: ["Ebooks"]
1147
1172
  }).input(ebookFinalizeUploadInputSchema).output(ebookFinalizeUploadOutputSchema),
1148
- getDownloadUrl: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1173
+ getDownloadUrl: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1149
1174
  method: "GET",
1150
1175
  path: "/ebooks/{id}/download-url",
1151
1176
  summary: "Get a presigned download URL for an ebook",
1152
1177
  tags: ["Ebooks"]
1153
1178
  }).input(ebookGetDownloadUrlInputSchema).output(ebookGetDownloadUrlOutputSchema),
1154
- updateProgress: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1179
+ updateProgress: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1155
1180
  method: "PATCH",
1156
1181
  path: "/ebooks/{id}/progress",
1157
1182
  summary: "Update ebook reading progress",
1158
1183
  tags: ["Ebooks"]
1159
1184
  }).input(ebookUpdateProgressInputSchema).output(ebookUpdateProgressOutputSchema),
1160
- rename: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1185
+ rename: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1161
1186
  method: "PATCH",
1162
1187
  path: "/ebooks/{id}",
1163
1188
  summary: "Rename an ebook",
1164
1189
  tags: ["Ebooks"]
1165
1190
  }).input(ebookRenameInputSchema).output(ebookRenameOutputSchema),
1166
- delete: ebookProcedure.errors(pickPublicErrorMap("EBOOK_BETA_RESTRICTED", "EBOOK_NOT_FOUND")).route({
1191
+ delete: ebookProcedure.errors(pickPublicErrorMap("EBOOK_NOT_FOUND")).route({
1167
1192
  method: "DELETE",
1168
1193
  path: "/ebooks/{id}",
1169
1194
  summary: "Delete an ebook",
1170
1195
  tags: ["Ebooks"]
1171
1196
  }).input(ebookDeleteInputSchema).output(ebookDeleteOutputSchema)
1172
1197
  };
1173
- //#endregion
1174
- //#region src/schemas/email-preferences.ts
1198
+ // src/schemas/email-preferences.ts
1175
1199
  /** A category's key, such as `promotions`. */
1176
1200
  const emailCategoryKeySchema = z.string().max(64).regex(/^[a-z][a-z0-9_]*$/);
1177
1201
  /** The token in an email's unsubscribe link. */
@@ -1241,8 +1265,7 @@ const emailPreferencesUpdateByTokenInputSchema = z.object({
1241
1265
  locale: appLocaleSchema,
1242
1266
  ...emailPreferencesChangesShape
1243
1267
  }).strict();
1244
- //#endregion
1245
- //#region src/contracts/email-preferences.ts
1268
+ // src/contracts/email-preferences.ts
1246
1269
  const emailPreferencesContract = {
1247
1270
  get: oc.route({
1248
1271
  method: "GET",
@@ -1269,24 +1292,21 @@ const emailPreferencesContract = {
1269
1292
  tags: ["Email preferences"]
1270
1293
  }).errors(pickPublicErrorMap("EMAIL_LINK_INVALID")).input(emailPreferencesUpdateByTokenInputSchema).output(emailPreferencesByTokenStateSchema)
1271
1294
  };
1272
- //#endregion
1273
- //#region src/schemas/feature-access.ts
1295
+ // src/schemas/feature-access.ts
1274
1296
  const GatedFeatureKeySchema = z.enum(GATED_FEATURE_KEYS);
1275
1297
  const FeatureAccessStatusInputSchema = z.object({ featureKey: GatedFeatureKeySchema }).strict();
1276
1298
  const FeatureAccessStatusOutputSchema = z.object({
1277
1299
  featureKey: GatedFeatureKeySchema,
1278
1300
  allowed: z.boolean()
1279
1301
  });
1280
- //#endregion
1281
- //#region src/contracts/feature-access.ts
1302
+ // src/contracts/feature-access.ts
1282
1303
  const featureAccessContract = { status: oc.route({
1283
1304
  method: "GET",
1284
1305
  path: "/feature-access/status",
1285
1306
  summary: "Get whether the caller can use a gated feature",
1286
1307
  tags: ["Feature Access"]
1287
1308
  }).input(FeatureAccessStatusInputSchema).output(FeatureAccessStatusOutputSchema) };
1288
- //#endregion
1289
- //#region src/contracts/hosted-ai.ts
1309
+ // src/contracts/hosted-ai.ts
1290
1310
  const hostedAiStreamErrors = pickPublicErrorMap("HOSTED_AI_TIER_RESTRICTED", "HOSTED_AI_QUOTA_EXHAUSTED");
1291
1311
  const hostedAiContract = {
1292
1312
  pools: oc.route({
@@ -1359,8 +1379,7 @@ const hostedAiContract = {
1359
1379
  tags: ["Hosted AI"]
1360
1380
  }).input(HostedAiNoteSuggestionStreamInputSchema).output(eventIterator(HostedAiStreamPartSchema)).errors(hostedAiStreamErrors) }
1361
1381
  };
1362
- //#endregion
1363
- //#region src/schemas/mastery-goal.ts
1382
+ // src/schemas/mastery-goal.ts
1364
1383
  const MASTERY_GOAL_TARGET_MAX = 1e6;
1365
1384
  /** How many mastered cards to aim for: the cards `stats.srsMemoryGrowth` counts. */
1366
1385
  const masteryGoalTargetSchema = z.number().int().min(1).max(MASTERY_GOAL_TARGET_MAX);
@@ -1368,8 +1387,7 @@ const masteryGoalTargetSchema = z.number().int().min(1).max(MASTERY_GOAL_TARGET_
1368
1387
  const masteryGoalUpdateInputSchema = z.object({ target: masteryGoalTargetSchema.nullable() }).strict();
1369
1388
  /** The goal's target, or `null` while none is set. */
1370
1389
  const masteryGoalOutputSchema = z.object({ target: masteryGoalTargetSchema.nullable() }).strict();
1371
- //#endregion
1372
- //#region src/contracts/mastery-goal.ts
1390
+ // src/contracts/mastery-goal.ts
1373
1391
  const masteryGoalContract = {
1374
1392
  get: oc.route({
1375
1393
  method: "GET",
@@ -1384,8 +1402,7 @@ const masteryGoalContract = {
1384
1402
  tags: ["Goals"]
1385
1403
  }).input(masteryGoalUpdateInputSchema).output(masteryGoalOutputSchema)
1386
1404
  };
1387
- //#endregion
1388
- //#region src/schemas/mcp-connection.ts
1405
+ // src/schemas/mcp-connection.ts
1389
1406
  const mcpConnectionSchema = z.object({
1390
1407
  /** OAuth client identifier. For a CIMD client this is an https URL. */
1391
1408
  clientId: z.string(),
@@ -1405,8 +1422,20 @@ const mcpConnectionSchema = z.object({
1405
1422
  const mcpConnectionListOutputSchema = z.array(mcpConnectionSchema);
1406
1423
  const mcpConnectionRevokeInputSchema = z.object({ clientId: z.string().min(1) }).strict();
1407
1424
  const mcpConnectionRevokeOutputSchema = z.object({ clientId: z.string() }).strict();
1408
- //#endregion
1409
- //#region src/contracts/mcp-connection.ts
1425
+ /**
1426
+ * How many MCP tool calls the caller has used of their plan's
1427
+ * `MCP_DAILY_CALL_LIMITS`, read without counting one. The window is 24 hours
1428
+ * from the first call in it, not a calendar day.
1429
+ */
1430
+ const mcpCallUsageSchema = z.object({
1431
+ /** Calls used in the current window, at most `limit`. */
1432
+ usedCalls: z.number().int().min(0),
1433
+ /** null: the plan has no daily limit. */
1434
+ limit: z.number().int().positive().nullable(),
1435
+ /** When the current 24-hour window ends; null when no window is open or there is no limit. */
1436
+ resetAt: z.iso.datetime().nullable()
1437
+ }).strict();
1438
+ // src/contracts/mcp-connection.ts
1410
1439
  const mcpConnectionContract = {
1411
1440
  list: oc.route({
1412
1441
  method: "GET",
@@ -1419,10 +1448,95 @@ const mcpConnectionContract = {
1419
1448
  path: "/mcp-connections/revoke",
1420
1449
  summary: "Withdraw a client's authorization and revoke its tokens",
1421
1450
  tags: ["MCP Connections"]
1422
- }).input(mcpConnectionRevokeInputSchema).output(mcpConnectionRevokeOutputSchema)
1451
+ }).input(mcpConnectionRevokeInputSchema).output(mcpConnectionRevokeOutputSchema),
1452
+ usage: oc.route({
1453
+ method: "GET",
1454
+ path: "/mcp-connections/usage",
1455
+ summary: "Get the MCP tool calls the caller has used of their plan's daily limit",
1456
+ tags: ["MCP Connections"]
1457
+ }).input(z.object({}).strict()).output(mcpCallUsageSchema)
1458
+ };
1459
+ // src/schemas/media.ts
1460
+ const mediaContentTypeSchema = z.enum(MEDIA_CONTENT_TYPES);
1461
+ const mediaAssetStatusSchema = z.enum(MEDIA_ASSET_STATUS_VALUES);
1462
+ /** Why the worker rejected an upload. */
1463
+ const mediaFailureCodeSchema = z.enum([
1464
+ "unsupported_format",
1465
+ "invalid_file",
1466
+ "file_too_large",
1467
+ "image_too_large",
1468
+ "audio_too_long",
1469
+ "quota_exceeded",
1470
+ "processing_failed"
1471
+ ]);
1472
+ const mediaAssetMetadataSchema = z.discriminatedUnion("kind", [z.object({
1473
+ kind: z.literal("image"),
1474
+ width: z.number().int(),
1475
+ height: z.number().int()
1476
+ }).strict(), z.object({
1477
+ kind: z.literal("audio"),
1478
+ durationMs: z.number().int()
1479
+ }).strict()]);
1480
+ const mediaAssetSchema = z.object({
1481
+ id: z.uuid(),
1482
+ /** What a cell stores to reference the asset; null until it is ready. */
1483
+ uri: z.string().nullable(),
1484
+ status: mediaAssetStatusSchema,
1485
+ contentType: z.string().nullable(),
1486
+ fileByteSize: z.number().int(),
1487
+ metadata: mediaAssetMetadataSchema.nullable(),
1488
+ failureCode: mediaFailureCodeSchema.nullable(),
1489
+ createdAt: z.coerce.date()
1490
+ }).strict();
1491
+ const mediaRequestUploadInputSchema = z.object({
1492
+ contentType: mediaContentTypeSchema,
1493
+ byteSize: z.number().int().min(1)
1494
+ }).strict();
1495
+ const mediaRequestUploadOutputSchema = z.object({
1496
+ assetId: z.uuid(),
1497
+ /** A signed PUT: send the file to `url` with exactly `headers`. */
1498
+ upload: z.object({
1499
+ url: z.url(),
1500
+ headers: z.record(z.string(), z.string())
1501
+ }).strict(),
1502
+ expiresAt: z.coerce.date()
1503
+ }).strict();
1504
+ const mediaAssetIdInputSchema = z.object({ id: z.uuid() }).strict();
1505
+ const mediaAssetOutputSchema = z.object({ asset: mediaAssetSchema }).strict();
1506
+ const mediaUsageOutputSchema = z.object({
1507
+ usedBytes: z.number().int().min(0),
1508
+ /** Held by uploads that are not done yet. */
1509
+ reservedBytes: z.number().int().min(0),
1510
+ limitBytes: z.number().int().min(0)
1511
+ }).strict();
1512
+ // src/contracts/media.ts
1513
+ const mediaContract = {
1514
+ requestUpload: oc.errors(pickPublicErrorMap("MEDIA_BETA_RESTRICTED", "MEDIA_FILE_TOO_LARGE", "MEDIA_QUOTA_EXCEEDED")).route({
1515
+ method: "POST",
1516
+ path: "/media/uploads",
1517
+ summary: "Reserve space and get a signed upload URL for a media file",
1518
+ tags: ["Media"]
1519
+ }).input(mediaRequestUploadInputSchema).output(mediaRequestUploadOutputSchema),
1520
+ completeUpload: oc.errors(pickPublicErrorMap("MEDIA_BETA_RESTRICTED", "MEDIA_NOT_FOUND", "MEDIA_UPLOAD_NOT_COMPLETED")).route({
1521
+ method: "POST",
1522
+ path: "/media/{id}/complete",
1523
+ summary: "Queue an uploaded media file for validation",
1524
+ tags: ["Media"]
1525
+ }).input(mediaAssetIdInputSchema).output(mediaAssetOutputSchema),
1526
+ get: oc.errors(pickPublicErrorMap("MEDIA_BETA_RESTRICTED", "MEDIA_NOT_FOUND")).route({
1527
+ method: "GET",
1528
+ path: "/media/{id}",
1529
+ summary: "Get a media asset and its upload status",
1530
+ tags: ["Media"]
1531
+ }).input(mediaAssetIdInputSchema).output(mediaAssetOutputSchema),
1532
+ usage: oc.errors(pickPublicErrorMap("MEDIA_BETA_RESTRICTED")).route({
1533
+ method: "GET",
1534
+ path: "/media/usage",
1535
+ summary: "Get the media space used, reserved and allowed",
1536
+ tags: ["Media"]
1537
+ }).input(z.object({}).strict()).output(mediaUsageOutputSchema)
1423
1538
  };
1424
- //#endregion
1425
- //#region src/schemas/notebase-column.ts
1539
+ // src/schemas/notebase-column.ts
1426
1540
  const notebaseColumnWidthSchema = z.number().int().min(NOTEBASE_COLUMN_MIN_WIDTH).max(NOTEBASE_COLUMN_MAX_WIDTH);
1427
1541
  const notebaseColumnSchema = z.object({
1428
1542
  id: z.string(),
@@ -1471,8 +1585,7 @@ const NotebaseColumnReorderInputSchema = z.object({
1471
1585
  ids: z.array(z.uuid())
1472
1586
  });
1473
1587
  const NotebaseColumnReorderOutputSchema = z.object({ txid: z.number() });
1474
- //#endregion
1475
- //#region src/schemas/notebase-row.ts
1588
+ // src/schemas/notebase-row.ts
1476
1589
  const notebaseRowCellsSchema = z.record(z.string(), z.unknown());
1477
1590
  const notebaseRowSchema = z.object({
1478
1591
  id: z.string(),
@@ -1595,8 +1708,7 @@ const NotebaseRowListInputSchema = z.object({
1595
1708
  const NotebaseRowListOutputSchema = pageSchema(notebaseRowSchema);
1596
1709
  const NotebaseRowGetInputSchema = z.object({ id: z.uuid() });
1597
1710
  const NotebaseRowGetOutputSchema = notebaseRowSchema;
1598
- //#endregion
1599
- //#region src/schemas/notebase-view.ts
1711
+ // src/schemas/notebase-view.ts
1600
1712
  const notebaseViewTypeSchema = z.enum([
1601
1713
  "table",
1602
1714
  "kanban",
@@ -1645,8 +1757,7 @@ const notebaseViewSchema = z.object({
1645
1757
  createdAt: z.coerce.date(),
1646
1758
  updatedAt: z.coerce.date()
1647
1759
  });
1648
- //#endregion
1649
- //#region src/schemas/notebase.ts
1760
+ // src/schemas/notebase.ts
1650
1761
  const NotebaseListInputSchema = z.object({});
1651
1762
  const notebaseSummarySchema = z.object({
1652
1763
  id: z.string(),
@@ -1760,8 +1871,7 @@ const NotebaseGetSchemaOutputSchema = z.object({
1760
1871
  updatedAt: z.coerce.date(),
1761
1872
  notebaseColumns: z.array(notebaseColumnSchema)
1762
1873
  });
1763
- //#endregion
1764
- //#region src/contracts/notebase.ts
1874
+ // src/contracts/notebase.ts
1765
1875
  const notebaseContract = {
1766
1876
  list: defineAgentProcedure({
1767
1877
  method: "GET",
@@ -1819,8 +1929,7 @@ const notebaseContract = {
1819
1929
  tags: ["Notebases"]
1820
1930
  }).errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND")).input(NotebaseDeleteInputSchema).output(NotebaseDeleteOutputSchema)
1821
1931
  };
1822
- //#endregion
1823
- //#region src/contracts/notebase-column.ts
1932
+ // src/contracts/notebase-column.ts
1824
1933
  const notebaseColumnContract = {
1825
1934
  create: defineAgentProcedure({
1826
1935
  method: "POST",
@@ -1850,8 +1959,7 @@ const notebaseColumnContract = {
1850
1959
  tags: ["Notebase Columns"]
1851
1960
  }).input(NotebaseColumnReorderInputSchema).output(NotebaseColumnReorderOutputSchema)
1852
1961
  };
1853
- //#endregion
1854
- //#region src/contracts/notebase-row.ts
1962
+ // src/contracts/notebase-row.ts
1855
1963
  const notebaseRowContract = {
1856
1964
  list: defineAgentProcedure({
1857
1965
  method: "GET",
@@ -1916,8 +2024,7 @@ const notebaseRowContract = {
1916
2024
  tags: ["Notebase Rows"]
1917
2025
  }).input(NotebaseRowReorderInputSchema).output(NotebaseRowReorderOutputSchema)
1918
2026
  };
1919
- //#endregion
1920
- //#region src/contracts/pdf-translation.ts
2027
+ // src/contracts/pdf-translation.ts
1921
2028
  const pdfTranslationProcedure = oc.errors(pickPublicErrorMap("PDF_TRANSLATION_UNAVAILABLE"));
1922
2029
  const pdfTranslationContract = {
1923
2030
  status: pdfTranslationProcedure.route({
@@ -1975,8 +2082,7 @@ const pdfTranslationContract = {
1975
2082
  tags: ["PDF Translation"]
1976
2083
  }).input(pdfTranslationJobIdInputSchema).output(pdfTranslationDeleteOutputSchema)
1977
2084
  };
1978
- //#endregion
1979
- //#region src/schemas/speech.ts
2085
+ // src/schemas/speech.ts
1980
2086
  /** The longest text one request reads aloud. */
1981
2087
  const SPEECH_TEXT_MAX_LENGTH = 500;
1982
2088
  /**
@@ -2050,8 +2156,7 @@ const speechSynthesizeOutputSchema = z.object({
2050
2156
  url: z.url(),
2051
2157
  expiresAt: z.coerce.date()
2052
2158
  }).strict();
2053
- //#endregion
2054
- //#region src/contracts/speech.ts
2159
+ // src/contracts/speech.ts
2055
2160
  const speechContract = {
2056
2161
  getPreferences: oc.route({
2057
2162
  method: "GET",
@@ -2078,8 +2183,7 @@ const speechContract = {
2078
2183
  tags: ["Speech"]
2079
2184
  }).input(speechSynthesizeInputSchema).output(speechSynthesizeOutputSchema)
2080
2185
  };
2081
- //#endregion
2082
- //#region src/schemas/timezone.ts
2186
+ // src/schemas/timezone.ts
2083
2187
  const timezoneFormatters = /* @__PURE__ */ new Map();
2084
2188
  function toCacheKey(timezone) {
2085
2189
  return timezone.replace(/[A-Z]/g, (letter) => letter.toLowerCase());
@@ -2122,8 +2226,7 @@ const canonicalTimezoneSchema = timezoneSchema.transform((timezone, ctx) => {
2122
2226
  }
2123
2227
  return name;
2124
2228
  });
2125
- //#endregion
2126
- //#region src/schemas/srs.ts
2229
+ // src/schemas/srs.ts
2127
2230
  const stepSchema = srsStepSchema;
2128
2231
  const SRS_REVIEW_CLIENT_ID_NAMESPACE = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
2129
2232
  const srsReviewClientIdNamePrefix = "readfrog:srs-review";
@@ -2189,7 +2292,7 @@ const srsListCardRevlogsOutputSchema = z.object({
2189
2292
  const srsReviewOutputSchema = z.object({
2190
2293
  card: cardSchema,
2191
2294
  revlog: srsRevlogSchema,
2192
- txid: z.number(),
2295
+ txid: z.number().nullable(),
2193
2296
  created: z.boolean()
2194
2297
  });
2195
2298
  const srsRollbackReviewOutputSchema = z.object({
@@ -2359,8 +2462,7 @@ const srsRescheduleApplyOutputSchema = z.object({
2359
2462
  reviewsPerDay: schedulingParamsShape.reviewsPerDay
2360
2463
  });
2361
2464
  const srsApplyPostponeOutputSchema = srsRescheduleApplyOutputSchema;
2362
- //#endregion
2363
- //#region src/contracts/srs.ts
2465
+ // src/contracts/srs.ts
2364
2466
  const srsContract = {
2365
2467
  scheduleStatusStats: defineAgentProcedure({
2366
2468
  method: "GET",
@@ -2436,8 +2538,7 @@ const srsContract = {
2436
2538
  tags: ["SRS"]
2437
2539
  }).input(srsApplyPostponeInputSchema).output(srsApplyPostponeOutputSchema)
2438
2540
  };
2439
- //#endregion
2440
- //#region src/schemas/notebase-stats.ts
2541
+ // src/schemas/notebase-stats.ts
2441
2542
  const notebaseActivityStatsItemSchema = z.object({
2442
2543
  date: z.iso.date(),
2443
2544
  notes: z.number().int().nonnegative()
@@ -2451,8 +2552,7 @@ const notebaseRowGrowthStatsOutputSchema = z.object({
2451
2552
  baseTotal: z.number().int().nonnegative(),
2452
2553
  daily: z.array(notebaseRowGrowthStatsItemSchema)
2453
2554
  }).strict();
2454
- //#endregion
2455
- //#region src/schemas/srs-stats.ts
2555
+ // src/schemas/srs-stats.ts
2456
2556
  const srsActivityStatsItemSchema = z.object({
2457
2557
  date: z.iso.date(),
2458
2558
  answers: z.number().int().nonnegative(),
@@ -2470,8 +2570,7 @@ const srsMemoryGrowthStatsOutputSchema = z.object({
2470
2570
  baseTotal: z.number().int().nonnegative(),
2471
2571
  daily: z.array(srsMemoryGrowthStatsItemSchema)
2472
2572
  }).strict();
2473
- //#endregion
2474
- //#region src/schemas/stats.ts
2573
+ // src/schemas/stats.ts
2475
2574
  const statsNotebaseIdsSchema = z.array(z.uuid()).min(1).transform((ids) => Array.from(new Set(ids)));
2476
2575
  const statsInputSchema = z.object({
2477
2576
  notebaseIds: statsNotebaseIdsSchema.optional(),
@@ -2486,8 +2585,7 @@ const activityStatsOutputSchema = z.object({
2486
2585
  srs: srsActivityStatsOutputSchema,
2487
2586
  notebase: notebaseActivityStatsOutputSchema
2488
2587
  }).strict();
2489
- //#endregion
2490
- //#region src/contracts/stats.ts
2588
+ // src/contracts/stats.ts
2491
2589
  const statsContract = {
2492
2590
  activity: oc.errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND")).route({
2493
2591
  method: "GET",
@@ -2515,8 +2613,88 @@ const statsContract = {
2515
2613
  tags: ["Statistics"]
2516
2614
  }).errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND")).input(srsBacklogStatsInputSchema).output(srsBacklogStatsOutputSchema)
2517
2615
  };
2518
- //#endregion
2519
- //#region src/schemas/user.ts
2616
+ // src/schemas/web-sync.ts
2617
+ /** The shapes the web app syncs, by their names in `@repo/electric-contract`. */
2618
+ const webSyncShapeSchema = z.enum([
2619
+ "notebases",
2620
+ "notebaseColumns",
2621
+ "notebaseRows",
2622
+ "cardTemplates",
2623
+ "cards",
2624
+ "revlogs",
2625
+ "mediaAssets"
2626
+ ]);
2627
+ /** The write whose change the page waited to see come back over Electric. */
2628
+ const webSyncOperationSchema = z.enum([
2629
+ "review",
2630
+ "reviewReplay",
2631
+ "undo",
2632
+ "bury",
2633
+ "suspend",
2634
+ "deleteNote",
2635
+ "insert",
2636
+ "update",
2637
+ "delete",
2638
+ "setSleep",
2639
+ "srsSettings",
2640
+ "cardStatus",
2641
+ "createTemplate",
2642
+ "updateTemplate"
2643
+ ]);
2644
+ /** How the shape that lagged was receiving live changes. */
2645
+ const webSyncTransportSchema = z.enum(["sse", "longPoll"]);
2646
+ /**
2647
+ * A write wait is only reported once its first wait ran out: `recovered` when
2648
+ * reconnecting the lagging shapes brought the change, `failed` when the page
2649
+ * gave up on it.
2650
+ */
2651
+ const webSyncWriteOutcomeSchema = z.enum(["recovered", "failed"]);
2652
+ const webSyncStreamErrorTypeSchema = z.enum([
2653
+ "unauthorized",
2654
+ "forbidden",
2655
+ "badRequest",
2656
+ "clientError",
2657
+ "missingHeaders",
2658
+ "unexpected"
2659
+ ]);
2660
+ /** `initial` before the shape first loaded, when the page shows the error at once. */
2661
+ const webSyncStreamPhaseSchema = z.enum(["initial", "live"]);
2662
+ const webSyncPageSchema = z.enum(["reviewCombined", "reviewNotebase"]);
2663
+ const webSyncUnavailableReasonSchema = z.enum([
2664
+ "syncTimeout",
2665
+ "streamFailed",
2666
+ "notebaseGone"
2667
+ ]);
2668
+ const webSyncEventSchema = z.discriminatedUnion("type", [
2669
+ z.object({
2670
+ type: z.literal("writeWait"),
2671
+ operation: webSyncOperationSchema,
2672
+ outcome: webSyncWriteOutcomeSchema,
2673
+ transport: webSyncTransportSchema
2674
+ }).strict(),
2675
+ z.object({
2676
+ type: z.literal("streamError"),
2677
+ shape: webSyncShapeSchema,
2678
+ errorType: webSyncStreamErrorTypeSchema,
2679
+ phase: webSyncStreamPhaseSchema
2680
+ }).strict(),
2681
+ z.object({
2682
+ type: z.literal("unavailable"),
2683
+ page: webSyncPageSchema,
2684
+ reason: webSyncUnavailableReasonSchema
2685
+ }).strict()
2686
+ ]);
2687
+ /** A page sends what happened within a second or so as one batch. */
2688
+ const WEB_SYNC_REPORT_MAX_EVENTS = 20;
2689
+ const reportWebSyncInputSchema = z.object({ events: z.array(webSyncEventSchema).min(1).max(20) }).strict();
2690
+ // src/contracts/telemetry.ts
2691
+ const telemetryContract = { reportWebSync: oc.route({
2692
+ method: "POST",
2693
+ path: "/telemetry/web-sync",
2694
+ summary: "Report problems the web app had keeping its synced data live",
2695
+ tags: ["Telemetry"]
2696
+ }).input(reportWebSyncInputSchema).output(z.void()) };
2697
+ // src/schemas/user.ts
2520
2698
  const userEnsureTimezoneInputSchema = z.object({ timezone: timezoneSchema }).strict();
2521
2699
  const userEnsureTimezoneOutputSchema = z.object({
2522
2700
  timezone: timezoneSchema,
@@ -2531,8 +2709,7 @@ const userEnsureLocaleOutputSchema = z.object({
2531
2709
  }).strict();
2532
2710
  const userUpdateLocaleInputSchema = z.object({ locale: appLocaleSchema }).strict();
2533
2711
  const userUpdateLocaleOutputSchema = z.object({ locale: appLocaleSchema }).strict();
2534
- //#endregion
2535
- //#region src/contracts/user.ts
2712
+ // src/contracts/user.ts
2536
2713
  const userContract = {
2537
2714
  ensureTimezone: oc.route({
2538
2715
  method: "POST",
@@ -2559,8 +2736,7 @@ const userContract = {
2559
2736
  tags: ["Users"]
2560
2737
  }).input(userUpdateLocaleInputSchema).output(userUpdateLocaleOutputSchema)
2561
2738
  };
2562
- //#endregion
2563
- //#region src/schemas/video-transcript.ts
2739
+ // src/schemas/video-transcript.ts
2564
2740
  const videoTranscriptStatusSchema = z.enum([
2565
2741
  "pending",
2566
2742
  "processing",
@@ -2605,8 +2781,7 @@ const videoTranscriptUsageSchema = z.object({
2605
2781
  plan: billingPlanSchema,
2606
2782
  pools: z.array(videoTranscriptUsagePoolSchema)
2607
2783
  });
2608
- //#endregion
2609
- //#region src/index.ts
2784
+ // src/index.ts
2610
2785
  const contract = {
2611
2786
  billing: billingContract,
2612
2787
  card: cardContract,
@@ -2617,6 +2792,7 @@ const contract = {
2617
2792
  hostedAi: hostedAiContract,
2618
2793
  masteryGoal: masteryGoalContract,
2619
2794
  mcpConnection: mcpConnectionContract,
2795
+ media: mediaContract,
2620
2796
  notebase: notebaseContract,
2621
2797
  notebaseColumn: notebaseColumnContract,
2622
2798
  notebaseRow: notebaseRowContract,
@@ -2624,6 +2800,7 @@ const contract = {
2624
2800
  speech: speechContract,
2625
2801
  srs: srsContract,
2626
2802
  stats: statsContract,
2803
+ telemetry: telemetryContract,
2627
2804
  user: userContract,
2628
2805
  videoTranscript: {
2629
2806
  create: oc.errors(pickPublicErrorMap("VIDEO_TRANSCRIPTION_QUOTA_EXCEEDED", "VIDEO_TRANSCRIPTION_SUBSCRIPTION_REQUIRED", "VIDEO_TRANSCRIPTION_PAYMENT_REQUIRED", "VIDEO_TRANSCRIPTION_UNSUPPORTED_LENGTH")).route({
@@ -2652,7 +2829,6 @@ const contract = {
2652
2829
  }).input(videoTranscriptGetInputSchema).output(videoTranscriptSubtitlesSchema)
2653
2830
  }
2654
2831
  };
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 };
2832
+ 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, 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, 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
2833
 
2658
2834
  //# sourceMappingURL=index.js.map