@read-frog/api-contract 0.8.1 → 0.9.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.d.ts CHANGED
@@ -75,6 +75,18 @@ declare const PUBLIC_APP_ERROR_DEFS: {
75
75
  readonly message: "Notebase column is used by a card template";
76
76
  readonly status: 409;
77
77
  };
78
+ readonly NOTE_LIMIT_EXCEEDED: {
79
+ readonly message: "Upgrade is required to create more Notebase notes";
80
+ readonly status: 403;
81
+ };
82
+ readonly BILLING_NOT_CONFIGURED: {
83
+ readonly message: "Billing is not configured";
84
+ readonly status: 503;
85
+ };
86
+ readonly BILLING_CUSTOMER_NOT_FOUND: {
87
+ readonly message: "Billing customer not found";
88
+ readonly status: 404;
89
+ };
78
90
  readonly CARD_NOT_REVIEWABLE: {
79
91
  readonly message: "Card cannot be reviewed in its current state";
80
92
  readonly status: 409;
@@ -181,6 +193,18 @@ declare function getPublicErrorDefinition<TCode extends PublicAppErrorCode>(code
181
193
  readonly message: "Notebase column is used by a card template";
182
194
  readonly status: 409;
183
195
  };
196
+ readonly NOTE_LIMIT_EXCEEDED: {
197
+ readonly message: "Upgrade is required to create more Notebase notes";
198
+ readonly status: 403;
199
+ };
200
+ readonly BILLING_NOT_CONFIGURED: {
201
+ readonly message: "Billing is not configured";
202
+ readonly status: 503;
203
+ };
204
+ readonly BILLING_CUSTOMER_NOT_FOUND: {
205
+ readonly message: "Billing customer not found";
206
+ readonly status: 404;
207
+ };
184
208
  readonly CARD_NOT_REVIEWABLE: {
185
209
  readonly message: "Card cannot be reviewed in its current state";
186
210
  readonly status: 409;
@@ -267,6 +291,66 @@ declare const BetaAccessStatusOutputSchema: z.ZodObject<{
267
291
  }, z.core.$strip>;
268
292
  type BetaAccessStatusOutput = z.infer<typeof BetaAccessStatusOutputSchema>;
269
293
  //#endregion
294
+ //#region src/schemas/billing.d.ts
295
+ declare const billingIntervalSchema: z.ZodEnum<{
296
+ month: "month";
297
+ year: "year";
298
+ }>;
299
+ type BillingInterval = z.infer<typeof billingIntervalSchema>;
300
+ declare const billingSubscriptionStatusSchema: z.ZodEnum<{
301
+ incomplete: "incomplete";
302
+ incomplete_expired: "incomplete_expired";
303
+ trialing: "trialing";
304
+ active: "active";
305
+ past_due: "past_due";
306
+ canceled: "canceled";
307
+ unpaid: "unpaid";
308
+ paused: "paused";
309
+ }>;
310
+ type BillingSubscriptionStatus = z.infer<typeof billingSubscriptionStatusSchema>;
311
+ declare const billingPlanSchema: z.ZodEnum<{
312
+ free: "free";
313
+ pro: "pro";
314
+ }>;
315
+ type BillingPlan = z.infer<typeof billingPlanSchema>;
316
+ declare const billingStatusSchema: z.ZodObject<{
317
+ plan: z.ZodEnum<{
318
+ free: "free";
319
+ pro: "pro";
320
+ }>;
321
+ status: z.ZodNullable<z.ZodEnum<{
322
+ incomplete: "incomplete";
323
+ incomplete_expired: "incomplete_expired";
324
+ trialing: "trialing";
325
+ active: "active";
326
+ past_due: "past_due";
327
+ canceled: "canceled";
328
+ unpaid: "unpaid";
329
+ paused: "paused";
330
+ }>>;
331
+ interval: z.ZodNullable<z.ZodEnum<{
332
+ month: "month";
333
+ year: "year";
334
+ }>>;
335
+ currentPeriodEnd: z.ZodNullable<z.ZodCoercedDate<unknown>>;
336
+ cancelAtPeriodEnd: z.ZodBoolean;
337
+ unlimitedNotebaseNotes: z.ZodBoolean;
338
+ notebaseNoteLimit: z.ZodNumber;
339
+ notebaseNoteCount: z.ZodNumber;
340
+ }, z.core.$strict>;
341
+ type BillingStatus = z.infer<typeof billingStatusSchema>;
342
+ declare const billingCreateCheckoutSessionInputSchema: z.ZodObject<{
343
+ interval: z.ZodEnum<{
344
+ month: "month";
345
+ year: "year";
346
+ }>;
347
+ }, z.core.$strict>;
348
+ type BillingCreateCheckoutSessionInput = z.infer<typeof billingCreateCheckoutSessionInputSchema>;
349
+ declare const billingSessionUrlOutputSchema: z.ZodObject<{
350
+ url: z.ZodURL;
351
+ }, z.core.$strict>;
352
+ type BillingSessionUrlOutput = z.infer<typeof billingSessionUrlOutputSchema>;
353
+ //#endregion
270
354
  //#region src/schemas/card.d.ts
271
355
  declare const cardTemplateSchema: z.ZodObject<{
272
356
  id: z.ZodUUID;
@@ -1468,6 +1552,44 @@ declare const contract: {
1468
1552
  allowed: import("zod").ZodBoolean;
1469
1553
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1470
1554
  };
1555
+ billing: {
1556
+ status: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodObject<{
1557
+ plan: import("zod").ZodEnum<{
1558
+ free: "free";
1559
+ pro: "pro";
1560
+ }>;
1561
+ status: import("zod").ZodNullable<import("zod").ZodEnum<{
1562
+ incomplete: "incomplete";
1563
+ incomplete_expired: "incomplete_expired";
1564
+ trialing: "trialing";
1565
+ active: "active";
1566
+ past_due: "past_due";
1567
+ canceled: "canceled";
1568
+ unpaid: "unpaid";
1569
+ paused: "paused";
1570
+ }>>;
1571
+ interval: import("zod").ZodNullable<import("zod").ZodEnum<{
1572
+ month: "month";
1573
+ year: "year";
1574
+ }>>;
1575
+ currentPeriodEnd: import("zod").ZodNullable<import("zod").ZodCoercedDate<unknown>>;
1576
+ cancelAtPeriodEnd: import("zod").ZodBoolean;
1577
+ unlimitedNotebaseNotes: import("zod").ZodBoolean;
1578
+ notebaseNoteLimit: import("zod").ZodNumber;
1579
+ notebaseNoteCount: import("zod").ZodNumber;
1580
+ }, import("zod/v4/core").$strict>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "BILLING_NOT_CONFIGURED" | "BILLING_CUSTOMER_NOT_FOUND">>, Record<never, never>>;
1581
+ createCheckoutSession: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1582
+ interval: import("zod").ZodEnum<{
1583
+ month: "month";
1584
+ year: "year";
1585
+ }>;
1586
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
1587
+ url: import("zod").ZodURL;
1588
+ }, import("zod/v4/core").$strict>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "BILLING_NOT_CONFIGURED" | "BILLING_CUSTOMER_NOT_FOUND">>, Record<never, never>>;
1589
+ createCustomerPortalSession: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodObject<{
1590
+ url: import("zod").ZodURL;
1591
+ }, import("zod/v4/core").$strict>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "BILLING_NOT_CONFIGURED" | "BILLING_CUSTOMER_NOT_FOUND">>, Record<never, never>>;
1592
+ };
1471
1593
  card: {
1472
1594
  list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1473
1595
  notebaseId: import("zod").ZodUUID;
@@ -1505,7 +1627,7 @@ declare const contract: {
1505
1627
  variantKey: import("zod").ZodString;
1506
1628
  front: import("zod").ZodString;
1507
1629
  back: import("zod").ZodString;
1508
- }, import("zod/v4/core").$strip>>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1630
+ }, import("zod/v4/core").$strip>>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1509
1631
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1510
1632
  id: import("zod").ZodUUID;
1511
1633
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -1539,14 +1661,14 @@ declare const contract: {
1539
1661
  variantKey: import("zod").ZodString;
1540
1662
  front: import("zod").ZodString;
1541
1663
  back: import("zod").ZodString;
1542
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND">>, Record<never, never>>;
1664
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND">>, Record<never, never>>;
1543
1665
  generate: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1544
1666
  notebaseId: import("zod").ZodUUID;
1545
1667
  templateId: import("zod").ZodOptional<import("zod").ZodUUID>;
1546
1668
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1547
1669
  created: import("zod").ZodNumber;
1548
1670
  txid: import("zod").ZodNumber;
1549
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CARD_TEMPLATE_NOT_FOUND">>, Record<never, never>>;
1671
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CARD_TEMPLATE_NOT_FOUND">>, Record<never, never>>;
1550
1672
  };
1551
1673
  cardTemplate: {
1552
1674
  list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -1562,7 +1684,7 @@ declare const contract: {
1562
1684
  }, import("zod/v4/core").$strict>], "type">;
1563
1685
  createdAt: import("zod").ZodCoercedDate<unknown>;
1564
1686
  updatedAt: import("zod").ZodCoercedDate<unknown>;
1565
- }, import("zod/v4/core").$strip>>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1687
+ }, import("zod/v4/core").$strip>>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1566
1688
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1567
1689
  id: import("zod").ZodUUID;
1568
1690
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -1576,7 +1698,7 @@ declare const contract: {
1576
1698
  }, import("zod/v4/core").$strict>], "type">;
1577
1699
  createdAt: import("zod").ZodCoercedDate<unknown>;
1578
1700
  updatedAt: import("zod").ZodCoercedDate<unknown>;
1579
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "CARD_TEMPLATE_NOT_FOUND">>, Record<never, never>>;
1701
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "CARD_TEMPLATE_NOT_FOUND">>, Record<never, never>>;
1580
1702
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1581
1703
  id: import("zod").ZodOptional<import("zod").ZodUUID>;
1582
1704
  notebaseId: import("zod").ZodUUID;
@@ -1598,7 +1720,7 @@ declare const contract: {
1598
1720
  createdAt: import("zod").ZodCoercedDate<unknown>;
1599
1721
  updatedAt: import("zod").ZodCoercedDate<unknown>;
1600
1722
  txid: import("zod").ZodNumber;
1601
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS">>, Record<never, never>>;
1723
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS">>, Record<never, never>>;
1602
1724
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1603
1725
  id: import("zod").ZodUUID;
1604
1726
  name: import("zod").ZodOptional<import("zod").ZodString>;
@@ -1619,12 +1741,12 @@ declare const contract: {
1619
1741
  createdAt: import("zod").ZodCoercedDate<unknown>;
1620
1742
  updatedAt: import("zod").ZodCoercedDate<unknown>;
1621
1743
  txid: import("zod").ZodNumber;
1622
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "CARD_TEMPLATE_NOT_FOUND" | "CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS">>, Record<never, never>>;
1744
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "CARD_TEMPLATE_NOT_FOUND" | "CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS">>, Record<never, never>>;
1623
1745
  delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1624
1746
  id: import("zod").ZodUUID;
1625
1747
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1626
1748
  txid: import("zod").ZodNumber;
1627
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "CARD_TEMPLATE_NOT_FOUND">>, Record<never, never>>;
1749
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "CARD_TEMPLATE_NOT_FOUND">>, Record<never, never>>;
1628
1750
  };
1629
1751
  hostedAi: {
1630
1752
  translate: {
@@ -1667,7 +1789,7 @@ declare const contract: {
1667
1789
  list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodObject<{
1668
1790
  id: import("zod").ZodString;
1669
1791
  name: import("zod").ZodString;
1670
- }, import("zod/v4/core").$strip>>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Record<never, never>>;
1792
+ }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
1671
1793
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1672
1794
  id: import("zod").ZodUUID;
1673
1795
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -1747,7 +1869,7 @@ declare const contract: {
1747
1869
  createdAt: import("zod").ZodCoercedDate<unknown>;
1748
1870
  updatedAt: import("zod").ZodCoercedDate<unknown>;
1749
1871
  }, import("zod/v4/core").$strip>>;
1750
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1872
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1751
1873
  getSchema: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1752
1874
  id: import("zod").ZodUUID;
1753
1875
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
@@ -1787,7 +1909,7 @@ declare const contract: {
1787
1909
  createdAt: import("zod").ZodCoercedDate<unknown>;
1788
1910
  updatedAt: import("zod").ZodCoercedDate<unknown>;
1789
1911
  }, import("zod/v4/core").$strip>>;
1790
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1912
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1791
1913
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1792
1914
  id: import("zod").ZodOptional<import("zod").ZodUUID>;
1793
1915
  name: import("zod").ZodString;
@@ -1826,7 +1948,7 @@ declare const contract: {
1826
1948
  }, import("zod/v4/core").$strict>>;
1827
1949
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
1828
1950
  txid: import("zod").ZodNumber;
1829
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Record<never, never>>;
1951
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTE_LIMIT_EXCEEDED">>, Record<never, never>>;
1830
1952
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1831
1953
  name: import("zod").ZodOptional<import("zod").ZodString>;
1832
1954
  srsNewPerDay: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -1834,12 +1956,12 @@ declare const contract: {
1834
1956
  id: import("zod").ZodUUID;
1835
1957
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
1836
1958
  txid: import("zod").ZodNumber;
1837
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1959
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1838
1960
  delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1839
1961
  id: import("zod").ZodUUID;
1840
1962
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1841
1963
  txid: import("zod").ZodNumber;
1842
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1964
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1843
1965
  };
1844
1966
  notebaseColumn: {
1845
1967
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -1873,7 +1995,7 @@ declare const contract: {
1873
1995
  }, import("zod/v4/core").$strict>;
1874
1996
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1875
1997
  txid: import("zod").ZodNumber;
1876
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
1998
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
1877
1999
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1878
2000
  notebaseColumnId: import("zod").ZodUUID;
1879
2001
  data: import("zod").ZodObject<{
@@ -1905,18 +2027,18 @@ declare const contract: {
1905
2027
  }, import("zod/v4/core").$strict>;
1906
2028
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1907
2029
  txid: import("zod").ZodNumber;
1908
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_COLUMN_NOT_FOUND">>, Record<never, never>>;
2030
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_COLUMN_NOT_FOUND">>, Record<never, never>>;
1909
2031
  delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1910
2032
  notebaseColumnId: import("zod").ZodUUID;
1911
2033
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1912
2034
  txid: import("zod").ZodNumber;
1913
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_COLUMN_NOT_FOUND" | "CARD_TEMPLATE_NOTEBASE_COLUMN_IN_USE" | "PRIMARY_NOTEBASE_COLUMN_DELETE_NOT_ALLOWED" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
2035
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_COLUMN_NOT_FOUND" | "CARD_TEMPLATE_NOTEBASE_COLUMN_IN_USE" | "PRIMARY_NOTEBASE_COLUMN_DELETE_NOT_ALLOWED" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
1914
2036
  reorder: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1915
2037
  notebaseId: import("zod").ZodUUID;
1916
2038
  ids: import("zod").ZodArray<import("zod").ZodUUID>;
1917
2039
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1918
2040
  txid: import("zod").ZodNumber;
1919
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
2041
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
1920
2042
  };
1921
2043
  notebaseRow: {
1922
2044
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -1927,7 +2049,7 @@ declare const contract: {
1927
2049
  }, import("zod/v4/core").$strict>;
1928
2050
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1929
2051
  txid: import("zod").ZodNumber;
1930
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CELL_VALIDATION_FAILED" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
2052
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "NOTE_LIMIT_EXCEEDED" | "CELL_VALIDATION_FAILED" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
1931
2053
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1932
2054
  notebaseRowId: import("zod").ZodUUID;
1933
2055
  data: import("zod").ZodObject<{
@@ -1941,18 +2063,18 @@ declare const contract: {
1941
2063
  createdAt: import("zod").ZodDate;
1942
2064
  updatedAt: import("zod").ZodDate;
1943
2065
  txid: import("zod").ZodNumber;
1944
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_ROW_NOT_FOUND" | "CELL_VALIDATION_FAILED">>, Record<never, never>>;
2066
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_ROW_NOT_FOUND" | "CELL_VALIDATION_FAILED">>, Record<never, never>>;
1945
2067
  delete: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1946
2068
  notebaseRowId: import("zod").ZodUUID;
1947
2069
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1948
2070
  txid: import("zod").ZodNumber;
1949
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_ROW_NOT_FOUND" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
2071
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_ROW_NOT_FOUND" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
1950
2072
  reorder: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1951
2073
  notebaseId: import("zod").ZodUUID;
1952
2074
  ids: import("zod").ZodArray<import("zod").ZodUUID>;
1953
2075
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1954
2076
  txid: import("zod").ZodNumber;
1955
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
2077
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND" | "CONCURRENT_POSITION_CONFLICT">>, Record<never, never>>;
1956
2078
  };
1957
2079
  srs: {
1958
2080
  scheduleStatusStats: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -1962,7 +2084,7 @@ declare const contract: {
1962
2084
  new: "new";
1963
2085
  learning: "learning";
1964
2086
  review: "review";
1965
- }>, import("zod").ZodNumber>>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
2087
+ }>, import("zod").ZodNumber>>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_NOT_FOUND">>, Record<never, never>>;
1966
2088
  review: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1967
2089
  cardId: import("zod").ZodUUID;
1968
2090
  id: import("zod").ZodOptional<import("zod").ZodUUID>;
@@ -2043,7 +2165,7 @@ declare const contract: {
2043
2165
  createdAt: import("zod").ZodCoercedDate<unknown>;
2044
2166
  }, import("zod/v4/core").$strip>;
2045
2167
  txid: import("zod").ZodNumber;
2046
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND" | "CARD_NOT_REVIEWABLE" | "CARD_REVIEW_STATE_STALE">>, Record<never, never>>;
2168
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND" | "CARD_NOT_REVIEWABLE" | "CARD_REVIEW_STATE_STALE">>, Record<never, never>>;
2047
2169
  rollbackReview: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
2048
2170
  cardId: import("zod").ZodUUID;
2049
2171
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
@@ -2079,19 +2201,19 @@ declare const contract: {
2079
2201
  }, import("zod/v4/core").$strip>;
2080
2202
  rolledBackRevlogId: import("zod").ZodUUID;
2081
2203
  txid: import("zod").ZodNumber;
2082
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND" | "CARD_REVIEW_ROLLBACK_UNAVAILABLE">>, Record<never, never>>;
2204
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND" | "CARD_REVIEW_ROLLBACK_UNAVAILABLE">>, Record<never, never>>;
2083
2205
  setCardBuried: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
2084
2206
  cardId: import("zod").ZodUUID;
2085
2207
  enabled: import("zod").ZodBoolean;
2086
2208
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
2087
2209
  txid: import("zod").ZodNumber;
2088
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND" | "CARD_ALREADY_BURIED" | "CARD_NOT_BURIED" | "CARD_STATUS_CHANGE_UNAVAILABLE">>, Record<never, never>>;
2210
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND" | "CARD_ALREADY_BURIED" | "CARD_NOT_BURIED" | "CARD_STATUS_CHANGE_UNAVAILABLE">>, Record<never, never>>;
2089
2211
  setCardSuspended: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
2090
2212
  cardId: import("zod").ZodUUID;
2091
2213
  enabled: import("zod").ZodBoolean;
2092
2214
  }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
2093
2215
  txid: import("zod").ZodNumber;
2094
- }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "NOTEBASE_BETA_RESTRICTED">>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND" | "CARD_ALREADY_SUSPENDED" | "CARD_NOT_SUSPENDED" | "CARD_STATUS_CHANGE_UNAVAILABLE">>, Record<never, never>>;
2216
+ }, import("zod/v4/core").$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, Pick<import("@orpc/contract").ErrorMap, "CARD_NOT_FOUND" | "CARD_ALREADY_SUSPENDED" | "CARD_NOT_SUSPENDED" | "CARD_STATUS_CHANGE_UNAVAILABLE">>, Record<never, never>>;
2095
2217
  };
2096
2218
  user: {
2097
2219
  ensureTimezone: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
@@ -2109,5 +2231,5 @@ declare const contract: {
2109
2231
  };
2110
2232
  type ORPCRouterClient = ContractRouterClient<typeof contract>;
2111
2233
  //#endregion
2112
- export { BetaAccessStatusInput, BetaAccessStatusInputSchema, BetaAccessStatusOutput, BetaAccessStatusOutputSchema, BetaFeatureKey, BetaFeatureKeySchema, Card, CardGenerateInput, CardGenerateInputSchema, CardGenerateOutput, CardGenerateOutputSchema, CardGetInput, CardGetInputSchema, CardGetOutput, CardGetOutputSchema, CardListInput, CardListInputSchema, CardListOutput, CardListOutputSchema, type CardState, CardTemplate, CardTemplateCreateInput, CardTemplateCreateInputSchema, CardTemplateCreateOutput, CardTemplateCreateOutputSchema, CardTemplateDeleteInput, CardTemplateDeleteInputSchema, CardTemplateDeleteOutput, CardTemplateDeleteOutputSchema, CardTemplateGetInput, CardTemplateGetInputSchema, CardTemplateGetOutput, CardTemplateGetOutputSchema, CardTemplateInvalidColumnsData, CardTemplateInvalidColumnsDataSchema, CardTemplateListInput, CardTemplateListInputSchema, CardTemplateListOutput, CardTemplateListOutputSchema, CardTemplateUpdateInput, CardTemplateUpdateInputSchema, CardTemplateUpdateOutput, CardTemplateUpdateOutputSchema, CellValidationFailedData, CellValidationFailedDataSchema, CellValidationFailureDetails, CellValidationFailureDetailsSchema, CellValidationFailureReason, CellValidationFailureReasonSchema, HostedAiOutputField, HostedAiOutputFieldSchema, HostedAiOutputFieldType, HostedAiOutputFieldTypeSchema, HostedAiStreamPart, HostedAiStreamPartSchema, HostedAiStreamStructuredObjectInput, HostedAiStreamStructuredObjectInputSchema, HostedAiStreamTextInput, HostedAiStreamTextInputSchema, Notebase, NotebaseColumn, NotebaseColumnCreateData, NotebaseColumnCreateInput, NotebaseColumnCreateInputSchema, NotebaseColumnCreateOutput, NotebaseColumnCreateOutputSchema, NotebaseColumnDeleteInput, NotebaseColumnDeleteInputSchema, NotebaseColumnDeleteOutput, NotebaseColumnDeleteOutputSchema, NotebaseColumnReorderInput, NotebaseColumnReorderInputSchema, NotebaseColumnReorderOutput, NotebaseColumnReorderOutputSchema, NotebaseColumnUpdateData, NotebaseColumnUpdateInput, NotebaseColumnUpdateInputSchema, NotebaseColumnUpdateOutput, NotebaseColumnUpdateOutputSchema, NotebaseCreateData, NotebaseCreateInput, NotebaseCreateInputSchema, NotebaseCreateOutput, NotebaseCreateOutputSchema, NotebaseDeleteInput, NotebaseDeleteInputSchema, NotebaseDeleteOutput, NotebaseDeleteOutputSchema, NotebaseGetInput, NotebaseGetInputSchema, NotebaseGetOutput, NotebaseGetOutputSchema, NotebaseGetSchemaInput, NotebaseGetSchemaInputSchema, NotebaseGetSchemaOutput, NotebaseGetSchemaOutputSchema, NotebaseListInput, NotebaseListInputSchema, NotebaseListItem, NotebaseListItemSchema, NotebaseListOutput, NotebaseListOutputSchema, NotebaseRow, NotebaseRowCreateData, NotebaseRowCreateInput, NotebaseRowCreateInputSchema, NotebaseRowCreateOutput, NotebaseRowCreateOutputSchema, NotebaseRowDeleteInput, NotebaseRowDeleteInputSchema, NotebaseRowDeleteOutput, NotebaseRowDeleteOutputSchema, NotebaseRowReorderInput, NotebaseRowReorderInputSchema, NotebaseRowReorderOutput, NotebaseRowReorderOutputSchema, NotebaseRowUpdateData, NotebaseRowUpdateInput, NotebaseRowUpdateInputSchema, NotebaseRowUpdateOutput, NotebaseRowUpdateOutputSchema, NotebaseUpdateData, NotebaseUpdateInput, NotebaseUpdateInputSchema, NotebaseUpdateOutput, NotebaseUpdateOutputSchema, NotebaseView, NotebaseViewConfig, NotebaseViewCreateData, NotebaseViewFilter, NotebaseViewSort, NotebaseViewType, NotebaseViewUpdateData, ORPCRouterClient, PUBLIC_APP_ERROR_DEFS, PublicAppErrorCode, PublicAppErrorData, RenderedCard, type ReviewRating, SRS_REVIEW_CLIENT_ID_NAMESPACE, SRS_REVIEW_DURATION_MS_MAX, type ScheduleStatus, type SchedulingParams, SrsManualCardStatusInput, SrsReviewClientIdCard, SrsReviewInput, SrsReviewOutput, SrsRevlog, SrsRevlogWithoutSnapshot, SrsRollbackReviewInput, SrsRollbackReviewOutput, SrsScheduleStatusStats, SrsScheduleStatusStatsInput, SrsScheduleStatusStatsOutput, SrsSetCardBuriedInput, SrsSetCardBuriedOutput, SrsSetCardSuspendedInput, SrsSetCardSuspendedOutput, SrsTxidOutput, Step, Timezone, UserEnsureTimezoneInput, UserEnsureTimezoneOutput, UserUpdateTimezoneInput, UserUpdateTimezoneOutput, cardSchema, cardStateSchema, cardTemplateSchema, contract, createSrsReviewClientId, getPublicErrorDefinition, isPublicAppErrorCode, notebaseColumnCreateDataSchema, notebaseColumnSchema, notebaseColumnUpdateDataSchema, notebaseColumnWidthSchema, notebaseCreateDataSchema, notebaseRowCellsSchema, notebaseRowCreateDataSchema, notebaseRowSchema, notebaseRowUpdateDataSchema, notebaseSchema, notebaseUpdateDataSchema, notebaseViewConfigSchema, notebaseViewCreateDataSchema, notebaseViewFilterSchema, notebaseViewFiltersSchema, notebaseViewSchema, notebaseViewSortSchema, notebaseViewSortsSchema, notebaseViewTypeSchema, notebaseViewUpdateDataSchema, pickPublicErrorMap, renderedCardSchema, reviewRatingSchema, scheduleStatusSchema, schedulingParamsSchema, srsManualCardStatusInputSchema, srsReviewInputSchema, srsReviewOutputSchema, srsRevlogSchema, srsRevlogWithoutSnapshotSchema, srsRollbackReviewInputSchema, srsRollbackReviewOutputSchema, srsScheduleStatusStatsInputSchema, srsScheduleStatusStatsOutputSchema, srsScheduleStatusStatsSchema, srsSetCardBuriedInputSchema, srsSetCardBuriedOutputSchema, srsSetCardSuspendedInputSchema, srsSetCardSuspendedOutputSchema, srsTxidOutputSchema, stepSchema, timezoneSchema, userEnsureTimezoneInputSchema, userEnsureTimezoneOutputSchema, userUpdateTimezoneInputSchema, userUpdateTimezoneOutputSchema };
2234
+ export { BetaAccessStatusInput, BetaAccessStatusInputSchema, BetaAccessStatusOutput, BetaAccessStatusOutputSchema, BetaFeatureKey, BetaFeatureKeySchema, BillingCreateCheckoutSessionInput, BillingInterval, BillingPlan, BillingSessionUrlOutput, BillingStatus, BillingSubscriptionStatus, Card, CardGenerateInput, CardGenerateInputSchema, CardGenerateOutput, CardGenerateOutputSchema, CardGetInput, CardGetInputSchema, CardGetOutput, CardGetOutputSchema, CardListInput, CardListInputSchema, CardListOutput, CardListOutputSchema, type CardState, CardTemplate, CardTemplateCreateInput, CardTemplateCreateInputSchema, CardTemplateCreateOutput, CardTemplateCreateOutputSchema, CardTemplateDeleteInput, CardTemplateDeleteInputSchema, CardTemplateDeleteOutput, CardTemplateDeleteOutputSchema, CardTemplateGetInput, CardTemplateGetInputSchema, CardTemplateGetOutput, CardTemplateGetOutputSchema, CardTemplateInvalidColumnsData, CardTemplateInvalidColumnsDataSchema, CardTemplateListInput, CardTemplateListInputSchema, CardTemplateListOutput, CardTemplateListOutputSchema, CardTemplateUpdateInput, CardTemplateUpdateInputSchema, CardTemplateUpdateOutput, CardTemplateUpdateOutputSchema, CellValidationFailedData, CellValidationFailedDataSchema, CellValidationFailureDetails, CellValidationFailureDetailsSchema, CellValidationFailureReason, CellValidationFailureReasonSchema, HostedAiOutputField, HostedAiOutputFieldSchema, HostedAiOutputFieldType, HostedAiOutputFieldTypeSchema, HostedAiStreamPart, HostedAiStreamPartSchema, HostedAiStreamStructuredObjectInput, HostedAiStreamStructuredObjectInputSchema, HostedAiStreamTextInput, HostedAiStreamTextInputSchema, Notebase, NotebaseColumn, NotebaseColumnCreateData, NotebaseColumnCreateInput, NotebaseColumnCreateInputSchema, NotebaseColumnCreateOutput, NotebaseColumnCreateOutputSchema, NotebaseColumnDeleteInput, NotebaseColumnDeleteInputSchema, NotebaseColumnDeleteOutput, NotebaseColumnDeleteOutputSchema, NotebaseColumnReorderInput, NotebaseColumnReorderInputSchema, NotebaseColumnReorderOutput, NotebaseColumnReorderOutputSchema, NotebaseColumnUpdateData, NotebaseColumnUpdateInput, NotebaseColumnUpdateInputSchema, NotebaseColumnUpdateOutput, NotebaseColumnUpdateOutputSchema, NotebaseCreateData, NotebaseCreateInput, NotebaseCreateInputSchema, NotebaseCreateOutput, NotebaseCreateOutputSchema, NotebaseDeleteInput, NotebaseDeleteInputSchema, NotebaseDeleteOutput, NotebaseDeleteOutputSchema, NotebaseGetInput, NotebaseGetInputSchema, NotebaseGetOutput, NotebaseGetOutputSchema, NotebaseGetSchemaInput, NotebaseGetSchemaInputSchema, NotebaseGetSchemaOutput, NotebaseGetSchemaOutputSchema, NotebaseListInput, NotebaseListInputSchema, NotebaseListItem, NotebaseListItemSchema, NotebaseListOutput, NotebaseListOutputSchema, NotebaseRow, NotebaseRowCreateData, NotebaseRowCreateInput, NotebaseRowCreateInputSchema, NotebaseRowCreateOutput, NotebaseRowCreateOutputSchema, NotebaseRowDeleteInput, NotebaseRowDeleteInputSchema, NotebaseRowDeleteOutput, NotebaseRowDeleteOutputSchema, NotebaseRowReorderInput, NotebaseRowReorderInputSchema, NotebaseRowReorderOutput, NotebaseRowReorderOutputSchema, NotebaseRowUpdateData, NotebaseRowUpdateInput, NotebaseRowUpdateInputSchema, NotebaseRowUpdateOutput, NotebaseRowUpdateOutputSchema, NotebaseUpdateData, NotebaseUpdateInput, NotebaseUpdateInputSchema, NotebaseUpdateOutput, NotebaseUpdateOutputSchema, NotebaseView, NotebaseViewConfig, NotebaseViewCreateData, NotebaseViewFilter, NotebaseViewSort, NotebaseViewType, NotebaseViewUpdateData, ORPCRouterClient, PUBLIC_APP_ERROR_DEFS, PublicAppErrorCode, PublicAppErrorData, RenderedCard, type ReviewRating, SRS_REVIEW_CLIENT_ID_NAMESPACE, SRS_REVIEW_DURATION_MS_MAX, type ScheduleStatus, type SchedulingParams, SrsManualCardStatusInput, SrsReviewClientIdCard, SrsReviewInput, SrsReviewOutput, SrsRevlog, SrsRevlogWithoutSnapshot, SrsRollbackReviewInput, SrsRollbackReviewOutput, SrsScheduleStatusStats, SrsScheduleStatusStatsInput, SrsScheduleStatusStatsOutput, SrsSetCardBuriedInput, SrsSetCardBuriedOutput, SrsSetCardSuspendedInput, SrsSetCardSuspendedOutput, SrsTxidOutput, Step, Timezone, UserEnsureTimezoneInput, UserEnsureTimezoneOutput, UserUpdateTimezoneInput, UserUpdateTimezoneOutput, billingCreateCheckoutSessionInputSchema, billingIntervalSchema, billingPlanSchema, billingSessionUrlOutputSchema, billingStatusSchema, billingSubscriptionStatusSchema, cardSchema, cardStateSchema, cardTemplateSchema, contract, createSrsReviewClientId, getPublicErrorDefinition, isPublicAppErrorCode, notebaseColumnCreateDataSchema, notebaseColumnSchema, notebaseColumnUpdateDataSchema, notebaseColumnWidthSchema, notebaseCreateDataSchema, notebaseRowCellsSchema, notebaseRowCreateDataSchema, notebaseRowSchema, notebaseRowUpdateDataSchema, notebaseSchema, notebaseUpdateDataSchema, notebaseViewConfigSchema, notebaseViewCreateDataSchema, notebaseViewFilterSchema, notebaseViewFiltersSchema, notebaseViewSchema, notebaseViewSortSchema, notebaseViewSortsSchema, notebaseViewTypeSchema, notebaseViewUpdateDataSchema, pickPublicErrorMap, renderedCardSchema, reviewRatingSchema, scheduleStatusSchema, schedulingParamsSchema, srsManualCardStatusInputSchema, srsReviewInputSchema, srsReviewOutputSchema, srsRevlogSchema, srsRevlogWithoutSnapshotSchema, srsRollbackReviewInputSchema, srsRollbackReviewOutputSchema, srsScheduleStatusStatsInputSchema, srsScheduleStatusStatsOutputSchema, srsScheduleStatusStatsSchema, srsSetCardBuriedInputSchema, srsSetCardBuriedOutputSchema, srsSetCardSuspendedInputSchema, srsSetCardSuspendedOutputSchema, srsTxidOutputSchema, stepSchema, timezoneSchema, userEnsureTimezoneInputSchema, userEnsureTimezoneOutputSchema, userUpdateTimezoneInputSchema, userUpdateTimezoneOutputSchema };
2113
2235
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/public-errors.ts","../src/schemas/beta-access.ts","../src/schemas/card.ts","../src/schemas/hosted-ai.ts","../src/schemas/notebase.ts","../src/schemas/notebase-column.ts","../src/schemas/notebase-row.ts","../src/schemas/notebase-view.ts","../src/schemas/timezone.ts","../src/schemas/srs.ts","../src/schemas/user.ts","../src/index.ts"],"mappings":";;;;;cASa,iCAAA,EAAiC,CAAA,CAAA,OAAA;;;;;;KAMlC,2BAAA,GAA8B,CAAA,CAAE,KAAK,QAAQ,iCAAA;AAAA,cAE5C,kCAAA,EAAkC,CAAA,CAAA,SAAA;;;;;;;KAOnC,4BAAA,GAA+B,CAAA,CAAE,KAAK,QAAQ,kCAAA;AAAA,cAE7C,8BAAA,EAA8B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;KAK/B,wBAAA,GAA2B,CAAA,CAAE,KAAK,QAAQ,8BAAA;AAAA,cAEzC,oCAAA,EAAoC,CAAA,CAAA,SAAA;;;KAGrC,8BAAA,GAAiC,CAAA,CAAE,KAAK,QAAQ,oCAAA;AAAA,cAE/C,qBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqFD,kBAAA,gBAAkC,qBAAqB;AAAA,KAEvD,kBAAA,eAAiC,kBAAA,YACjC,qBAAA,EAAuB,KAAA;EAAiB,IAAA,wBAA4B,CAAA,CAAE,UAAA;AAAA,IAC5E,CAAA,CAAE,MAAA,CAAO,OAAA;AAAA,iBAGC,oBAAA,CAAqB,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Q,6BAAA;AAAA,cAExC,8BAAA,EAA8B,CAAA,CAAA,SAAA;;;KAG/B,wBAAA,GAA2B,CAAA,CAAE,KAAK,QAAQ,8BAAA;;;cCXzC,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYD,gBAAA,GAAmB,oBAAoB,QAAQ,QAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/public-errors.ts","../src/schemas/beta-access.ts","../src/schemas/billing.ts","../src/schemas/card.ts","../src/schemas/hosted-ai.ts","../src/schemas/notebase.ts","../src/schemas/notebase-column.ts","../src/schemas/notebase-row.ts","../src/schemas/notebase-view.ts","../src/schemas/timezone.ts","../src/schemas/srs.ts","../src/schemas/user.ts","../src/index.ts"],"mappings":";;;;;cASa,iCAAA,EA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 @@ const PUBLIC_APP_ERROR_DEFS = {
71
71
  message: "Notebase column is used by a card template",
72
72
  status: 409
73
73
  },
74
+ NOTE_LIMIT_EXCEEDED: {
75
+ message: "Upgrade is required to create more Notebase notes",
76
+ status: 403
77
+ },
78
+ BILLING_NOT_CONFIGURED: {
79
+ message: "Billing is not configured",
80
+ status: 503
81
+ },
82
+ BILLING_CUSTOMER_NOT_FOUND: {
83
+ message: "Billing customer not found",
84
+ status: 404
85
+ },
74
86
  CARD_NOT_REVIEWABLE: {
75
87
  message: "Card cannot be reviewed in its current state",
76
88
  status: 409
@@ -142,6 +154,55 @@ function pickPublicErrorMap(...codes) {
142
154
  }));
143
155
  }
144
156
  //#endregion
157
+ //#region src/schemas/billing.ts
158
+ const billingIntervalSchema = z.enum(["month", "year"]);
159
+ const billingSubscriptionStatusSchema = z.enum([
160
+ "incomplete",
161
+ "incomplete_expired",
162
+ "trialing",
163
+ "active",
164
+ "past_due",
165
+ "canceled",
166
+ "unpaid",
167
+ "paused"
168
+ ]);
169
+ const billingPlanSchema = z.enum(["free", "pro"]);
170
+ const billingStatusSchema = z.object({
171
+ plan: billingPlanSchema,
172
+ status: billingSubscriptionStatusSchema.nullable(),
173
+ interval: billingIntervalSchema.nullable(),
174
+ currentPeriodEnd: z.coerce.date().nullable(),
175
+ cancelAtPeriodEnd: z.boolean(),
176
+ unlimitedNotebaseNotes: z.boolean(),
177
+ notebaseNoteLimit: z.number().int().positive(),
178
+ notebaseNoteCount: z.number().int().min(0)
179
+ }).strict();
180
+ const billingCreateCheckoutSessionInputSchema = z.object({ interval: billingIntervalSchema }).strict();
181
+ const billingSessionUrlOutputSchema = z.object({ url: z.url() }).strict();
182
+ //#endregion
183
+ //#region src/contracts/billing.ts
184
+ const billingProcedure = oc.errors(pickPublicErrorMap("BILLING_NOT_CONFIGURED", "BILLING_CUSTOMER_NOT_FOUND"));
185
+ const billingContract = {
186
+ status: billingProcedure.route({
187
+ method: "GET",
188
+ path: "/billing/status",
189
+ summary: "Get authenticated user's billing status",
190
+ tags: ["Billing"]
191
+ }).output(billingStatusSchema),
192
+ createCheckoutSession: billingProcedure.route({
193
+ method: "POST",
194
+ path: "/billing/checkout-sessions",
195
+ summary: "Create a Stripe Checkout Session for a subscription",
196
+ tags: ["Billing"]
197
+ }).input(billingCreateCheckoutSessionInputSchema).output(billingSessionUrlOutputSchema),
198
+ createCustomerPortalSession: billingProcedure.route({
199
+ method: "POST",
200
+ path: "/billing/customer-portal-sessions",
201
+ summary: "Create a Stripe Customer Portal Session",
202
+ tags: ["Billing"]
203
+ }).output(billingSessionUrlOutputSchema)
204
+ };
205
+ //#endregion
145
206
  //#region src/schemas/card.ts
146
207
  const cardTemplateSchema = z.object({
147
208
  id: z.uuid(),
@@ -199,7 +260,7 @@ const CardGenerateOutputSchema = z.object({
199
260
  });
200
261
  //#endregion
201
262
  //#region src/contracts/shared.ts
202
- const notebaseProcedure = oc.errors(pickPublicErrorMap("NOTEBASE_BETA_RESTRICTED"));
263
+ const notebaseProcedure = oc;
203
264
  //#endregion
204
265
  //#region src/contracts/card.ts
205
266
  const cardContract = {
@@ -540,7 +601,7 @@ const notebaseContract = {
540
601
  summary: "Get notebase schema",
541
602
  tags: ["Notebases"]
542
603
  }).input(NotebaseGetSchemaInputSchema).output(NotebaseGetSchemaOutputSchema),
543
- create: notebaseProcedure.route({
604
+ create: notebaseProcedure.errors(pickPublicErrorMap("NOTE_LIMIT_EXCEEDED")).route({
544
605
  method: "POST",
545
606
  path: "/notebases",
546
607
  summary: "Create notebase",
@@ -590,7 +651,7 @@ const notebaseColumnContract = {
590
651
  //#endregion
591
652
  //#region src/contracts/notebase-row.ts
592
653
  const notebaseRowContract = {
593
- create: notebaseProcedure.errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND", "CELL_VALIDATION_FAILED", "CONCURRENT_POSITION_CONFLICT")).route({
654
+ create: notebaseProcedure.errors(pickPublicErrorMap("NOTEBASE_NOT_FOUND", "CELL_VALIDATION_FAILED", "CONCURRENT_POSITION_CONFLICT", "NOTE_LIMIT_EXCEEDED")).route({
594
655
  method: "POST",
595
656
  path: "/notebase-rows",
596
657
  summary: "Create notebase row",
@@ -769,6 +830,7 @@ const userUpdateTimezoneOutputSchema = z.object({ timezone: timezoneSchema }).st
769
830
  //#region src/index.ts
770
831
  const contract = {
771
832
  betaAccess: betaAccessContract,
833
+ billing: billingContract,
772
834
  card: cardContract,
773
835
  cardTemplate: cardTemplateContract,
774
836
  hostedAi: hostedAiContract,
@@ -792,6 +854,6 @@ const contract = {
792
854
  }
793
855
  };
794
856
  //#endregion
795
- export { BetaAccessStatusInputSchema, BetaAccessStatusOutputSchema, BetaFeatureKeySchema, CardGenerateInputSchema, CardGenerateOutputSchema, CardGetInputSchema, CardGetOutputSchema, CardListInputSchema, CardListOutputSchema, CardTemplateCreateInputSchema, CardTemplateCreateOutputSchema, CardTemplateDeleteInputSchema, CardTemplateDeleteOutputSchema, CardTemplateGetInputSchema, CardTemplateGetOutputSchema, CardTemplateInvalidColumnsDataSchema, CardTemplateListInputSchema, CardTemplateListOutputSchema, CardTemplateUpdateInputSchema, CardTemplateUpdateOutputSchema, CellValidationFailedDataSchema, CellValidationFailureDetailsSchema, CellValidationFailureReasonSchema, HostedAiOutputFieldSchema, HostedAiOutputFieldTypeSchema, HostedAiStreamPartSchema, HostedAiStreamStructuredObjectInputSchema, HostedAiStreamTextInputSchema, NotebaseColumnCreateInputSchema, NotebaseColumnCreateOutputSchema, NotebaseColumnDeleteInputSchema, NotebaseColumnDeleteOutputSchema, NotebaseColumnReorderInputSchema, NotebaseColumnReorderOutputSchema, NotebaseColumnUpdateInputSchema, NotebaseColumnUpdateOutputSchema, NotebaseCreateInputSchema, NotebaseCreateOutputSchema, NotebaseDeleteInputSchema, NotebaseDeleteOutputSchema, NotebaseGetInputSchema, NotebaseGetOutputSchema, NotebaseGetSchemaInputSchema, NotebaseGetSchemaOutputSchema, NotebaseListInputSchema, NotebaseListItemSchema, NotebaseListOutputSchema, NotebaseRowCreateInputSchema, NotebaseRowCreateOutputSchema, NotebaseRowDeleteInputSchema, NotebaseRowDeleteOutputSchema, NotebaseRowReorderInputSchema, NotebaseRowReorderOutputSchema, NotebaseRowUpdateInputSchema, NotebaseRowUpdateOutputSchema, NotebaseUpdateInputSchema, NotebaseUpdateOutputSchema, PUBLIC_APP_ERROR_DEFS, SRS_REVIEW_CLIENT_ID_NAMESPACE, SRS_REVIEW_DURATION_MS_MAX, cardSchema, cardStateSchema, cardTemplateSchema, contract, createSrsReviewClientId, getPublicErrorDefinition, isPublicAppErrorCode, notebaseColumnCreateDataSchema, notebaseColumnSchema, notebaseColumnUpdateDataSchema, notebaseColumnWidthSchema, notebaseCreateDataSchema, notebaseRowCellsSchema, notebaseRowCreateDataSchema, notebaseRowSchema, notebaseRowUpdateDataSchema, notebaseSchema, notebaseUpdateDataSchema, notebaseViewConfigSchema, notebaseViewCreateDataSchema, notebaseViewFilterSchema, notebaseViewFiltersSchema, notebaseViewSchema, notebaseViewSortSchema, notebaseViewSortsSchema, notebaseViewTypeSchema, notebaseViewUpdateDataSchema, pickPublicErrorMap, renderedCardSchema, reviewRatingSchema, scheduleStatusSchema, schedulingParamsSchema, srsManualCardStatusInputSchema, srsReviewInputSchema, srsReviewOutputSchema, srsRevlogSchema, srsRevlogWithoutSnapshotSchema, srsRollbackReviewInputSchema, srsRollbackReviewOutputSchema, srsScheduleStatusStatsInputSchema, srsScheduleStatusStatsOutputSchema, srsScheduleStatusStatsSchema, srsSetCardBuriedInputSchema, srsSetCardBuriedOutputSchema, srsSetCardSuspendedInputSchema, srsSetCardSuspendedOutputSchema, srsTxidOutputSchema, stepSchema, timezoneSchema, userEnsureTimezoneInputSchema, userEnsureTimezoneOutputSchema, userUpdateTimezoneInputSchema, userUpdateTimezoneOutputSchema };
857
+ export { BetaAccessStatusInputSchema, BetaAccessStatusOutputSchema, BetaFeatureKeySchema, CardGenerateInputSchema, CardGenerateOutputSchema, CardGetInputSchema, CardGetOutputSchema, CardListInputSchema, CardListOutputSchema, CardTemplateCreateInputSchema, CardTemplateCreateOutputSchema, CardTemplateDeleteInputSchema, CardTemplateDeleteOutputSchema, CardTemplateGetInputSchema, CardTemplateGetOutputSchema, CardTemplateInvalidColumnsDataSchema, CardTemplateListInputSchema, CardTemplateListOutputSchema, CardTemplateUpdateInputSchema, CardTemplateUpdateOutputSchema, CellValidationFailedDataSchema, CellValidationFailureDetailsSchema, CellValidationFailureReasonSchema, HostedAiOutputFieldSchema, HostedAiOutputFieldTypeSchema, HostedAiStreamPartSchema, HostedAiStreamStructuredObjectInputSchema, HostedAiStreamTextInputSchema, NotebaseColumnCreateInputSchema, NotebaseColumnCreateOutputSchema, NotebaseColumnDeleteInputSchema, NotebaseColumnDeleteOutputSchema, NotebaseColumnReorderInputSchema, NotebaseColumnReorderOutputSchema, NotebaseColumnUpdateInputSchema, NotebaseColumnUpdateOutputSchema, NotebaseCreateInputSchema, NotebaseCreateOutputSchema, NotebaseDeleteInputSchema, NotebaseDeleteOutputSchema, NotebaseGetInputSchema, NotebaseGetOutputSchema, NotebaseGetSchemaInputSchema, NotebaseGetSchemaOutputSchema, NotebaseListInputSchema, NotebaseListItemSchema, NotebaseListOutputSchema, NotebaseRowCreateInputSchema, NotebaseRowCreateOutputSchema, NotebaseRowDeleteInputSchema, NotebaseRowDeleteOutputSchema, NotebaseRowReorderInputSchema, NotebaseRowReorderOutputSchema, NotebaseRowUpdateInputSchema, NotebaseRowUpdateOutputSchema, NotebaseUpdateInputSchema, NotebaseUpdateOutputSchema, PUBLIC_APP_ERROR_DEFS, SRS_REVIEW_CLIENT_ID_NAMESPACE, SRS_REVIEW_DURATION_MS_MAX, billingCreateCheckoutSessionInputSchema, billingIntervalSchema, billingPlanSchema, billingSessionUrlOutputSchema, billingStatusSchema, billingSubscriptionStatusSchema, cardSchema, cardStateSchema, cardTemplateSchema, contract, createSrsReviewClientId, getPublicErrorDefinition, isPublicAppErrorCode, notebaseColumnCreateDataSchema, notebaseColumnSchema, notebaseColumnUpdateDataSchema, notebaseColumnWidthSchema, notebaseCreateDataSchema, notebaseRowCellsSchema, notebaseRowCreateDataSchema, notebaseRowSchema, notebaseRowUpdateDataSchema, notebaseSchema, notebaseUpdateDataSchema, notebaseViewConfigSchema, notebaseViewCreateDataSchema, notebaseViewFilterSchema, notebaseViewFiltersSchema, notebaseViewSchema, notebaseViewSortSchema, notebaseViewSortsSchema, notebaseViewTypeSchema, notebaseViewUpdateDataSchema, pickPublicErrorMap, renderedCardSchema, reviewRatingSchema, scheduleStatusSchema, schedulingParamsSchema, srsManualCardStatusInputSchema, srsReviewInputSchema, srsReviewOutputSchema, srsRevlogSchema, srsRevlogWithoutSnapshotSchema, srsRollbackReviewInputSchema, srsRollbackReviewOutputSchema, srsScheduleStatusStatsInputSchema, srsScheduleStatusStatsOutputSchema, srsScheduleStatusStatsSchema, srsSetCardBuriedInputSchema, srsSetCardBuriedOutputSchema, srsSetCardSuspendedInputSchema, srsSetCardSuspendedOutputSchema, srsTxidOutputSchema, stepSchema, timezoneSchema, userEnsureTimezoneInputSchema, userEnsureTimezoneOutputSchema, userUpdateTimezoneInputSchema, userUpdateTimezoneOutputSchema };
796
858
 
797
859
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["cardStateSchema","scheduleStatusSchema"],"sources":["../src/schemas/beta-access.ts","../src/contracts/beta-access.ts","../src/public-errors.ts","../src/schemas/card.ts","../src/contracts/shared.ts","../src/contracts/card.ts","../src/contracts/card-template.ts","../src/schemas/hosted-ai.ts","../src/contracts/hosted-ai.ts","../src/schemas/notebase-column.ts","../src/schemas/notebase-row.ts","../src/schemas/notebase-view.ts","../src/schemas/notebase.ts","../src/contracts/notebase.ts","../src/contracts/notebase-column.ts","../src/contracts/notebase-row.ts","../src/schemas/timezone.ts","../src/schemas/srs.ts","../src/contracts/srs.ts","../src/schemas/user.ts","../src/contracts/user.ts","../src/index.ts"],"sourcesContent":["import { BETA_FEATURE_KEYS } from \"@read-frog/definitions\"\nimport { z } from \"zod\"\n\nexport const BetaFeatureKeySchema = z.enum(BETA_FEATURE_KEYS)\nexport type BetaFeatureKey = z.infer<typeof BetaFeatureKeySchema>\n\nexport const BetaAccessStatusInputSchema = z.object({\n featureKey: BetaFeatureKeySchema,\n}).strict()\nexport type BetaAccessStatusInput = z.infer<typeof BetaAccessStatusInputSchema>\n\nexport const BetaAccessStatusOutputSchema = z.object({\n featureKey: BetaFeatureKeySchema,\n allowed: z.boolean(),\n})\nexport type BetaAccessStatusOutput = z.infer<typeof BetaAccessStatusOutputSchema>\n","import { oc } from \"@orpc/contract\"\nimport {\n BetaAccessStatusInputSchema,\n BetaAccessStatusOutputSchema,\n} from \"#/schemas/beta-access\"\n\nexport const betaAccessContract = {\n status: oc\n .route({\n method: \"GET\",\n path: \"/beta-access/status\",\n summary: \"Get beta access status for a feature\",\n tags: [\"Beta Access\"],\n })\n .input(BetaAccessStatusInputSchema)\n .output(BetaAccessStatusOutputSchema),\n}\n","import type { ErrorMap } from \"@orpc/contract\"\nimport { z } from \"zod\"\n\ninterface PublicAppErrorDefinition {\n data?: z.ZodTypeAny\n message: string\n status: number\n}\n\nexport const CellValidationFailureReasonSchema = z.enum([\n \"unknown_notebase_column\",\n \"type_mismatch\",\n \"invalid_select_option\",\n \"invalid_date_format\",\n])\nexport type CellValidationFailureReason = z.infer<typeof CellValidationFailureReasonSchema>\n\nexport const CellValidationFailureDetailsSchema = z.object({\n expectedFormat: z.string().optional(),\n expectedType: z.string().optional(),\n receivedType: z.string().optional(),\n receivedValue: z.unknown().optional(),\n validOptions: z.array(z.string()).optional(),\n}).strict()\nexport type CellValidationFailureDetails = z.infer<typeof CellValidationFailureDetailsSchema>\n\nexport const CellValidationFailedDataSchema = z.object({\n notebaseColumnId: z.string(),\n details: CellValidationFailureDetailsSchema,\n reason: CellValidationFailureReasonSchema,\n}).strict()\nexport type CellValidationFailedData = z.infer<typeof CellValidationFailedDataSchema>\n\nexport const CardTemplateInvalidColumnsDataSchema = z.object({\n notebaseColumnIds: z.array(z.string()),\n}).strict()\nexport type CardTemplateInvalidColumnsData = z.infer<typeof CardTemplateInvalidColumnsDataSchema>\n\nexport const PUBLIC_APP_ERROR_DEFS = {\n NOTEBASE_BETA_RESTRICTED: {\n message: \"Notebase is currently in beta for selected accounts\",\n status: 403,\n },\n NOTEBASE_NOT_FOUND: {\n message: \"Notebase not found\",\n status: 404,\n },\n NOTEBASE_COLUMN_NOT_FOUND: {\n message: \"Notebase column not found\",\n status: 404,\n },\n NOTEBASE_ROW_NOT_FOUND: {\n message: \"Notebase row not found\",\n status: 404,\n },\n CARD_NOT_FOUND: {\n message: \"Card not found\",\n status: 404,\n },\n CARD_TEMPLATE_NOT_FOUND: {\n message: \"Card template not found\",\n status: 404,\n },\n CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS: {\n data: CardTemplateInvalidColumnsDataSchema,\n message: \"Card template references unknown notebase columns\",\n status: 422,\n },\n CARD_TEMPLATE_NOTEBASE_COLUMN_IN_USE: {\n message: \"Notebase column is used by a card template\",\n status: 409,\n },\n CARD_NOT_REVIEWABLE: {\n message: \"Card cannot be reviewed in its current state\",\n status: 409,\n },\n CARD_REVIEW_STATE_STALE: {\n message: \"Card review state is stale\",\n status: 409,\n },\n CARD_REVIEW_ROLLBACK_UNAVAILABLE: {\n message: \"Card review cannot be rolled back\",\n status: 409,\n },\n CARD_ALREADY_BURIED: {\n message: \"Card is already buried\",\n status: 409,\n },\n CARD_NOT_BURIED: {\n message: \"Card is not buried\",\n status: 409,\n },\n CARD_ALREADY_SUSPENDED: {\n message: \"Card is already suspended\",\n status: 409,\n },\n CARD_NOT_SUSPENDED: {\n message: \"Card is not suspended\",\n status: 409,\n },\n CARD_STATUS_CHANGE_UNAVAILABLE: {\n message: \"Card status change is unavailable\",\n status: 409,\n },\n NOTEBASE_VIEW_NOT_FOUND: {\n message: \"Notebase view not found\",\n status: 404,\n },\n CELL_VALIDATION_FAILED: {\n data: CellValidationFailedDataSchema,\n message: \"Cell validation failed\",\n status: 422,\n },\n PRIMARY_NOTEBASE_COLUMN_DELETE_NOT_ALLOWED: {\n message: \"Cannot delete primary notebase column\",\n status: 400,\n },\n CONCURRENT_POSITION_CONFLICT: {\n message: \"Concurrent position conflict, please retry\",\n status: 409,\n },\n} as const satisfies Record<string, PublicAppErrorDefinition>\n\nexport type PublicAppErrorCode = keyof typeof PUBLIC_APP_ERROR_DEFS\n\nexport type PublicAppErrorData<TCode extends PublicAppErrorCode>\n = (typeof PUBLIC_APP_ERROR_DEFS)[TCode] extends { data: infer TSchema extends z.ZodTypeAny }\n ? z.output<TSchema>\n : undefined\n\nexport function isPublicAppErrorCode(code: string | undefined): code is PublicAppErrorCode {\n return code !== undefined && code in PUBLIC_APP_ERROR_DEFS\n}\n\nexport function getPublicErrorDefinition<TCode extends PublicAppErrorCode>(code: TCode) {\n return PUBLIC_APP_ERROR_DEFS[code]\n}\n\nexport function pickPublicErrorMap<const TCodes extends readonly PublicAppErrorCode[]>(\n ...codes: TCodes\n) {\n return Object.fromEntries(codes.map((code) => {\n const definition = PUBLIC_APP_ERROR_DEFS[code]\n\n if (\"data\" in definition) {\n return [code, {\n data: definition.data,\n message: definition.message,\n status: definition.status,\n }]\n }\n\n return [code, {\n message: definition.message,\n status: definition.status,\n }]\n })) as Pick<ErrorMap, TCodes[number]>\n}\n","import {\n cardIdentityShape,\n cardMemoryStateShape,\n cardStateSchema,\n cardTemplateConfigSchema,\n scheduleStatusSchema,\n} from \"@read-frog/definitions\"\nimport { z } from \"zod\"\n\nexport {\n cardStateSchema,\n scheduleStatusSchema,\n}\nexport type { CardState, ScheduleStatus } from \"@read-frog/definitions\"\n\nexport const cardTemplateSchema = z.object({\n id: z.uuid(),\n notebaseId: z.uuid(),\n name: z.string(),\n config: cardTemplateConfigSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type CardTemplate = z.infer<typeof cardTemplateSchema>\n\nexport const CardTemplateListInputSchema = z.object({\n notebaseId: z.uuid(),\n})\nexport type CardTemplateListInput = z.infer<typeof CardTemplateListInputSchema>\n\nexport const CardTemplateListOutputSchema = z.array(cardTemplateSchema)\nexport type CardTemplateListOutput = z.infer<typeof CardTemplateListOutputSchema>\n\nexport const CardTemplateGetInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CardTemplateGetInput = z.infer<typeof CardTemplateGetInputSchema>\n\nexport const CardTemplateGetOutputSchema = cardTemplateSchema\nexport type CardTemplateGetOutput = z.infer<typeof CardTemplateGetOutputSchema>\n\nexport const CardTemplateCreateInputSchema = z.object({\n id: z.uuid().optional(),\n notebaseId: z.uuid(),\n name: z.string().min(1),\n config: cardTemplateConfigSchema,\n}).strict()\nexport type CardTemplateCreateInput = z.infer<typeof CardTemplateCreateInputSchema>\n\nexport const CardTemplateCreateOutputSchema = cardTemplateSchema.extend({\n txid: z.number(),\n})\nexport type CardTemplateCreateOutput = z.infer<typeof CardTemplateCreateOutputSchema>\n\nexport const CardTemplateUpdateInputSchema = z.object({\n id: z.uuid(),\n name: z.string().min(1).optional(),\n config: cardTemplateConfigSchema.optional(),\n}).strict()\nexport type CardTemplateUpdateInput = z.infer<typeof CardTemplateUpdateInputSchema>\n\nexport const CardTemplateUpdateOutputSchema = cardTemplateSchema.extend({\n txid: z.number(),\n})\nexport type CardTemplateUpdateOutput = z.infer<typeof CardTemplateUpdateOutputSchema>\n\nexport const CardTemplateDeleteInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CardTemplateDeleteInput = z.infer<typeof CardTemplateDeleteInputSchema>\n\nexport const CardTemplateDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type CardTemplateDeleteOutput = z.infer<typeof CardTemplateDeleteOutputSchema>\n\nexport const cardSchema = z.object({\n ...cardIdentityShape,\n ...cardMemoryStateShape,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type Card = z.infer<typeof cardSchema>\n\nexport const renderedCardSchema = cardSchema.extend({\n front: z.string(),\n back: z.string(),\n})\nexport type RenderedCard = z.infer<typeof renderedCardSchema>\n\nexport const CardListInputSchema = z.object({\n notebaseId: z.uuid(),\n templateId: z.uuid().optional(),\n limit: z.number().int().min(1).max(500).optional(),\n offset: z.number().int().min(0).optional(),\n})\nexport type CardListInput = z.infer<typeof CardListInputSchema>\n\nexport const CardListOutputSchema = z.array(renderedCardSchema)\nexport type CardListOutput = z.infer<typeof CardListOutputSchema>\n\nexport const CardGetInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CardGetInput = z.infer<typeof CardGetInputSchema>\n\nexport const CardGetOutputSchema = renderedCardSchema\nexport type CardGetOutput = z.infer<typeof CardGetOutputSchema>\n\nexport const CardGenerateInputSchema = z.object({\n notebaseId: z.uuid(),\n templateId: z.uuid().optional(),\n})\nexport type CardGenerateInput = z.infer<typeof CardGenerateInputSchema>\n\nexport const CardGenerateOutputSchema = z.object({\n created: z.number().int().min(0),\n txid: z.number(),\n})\nexport type CardGenerateOutput = z.infer<typeof CardGenerateOutputSchema>\n","import { oc } from \"@orpc/contract\"\nimport { pickPublicErrorMap } from \"#/public-errors\"\n\nexport const notebaseProcedure = oc.errors(\n pickPublicErrorMap(\"NOTEBASE_BETA_RESTRICTED\"),\n)\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n CardGenerateInputSchema,\n CardGenerateOutputSchema,\n CardGetInputSchema,\n CardGetOutputSchema,\n CardListInputSchema,\n CardListOutputSchema,\n} from \"#/schemas/card\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const cardContract = {\n list: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/cards\",\n summary: \"List rendered cards\",\n tags: [\"Cards\"],\n })\n .input(CardListInputSchema)\n .output(CardListOutputSchema),\n\n get: notebaseProcedure\n .errors(pickPublicErrorMap(\"CARD_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/cards/{id}\",\n summary: \"Get rendered card\",\n tags: [\"Cards\"],\n })\n .input(CardGetInputSchema)\n .output(CardGetOutputSchema),\n\n generate: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CARD_TEMPLATE_NOT_FOUND\"))\n .route({\n method: \"POST\",\n path: \"/cards/generate\",\n summary: \"Generate missing cards\",\n tags: [\"Cards\"],\n })\n .input(CardGenerateInputSchema)\n .output(CardGenerateOutputSchema),\n}\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n CardTemplateCreateInputSchema,\n CardTemplateCreateOutputSchema,\n CardTemplateDeleteInputSchema,\n CardTemplateDeleteOutputSchema,\n CardTemplateGetInputSchema,\n CardTemplateGetOutputSchema,\n CardTemplateListInputSchema,\n CardTemplateListOutputSchema,\n CardTemplateUpdateInputSchema,\n CardTemplateUpdateOutputSchema,\n} from \"#/schemas/card\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const cardTemplateContract = {\n list: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/card-templates\",\n summary: \"List card templates\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateListInputSchema)\n .output(CardTemplateListOutputSchema),\n\n get: notebaseProcedure\n .errors(pickPublicErrorMap(\"CARD_TEMPLATE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/card-templates/{id}\",\n summary: \"Get card template\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateGetInputSchema)\n .output(CardTemplateGetOutputSchema),\n\n create: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS\"))\n .route({\n method: \"POST\",\n path: \"/card-templates\",\n summary: \"Create card template\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateCreateInputSchema)\n .output(CardTemplateCreateOutputSchema),\n\n update: notebaseProcedure\n .errors(pickPublicErrorMap(\"CARD_TEMPLATE_NOT_FOUND\", \"CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS\"))\n .route({\n method: \"PATCH\",\n path: \"/card-templates/{id}\",\n summary: \"Update card template\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateUpdateInputSchema)\n .output(CardTemplateUpdateOutputSchema),\n\n delete: notebaseProcedure\n .errors(pickPublicErrorMap(\"CARD_TEMPLATE_NOT_FOUND\"))\n .route({\n method: \"DELETE\",\n path: \"/card-templates/{id}\",\n summary: \"Delete card template\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateDeleteInputSchema)\n .output(CardTemplateDeleteOutputSchema),\n}\n","import type { RefinementCtx } from \"zod\"\nimport { z } from \"zod\"\n\nconst HOSTED_AI_SYSTEM_FALLBACK_REMOVAL_DATE = \"2026-07-11\"\n\nexport const HostedAiOutputFieldTypeSchema = z.enum([\"string\", \"number\"])\n\nexport const HostedAiOutputFieldSchema = z.strictObject({\n name: z.string().trim().min(1).max(80),\n type: HostedAiOutputFieldTypeSchema,\n})\n\nconst HostedAiInstructionsSchema = z.string().trim().min(1).max(16000)\n\ninterface HostedAiInstructionsCompatibilityInput {\n instructions?: string\n system?: string\n}\n\nfunction validateHostedAiInstructionsCompatibility(\n input: HostedAiInstructionsCompatibilityInput,\n ctx: RefinementCtx<HostedAiInstructionsCompatibilityInput>,\n): void {\n if (input.instructions !== undefined || input.system !== undefined) {\n return\n }\n\n ctx.addIssue({\n code: \"custom\",\n message: `instructions is required. The deprecated system field is accepted as a temporary fallback until ${HOSTED_AI_SYSTEM_FALLBACK_REMOVAL_DATE}.`,\n path: [\"instructions\"],\n })\n}\n\nexport const HostedAiStreamTextInputSchema = z.strictObject({\n instructions: HostedAiInstructionsSchema.optional(),\n system: HostedAiInstructionsSchema.optional(),\n prompt: z.string().trim().min(1).max(32000),\n temperature: z.number().min(0).max(2).optional(),\n}).superRefine(validateHostedAiInstructionsCompatibility)\n\nexport const HostedAiStreamStructuredObjectInputSchema = z.strictObject({\n instructions: HostedAiInstructionsSchema.optional(),\n system: HostedAiInstructionsSchema.optional(),\n prompt: z.string().trim().min(1).max(32000),\n outputSchema: z.array(HostedAiOutputFieldSchema).min(1).max(32),\n temperature: z.number().min(0).max(2).optional(),\n}).superRefine((input, ctx) => {\n validateHostedAiInstructionsCompatibility(input, ctx)\n\n const fieldNames = new Set<string>()\n\n input.outputSchema.forEach((field, index) => {\n if (fieldNames.has(field.name)) {\n ctx.addIssue({\n code: \"custom\",\n message: `Duplicate output schema name \"${field.name}\".`,\n path: [\"outputSchema\", index, \"name\"],\n })\n return\n }\n\n fieldNames.add(field.name)\n })\n})\n\nexport const HostedAiStreamPartSchema = z.looseObject({\n type: z.string().trim().min(1),\n})\n\nexport type HostedAiOutputFieldType = z.infer<typeof HostedAiOutputFieldTypeSchema>\nexport type HostedAiOutputField = z.infer<typeof HostedAiOutputFieldSchema>\nexport type HostedAiStreamTextInput = z.infer<typeof HostedAiStreamTextInputSchema>\nexport type HostedAiStreamStructuredObjectInput = z.infer<typeof HostedAiStreamStructuredObjectInputSchema>\nexport type HostedAiStreamPart = z.infer<typeof HostedAiStreamPartSchema>\n","import { eventIterator, oc } from \"@orpc/contract\"\nimport {\n HostedAiStreamPartSchema,\n HostedAiStreamStructuredObjectInputSchema,\n HostedAiStreamTextInputSchema,\n} from \"#/schemas/hosted-ai\"\n\nexport const hostedAiContract = {\n translate: {\n streamText: oc\n .route({\n method: \"POST\",\n path: \"/hosted-ai/translate/stream-text\",\n summary: \"Stream hosted translation text output\",\n tags: [\"Hosted AI\"],\n })\n .input(HostedAiStreamTextInputSchema)\n .output(eventIterator(HostedAiStreamPartSchema)),\n },\n customAction: {\n streamStructuredObject: oc\n .route({\n method: \"POST\",\n path: \"/hosted-ai/custom-actions/stream-structured-object\",\n summary: \"Stream hosted custom action structured output\",\n tags: [\"Hosted AI\"],\n })\n .input(HostedAiStreamStructuredObjectInputSchema)\n .output(eventIterator(HostedAiStreamPartSchema)),\n },\n}\n","import { NOTEBASE_COLUMN_MAX_WIDTH, NOTEBASE_COLUMN_MIN_WIDTH, notebaseColumnConfigSchema } from \"@read-frog/definitions\"\nimport { z } from \"zod\"\n\nexport const notebaseColumnWidthSchema = z.number().int().min(NOTEBASE_COLUMN_MIN_WIDTH).max(NOTEBASE_COLUMN_MAX_WIDTH)\n\nexport const notebaseColumnSchema = z.object({\n id: z.string(),\n notebaseId: z.string(),\n name: z.string(),\n config: notebaseColumnConfigSchema,\n position: z.number(),\n isPrimary: z.boolean(),\n width: z.number().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type NotebaseColumn = z.infer<typeof notebaseColumnSchema>\n\nexport const notebaseColumnCreateDataSchema = z.object({\n id: z.uuid().optional(),\n name: z.string().min(1),\n config: notebaseColumnConfigSchema,\n}).strict()\nexport type NotebaseColumnCreateData = z.infer<typeof notebaseColumnCreateDataSchema>\n\nexport const notebaseColumnUpdateDataSchema = z.object({\n name: z.string().min(1).optional(),\n config: notebaseColumnConfigSchema.optional(),\n width: notebaseColumnWidthSchema.nullable().optional(),\n}).strict()\nexport type NotebaseColumnUpdateData = z.infer<typeof notebaseColumnUpdateDataSchema>\n\nexport const NotebaseColumnCreateInputSchema = z.object({\n notebaseId: z.uuid(),\n data: notebaseColumnCreateDataSchema,\n})\nexport type NotebaseColumnCreateInput = z.infer<typeof NotebaseColumnCreateInputSchema>\n\nexport const NotebaseColumnCreateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseColumnCreateOutput = z.infer<typeof NotebaseColumnCreateOutputSchema>\n\nexport const NotebaseColumnUpdateInputSchema = z.object({\n notebaseColumnId: z.uuid(),\n data: notebaseColumnUpdateDataSchema,\n})\nexport type NotebaseColumnUpdateInput = z.infer<typeof NotebaseColumnUpdateInputSchema>\n\nexport const NotebaseColumnUpdateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseColumnUpdateOutput = z.infer<typeof NotebaseColumnUpdateOutputSchema>\n\nexport const NotebaseColumnDeleteInputSchema = z.object({\n notebaseColumnId: z.uuid(),\n})\nexport type NotebaseColumnDeleteInput = z.infer<typeof NotebaseColumnDeleteInputSchema>\n\nexport const NotebaseColumnDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseColumnDeleteOutput = z.infer<typeof NotebaseColumnDeleteOutputSchema>\n\nexport const NotebaseColumnReorderInputSchema = z.object({\n notebaseId: z.uuid(),\n ids: z.array(z.uuid()),\n})\nexport type NotebaseColumnReorderInput = z.infer<typeof NotebaseColumnReorderInputSchema>\n\nexport const NotebaseColumnReorderOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseColumnReorderOutput = z.infer<typeof NotebaseColumnReorderOutputSchema>\n","import { z } from \"zod\"\n\nexport const notebaseRowCellsSchema = z.record(z.string(), z.unknown())\n\nexport const notebaseRowSchema = z.object({\n id: z.string(),\n notebaseId: z.string(),\n cells: notebaseRowCellsSchema,\n position: z.number(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type NotebaseRow = z.infer<typeof notebaseRowSchema>\n\nexport const notebaseRowCreateDataSchema = z.object({\n id: z.uuid().optional(),\n cells: notebaseRowCellsSchema.optional(),\n}).strict()\nexport type NotebaseRowCreateData = z.infer<typeof notebaseRowCreateDataSchema>\n\nexport const notebaseRowUpdateDataSchema = z.object({\n cells: notebaseRowCellsSchema.optional(),\n}).strict()\nexport type NotebaseRowUpdateData = z.infer<typeof notebaseRowUpdateDataSchema>\n\nexport const NotebaseRowCreateInputSchema = z.object({\n notebaseId: z.uuid(),\n data: notebaseRowCreateDataSchema,\n})\nexport type NotebaseRowCreateInput = z.infer<typeof NotebaseRowCreateInputSchema>\n\nexport const NotebaseRowCreateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseRowCreateOutput = z.infer<typeof NotebaseRowCreateOutputSchema>\n\nexport const NotebaseRowUpdateInputSchema = z.object({\n notebaseRowId: z.uuid(),\n data: notebaseRowUpdateDataSchema,\n})\nexport type NotebaseRowUpdateInput = z.infer<typeof NotebaseRowUpdateInputSchema>\n\nexport const NotebaseRowUpdateOutputSchema = z.object({\n id: z.uuid(),\n notebaseId: z.uuid(),\n cells: notebaseRowCellsSchema,\n position: z.number().int(),\n createdAt: z.date(),\n updatedAt: z.date(),\n txid: z.number(),\n})\nexport type NotebaseRowUpdateOutput = z.infer<typeof NotebaseRowUpdateOutputSchema>\n\nexport const NotebaseRowDeleteInputSchema = z.object({\n notebaseRowId: z.uuid(),\n})\nexport type NotebaseRowDeleteInput = z.infer<typeof NotebaseRowDeleteInputSchema>\n\nexport const NotebaseRowDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseRowDeleteOutput = z.infer<typeof NotebaseRowDeleteOutputSchema>\n\nexport const NotebaseRowReorderInputSchema = z.object({\n notebaseId: z.uuid(),\n ids: z.array(z.uuid()),\n})\nexport type NotebaseRowReorderInput = z.infer<typeof NotebaseRowReorderInputSchema>\n\nexport const NotebaseRowReorderOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseRowReorderOutput = z.infer<typeof NotebaseRowReorderOutputSchema>\n","import { z } from \"zod\"\n\nexport const notebaseViewTypeSchema = z.enum([\"table\", \"kanban\", \"gallery\"])\nexport type NotebaseViewType = z.infer<typeof notebaseViewTypeSchema>\n\nexport const notebaseViewConfigSchema = z.object({\n notebaseColumnWidths: z.record(z.string(), z.number()).optional(),\n hiddenNotebaseColumns: z.array(z.string()).optional(),\n groupByNotebaseColumnId: z.string().optional(),\n}).catchall(z.unknown())\nexport type NotebaseViewConfig = z.infer<typeof notebaseViewConfigSchema>\n\nexport const notebaseViewFilterSchema = z.object({\n notebaseColumnId: z.string(),\n operator: z.string(),\n value: z.unknown(),\n}).strict()\nexport type NotebaseViewFilter = z.infer<typeof notebaseViewFilterSchema>\n\nexport const notebaseViewFiltersSchema = z.array(notebaseViewFilterSchema)\n\nexport const notebaseViewSortSchema = z.object({\n notebaseColumnId: z.string(),\n direction: z.enum([\"asc\", \"desc\"]),\n}).strict()\nexport type NotebaseViewSort = z.infer<typeof notebaseViewSortSchema>\n\nexport const notebaseViewSortsSchema = z.array(notebaseViewSortSchema)\n\nexport const notebaseViewCreateDataSchema = z.object({\n id: z.uuid().optional(),\n name: z.string().min(1),\n type: notebaseViewTypeSchema,\n config: notebaseViewConfigSchema.optional(),\n filters: notebaseViewFiltersSchema.optional(),\n sorts: notebaseViewSortsSchema.optional(),\n}).strict()\nexport type NotebaseViewCreateData = z.infer<typeof notebaseViewCreateDataSchema>\n\nexport const notebaseViewUpdateDataSchema = z.object({\n name: z.string().min(1).optional(),\n type: notebaseViewTypeSchema.optional(),\n config: notebaseViewConfigSchema.optional(),\n filters: notebaseViewFiltersSchema.optional(),\n sorts: notebaseViewSortsSchema.optional(),\n}).strict()\nexport type NotebaseViewUpdateData = z.infer<typeof notebaseViewUpdateDataSchema>\n\nexport const notebaseViewSchema = z.object({\n id: z.string(),\n notebaseId: z.string(),\n name: z.string(),\n type: notebaseViewTypeSchema,\n config: notebaseViewConfigSchema.nullable(),\n filters: z.array(z.unknown()).nullable(),\n sorts: z.array(z.unknown()).nullable(),\n position: z.number(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type NotebaseView = z.infer<typeof notebaseViewSchema>\n","import { notebaseColumnConfigSchema, schedulingParamsShape, srsWeightsSchema } from \"@read-frog/definitions\"\nimport { z } from \"zod\"\nimport { notebaseColumnSchema } from \"./notebase-column\"\nimport { notebaseRowSchema } from \"./notebase-row\"\nimport { notebaseViewSchema } from \"./notebase-view\"\n\nexport const NotebaseListInputSchema = z.object({})\nexport type NotebaseListInput = z.infer<typeof NotebaseListInputSchema>\n\nexport const NotebaseListItemSchema = z.object({\n id: z.string(),\n name: z.string(),\n})\nexport type NotebaseListItem = z.infer<typeof NotebaseListItemSchema>\n\nexport const NotebaseListOutputSchema = z.array(NotebaseListItemSchema)\nexport type NotebaseListOutput = z.infer<typeof NotebaseListOutputSchema>\n\nexport const notebaseSchema = z.object({\n id: z.string(),\n userId: z.string(),\n name: z.string(),\n srsNewPerDay: schedulingParamsShape.newPerDay,\n srsReviewsPerDay: schedulingParamsShape.reviewsPerDay,\n srsDesiredRetention: schedulingParamsShape.desiredRetention,\n srsEnableShortTerm: schedulingParamsShape.enableShortTerm,\n srsMaximumInterval: schedulingParamsShape.maximumInterval,\n srsLearningSteps: schedulingParamsShape.learningSteps,\n srsRelearningSteps: schedulingParamsShape.relearningSteps,\n srsLeechThreshold: schedulingParamsShape.leechThreshold,\n srsEnableFuzz: schedulingParamsShape.enableFuzz,\n srsWeights: srsWeightsSchema.nullable(),\n createdAt: z.date(),\n updatedAt: z.date(),\n})\nexport type Notebase = z.infer<typeof notebaseSchema>\n\nexport const notebaseCreateDataSchema = z.object({\n id: z.uuid().optional(),\n name: z.string().min(1),\n options: z.object({\n initialColumns: z.array(z.object({\n id: z.uuid(),\n name: z.string().min(1),\n config: notebaseColumnConfigSchema,\n }).strict()).min(1),\n initialRow: z.object({\n id: z.uuid().optional(),\n cells: z.record(z.string(), z.unknown()),\n }).strict().optional(),\n }).strict().optional(),\n}).strict()\nexport type NotebaseCreateData = z.infer<typeof notebaseCreateDataSchema>\n\nexport const NotebaseCreateInputSchema = notebaseCreateDataSchema\nexport type NotebaseCreateInput = z.infer<typeof NotebaseCreateInputSchema>\n\nexport const NotebaseCreateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseCreateOutput = z.infer<typeof NotebaseCreateOutputSchema>\n\nexport const notebaseUpdateDataSchema = z.object({\n name: z.string().min(1).optional(),\n srsNewPerDay: schedulingParamsShape.newPerDay.optional(),\n srsReviewsPerDay: schedulingParamsShape.reviewsPerDay.optional(),\n}).strict()\nexport type NotebaseUpdateData = z.infer<typeof notebaseUpdateDataSchema>\n\nexport const NotebaseUpdateInputSchema = notebaseUpdateDataSchema.extend({\n id: z.uuid(),\n})\nexport type NotebaseUpdateInput = z.infer<typeof NotebaseUpdateInputSchema>\n\nexport const NotebaseUpdateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseUpdateOutput = z.infer<typeof NotebaseUpdateOutputSchema>\n\nexport const NotebaseDeleteInputSchema = z.object({\n id: z.uuid(),\n})\nexport type NotebaseDeleteInput = z.infer<typeof NotebaseDeleteInputSchema>\n\nexport const NotebaseDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseDeleteOutput = z.infer<typeof NotebaseDeleteOutputSchema>\n\n// Get endpoint schemas\nexport const NotebaseGetInputSchema = z.object({\n id: z.uuid(),\n})\nexport type NotebaseGetInput = z.infer<typeof NotebaseGetInputSchema>\n\nexport const NotebaseGetSchemaInputSchema = z.object({\n id: z.uuid(),\n})\nexport type NotebaseGetSchemaInput = z.infer<typeof NotebaseGetSchemaInputSchema>\n\nexport const NotebaseGetOutputSchema = notebaseSchema.extend({\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n notebaseColumns: z.array(notebaseColumnSchema),\n notebaseRows: z.array(notebaseRowSchema),\n notebaseViews: z.array(notebaseViewSchema),\n})\nexport type NotebaseGetOutput = z.infer<typeof NotebaseGetOutputSchema>\n\nexport const NotebaseGetSchemaOutputSchema = z.object({\n id: z.string(),\n name: z.string(),\n updatedAt: z.coerce.date(),\n notebaseColumns: z.array(notebaseColumnSchema),\n})\nexport type NotebaseGetSchemaOutput = z.infer<typeof NotebaseGetSchemaOutputSchema>\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n NotebaseCreateInputSchema,\n NotebaseCreateOutputSchema,\n NotebaseDeleteInputSchema,\n NotebaseDeleteOutputSchema,\n NotebaseGetInputSchema,\n NotebaseGetOutputSchema,\n NotebaseGetSchemaInputSchema,\n NotebaseGetSchemaOutputSchema,\n NotebaseListInputSchema,\n NotebaseListOutputSchema,\n NotebaseUpdateInputSchema,\n NotebaseUpdateOutputSchema,\n} from \"#/schemas/notebase\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const notebaseContract = {\n list: notebaseProcedure\n .route({\n method: \"GET\",\n path: \"/notebases\",\n summary: \"List notebases\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseListInputSchema)\n .output(NotebaseListOutputSchema),\n\n get: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/notebases/{id}\",\n summary: \"Get notebase with notebase columns, rows, and views\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseGetInputSchema)\n .output(NotebaseGetOutputSchema),\n\n getSchema: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/notebases/{id}/schema\",\n summary: \"Get notebase schema\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseGetSchemaInputSchema)\n .output(NotebaseGetSchemaOutputSchema),\n\n create: notebaseProcedure\n .route({\n method: \"POST\",\n path: \"/notebases\",\n summary: \"Create notebase\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseCreateInputSchema)\n .output(NotebaseCreateOutputSchema),\n\n update: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"PUT\",\n path: \"/notebases/{id}\",\n summary: \"Update notebase\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseUpdateInputSchema)\n .output(NotebaseUpdateOutputSchema),\n\n delete: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"DELETE\",\n path: \"/notebases/{id}\",\n summary: \"Delete notebase\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseDeleteInputSchema)\n .output(NotebaseDeleteOutputSchema),\n}\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n NotebaseColumnCreateInputSchema,\n NotebaseColumnCreateOutputSchema,\n NotebaseColumnDeleteInputSchema,\n NotebaseColumnDeleteOutputSchema,\n NotebaseColumnReorderInputSchema,\n NotebaseColumnReorderOutputSchema,\n NotebaseColumnUpdateInputSchema,\n NotebaseColumnUpdateOutputSchema,\n} from \"#/schemas/notebase-column\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const notebaseColumnContract = {\n create: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CONCURRENT_POSITION_CONFLICT\"))\n .route({\n method: \"POST\",\n path: \"/notebase-columns\",\n summary: \"Create notebase column\",\n tags: [\"Notebase Columns\"],\n })\n .input(NotebaseColumnCreateInputSchema)\n .output(NotebaseColumnCreateOutputSchema),\n\n update: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_COLUMN_NOT_FOUND\"))\n .route({\n method: \"PATCH\",\n path: \"/notebase-columns/{notebaseColumnId}\",\n summary: \"Update notebase column\",\n tags: [\"Notebase Columns\"],\n })\n .input(NotebaseColumnUpdateInputSchema)\n .output(NotebaseColumnUpdateOutputSchema),\n\n delete: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"NOTEBASE_COLUMN_NOT_FOUND\",\n \"PRIMARY_NOTEBASE_COLUMN_DELETE_NOT_ALLOWED\",\n \"CARD_TEMPLATE_NOTEBASE_COLUMN_IN_USE\",\n \"CONCURRENT_POSITION_CONFLICT\",\n ))\n .route({\n method: \"DELETE\",\n path: \"/notebase-columns/{notebaseColumnId}\",\n summary: \"Delete notebase column\",\n tags: [\"Notebase Columns\"],\n })\n .input(NotebaseColumnDeleteInputSchema)\n .output(NotebaseColumnDeleteOutputSchema),\n\n reorder: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CONCURRENT_POSITION_CONFLICT\"))\n .route({\n method: \"POST\",\n path: \"/notebase-columns/reorder\",\n summary: \"Reorder notebase columns\",\n tags: [\"Notebase Columns\"],\n })\n .input(NotebaseColumnReorderInputSchema)\n .output(NotebaseColumnReorderOutputSchema),\n}\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n NotebaseRowCreateInputSchema,\n NotebaseRowCreateOutputSchema,\n NotebaseRowDeleteInputSchema,\n NotebaseRowDeleteOutputSchema,\n NotebaseRowReorderInputSchema,\n NotebaseRowReorderOutputSchema,\n NotebaseRowUpdateInputSchema,\n NotebaseRowUpdateOutputSchema,\n} from \"#/schemas/notebase-row\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const notebaseRowContract = {\n create: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"NOTEBASE_NOT_FOUND\",\n \"CELL_VALIDATION_FAILED\",\n \"CONCURRENT_POSITION_CONFLICT\",\n ))\n .route({\n method: \"POST\",\n path: \"/notebase-rows\",\n summary: \"Create notebase row\",\n tags: [\"Notebase Rows\"],\n })\n .input(NotebaseRowCreateInputSchema)\n .output(NotebaseRowCreateOutputSchema),\n\n update: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_ROW_NOT_FOUND\", \"CELL_VALIDATION_FAILED\"))\n .route({\n method: \"PATCH\",\n path: \"/notebase-rows/{notebaseRowId}\",\n summary: \"Update notebase row cells\",\n tags: [\"Notebase Rows\"],\n })\n .input(NotebaseRowUpdateInputSchema)\n .output(NotebaseRowUpdateOutputSchema),\n\n delete: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_ROW_NOT_FOUND\", \"CONCURRENT_POSITION_CONFLICT\"))\n .route({\n method: \"DELETE\",\n path: \"/notebase-rows/{notebaseRowId}\",\n summary: \"Delete notebase row\",\n tags: [\"Notebase Rows\"],\n })\n .input(NotebaseRowDeleteInputSchema)\n .output(NotebaseRowDeleteOutputSchema),\n\n reorder: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CONCURRENT_POSITION_CONFLICT\"))\n .route({\n method: \"POST\",\n path: \"/notebase-rows/reorder\",\n summary: \"Reorder notebase rows\",\n tags: [\"Notebase Rows\"],\n })\n .input(NotebaseRowReorderInputSchema)\n .output(NotebaseRowReorderOutputSchema),\n}\n","import { z } from \"zod\"\n\n// @ref https://zenn.dev/herp_inc/articles/js-intl-date-time-format-performance\nconst localeTimeZoneFormatter = new Map<string, Intl.DateTimeFormat>()\nfunction createTimezoneFormatter(timezone: string): Intl.DateTimeFormat {\n let formatter = localeTimeZoneFormatter.get(timezone)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(\"en-US\", { timeZone: timezone })\n localeTimeZoneFormatter.set(timezone, formatter)\n }\n return formatter\n}\n\nexport const timezoneSchema = z.string().trim().min(1).refine((timezone) => {\n try {\n createTimezoneFormatter(timezone).format(new Date())\n return true\n }\n catch {\n return false\n }\n}, \"Invalid timezone\")\nexport type Timezone = z.infer<typeof timezoneSchema>\n","import {\n activeScheduleStatusSchema,\n cardStateSchema,\n fsrsReviewLogSnapshotSchema,\n reviewRatingSchema,\n scheduleStatusSchema,\n schedulingParamsSchema,\n SRS_REVIEW_DURATION_MS_MAX,\n srsStepSchema,\n} from \"@read-frog/definitions\"\nimport { z } from \"zod\"\nimport { cardSchema } from \"./card\"\nimport { timezoneSchema } from \"./timezone\"\n\nexport {\n reviewRatingSchema,\n schedulingParamsSchema,\n SRS_REVIEW_DURATION_MS_MAX,\n}\nexport { timezoneSchema } from \"./timezone\"\nexport type { Timezone } from \"./timezone\"\nexport type { ReviewRating, SchedulingParams } from \"@read-frog/definitions\"\n\nexport const stepSchema = srsStepSchema\nexport type Step = z.infer<typeof stepSchema>\n\nexport const SRS_REVIEW_CLIENT_ID_NAMESPACE = \"6ba7b811-9dad-11d1-80b4-00c04fd430c8\"\nconst srsReviewClientIdNamePrefix = \"readfrog:srs-review\"\nconst nullLastReviewTimeSentinel = \"null\"\n\nexport interface SrsReviewClientIdCard {\n id: string\n lastReviewTime: Date | string | null\n}\n\nexport async function createSrsReviewClientId(card: SrsReviewClientIdCard) {\n return uuidV5(\n `${srsReviewClientIdNamePrefix}:${card.id}:${formatLastReviewTime(card.lastReviewTime)}`,\n SRS_REVIEW_CLIENT_ID_NAMESPACE,\n )\n}\n\nexport const srsReviewInputSchema = z.object({\n cardId: z.uuid(),\n id: z.uuid().optional(),\n rating: reviewRatingSchema,\n durationMs: z.number().int().min(0).max(SRS_REVIEW_DURATION_MS_MAX),\n timezone: timezoneSchema,\n}).strict()\nexport type SrsReviewInput = z.infer<typeof srsReviewInputSchema>\n\nexport const srsRollbackReviewInputSchema = z.object({\n cardId: z.uuid(),\n}).strict()\nexport type SrsRollbackReviewInput = z.infer<typeof srsRollbackReviewInputSchema>\n\nexport const srsScheduleStatusStatsSchema = z.record(\n activeScheduleStatusSchema,\n z.number().int().min(0),\n)\nexport type SrsScheduleStatusStats = z.infer<typeof srsScheduleStatusStatsSchema>\n\nexport const srsScheduleStatusStatsInputSchema = z.object({\n notebaseIds: z.array(z.uuid()).optional(),\n timezone: timezoneSchema,\n}).strict()\nexport type SrsScheduleStatusStatsInput = z.infer<typeof srsScheduleStatusStatsInputSchema>\n\nexport const srsScheduleStatusStatsOutputSchema = z.record(\n z.uuid(),\n srsScheduleStatusStatsSchema,\n)\nexport type SrsScheduleStatusStatsOutput = z.infer<typeof srsScheduleStatusStatsOutputSchema>\n\nexport const srsManualCardStatusInputSchema = z.object({\n cardId: z.uuid(),\n enabled: z.boolean(),\n}).strict()\nexport type SrsManualCardStatusInput = z.infer<typeof srsManualCardStatusInputSchema>\n\nexport const srsSetCardBuriedInputSchema = srsManualCardStatusInputSchema\nexport type SrsSetCardBuriedInput = SrsManualCardStatusInput\n\nexport const srsSetCardSuspendedInputSchema = srsManualCardStatusInputSchema\nexport type SrsSetCardSuspendedInput = SrsManualCardStatusInput\n\nexport const srsRevlogSchema = z.object({\n id: z.uuid(),\n notebaseId: z.uuid(),\n cardId: z.uuid(),\n rating: reviewRatingSchema,\n state: cardStateSchema,\n afterScheduleStatus: scheduleStatusSchema,\n reviewedAt: z.coerce.date(),\n durationMs: z.number().int(),\n fsrsReviewLogSnapshot: fsrsReviewLogSnapshotSchema,\n createdAt: z.coerce.date(),\n})\nexport type SrsRevlog = z.infer<typeof srsRevlogSchema>\n\nexport const srsRevlogWithoutSnapshotSchema = srsRevlogSchema.omit({\n fsrsReviewLogSnapshot: true,\n})\nexport type SrsRevlogWithoutSnapshot = z.infer<typeof srsRevlogWithoutSnapshotSchema>\n\nexport const srsReviewOutputSchema = z.object({\n card: cardSchema,\n revlog: srsRevlogSchema,\n txid: z.number(),\n})\nexport type SrsReviewOutput = z.infer<typeof srsReviewOutputSchema>\n\nexport const srsRollbackReviewOutputSchema = z.object({\n card: cardSchema,\n rolledBackRevlogId: z.uuid(),\n txid: z.number(),\n})\nexport type SrsRollbackReviewOutput = z.infer<typeof srsRollbackReviewOutputSchema>\n\nexport const srsTxidOutputSchema = z.object({\n txid: z.number(),\n})\nexport type SrsTxidOutput = z.infer<typeof srsTxidOutputSchema>\n\nexport const srsSetCardBuriedOutputSchema = srsTxidOutputSchema\nexport type SrsSetCardBuriedOutput = SrsTxidOutput\n\nexport const srsSetCardSuspendedOutputSchema = srsTxidOutputSchema\nexport type SrsSetCardSuspendedOutput = SrsTxidOutput\n\nfunction formatLastReviewTime(lastReviewTime: Date | string | null) {\n return lastReviewTime ? new Date(lastReviewTime).toISOString() : nullLastReviewTimeSentinel\n}\n\nasync function uuidV5(name: string, namespace: string) {\n const namespaceBytes = uuidToBytes(namespace)\n const nameBytes = new TextEncoder().encode(name)\n const input = new Uint8Array(namespaceBytes.length + nameBytes.length)\n input.set(namespaceBytes)\n input.set(nameBytes, namespaceBytes.length)\n\n const hash = new Uint8Array(await crypto.subtle.digest(\"SHA-1\", input))\n const bytes = hash.slice(0, 16)\n const versionByte = bytes[6]\n const variantByte = bytes[8]\n if (versionByte === undefined || variantByte === undefined) {\n throw new Error(\"SHA-1 digest was too short\")\n }\n bytes[6] = (versionByte & 0x0F) | 0x50\n bytes[8] = (variantByte & 0x3F) | 0x80\n\n return bytesToUuid(bytes)\n}\n\nfunction uuidToBytes(uuid: string) {\n const hex = uuid.replaceAll(\"-\", \"\").toLowerCase()\n /* v8 ignore next 3 -- SRS_REVIEW_CLIENT_ID_NAMESPACE is a fixed valid UUID. */\n if (!/^[0-9a-f]{32}$/.test(hex)) {\n throw new Error(\"Invalid UUID namespace\")\n }\n\n return new Uint8Array(\n Array.from({ length: 16 }, (_, index) =>\n Number.parseInt(hex.slice(index * 2, index * 2 + 2), 16)),\n )\n}\n\nfunction bytesToUuid(bytes: Uint8Array) {\n const hex = Array.from(bytes, byte => byte.toString(16).padStart(2, \"0\"))\n return [\n hex.slice(0, 4).join(\"\"),\n hex.slice(4, 6).join(\"\"),\n hex.slice(6, 8).join(\"\"),\n hex.slice(8, 10).join(\"\"),\n hex.slice(10, 16).join(\"\"),\n ].join(\"-\")\n}\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n srsReviewInputSchema,\n srsReviewOutputSchema,\n srsRollbackReviewInputSchema,\n srsRollbackReviewOutputSchema,\n srsScheduleStatusStatsInputSchema,\n srsScheduleStatusStatsOutputSchema,\n srsSetCardBuriedInputSchema,\n srsSetCardBuriedOutputSchema,\n srsSetCardSuspendedInputSchema,\n srsSetCardSuspendedOutputSchema,\n} from \"#/schemas/srs\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const srsContract = {\n scheduleStatusStats: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/srs/schedule-status-stats\",\n summary: \"List today schedule status stats for notebases\",\n tags: [\"SRS\"],\n })\n .input(srsScheduleStatusStatsInputSchema)\n .output(srsScheduleStatusStatsOutputSchema),\n\n review: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"CARD_NOT_FOUND\",\n \"CARD_NOT_REVIEWABLE\",\n \"CARD_REVIEW_STATE_STALE\",\n ))\n .route({\n method: \"POST\",\n path: \"/srs/review\",\n summary: \"Review a card with SRS scheduling\",\n tags: [\"SRS\"],\n })\n .input(srsReviewInputSchema)\n .output(srsReviewOutputSchema),\n rollbackReview: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"CARD_NOT_FOUND\",\n \"CARD_REVIEW_ROLLBACK_UNAVAILABLE\",\n ))\n .route({\n method: \"POST\",\n path: \"/srs/review/rollback\",\n summary: \"Roll back the latest SRS review for a card\",\n tags: [\"SRS\"],\n })\n .input(srsRollbackReviewInputSchema)\n .output(srsRollbackReviewOutputSchema),\n setCardBuried: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"CARD_NOT_FOUND\",\n \"CARD_ALREADY_BURIED\",\n \"CARD_NOT_BURIED\",\n \"CARD_STATUS_CHANGE_UNAVAILABLE\",\n ))\n .route({\n method: \"POST\",\n path: \"/srs/card/bury\",\n summary: \"Manually bury or unbury a card\",\n tags: [\"SRS\"],\n })\n .input(srsSetCardBuriedInputSchema)\n .output(srsSetCardBuriedOutputSchema),\n setCardSuspended: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"CARD_NOT_FOUND\",\n \"CARD_ALREADY_SUSPENDED\",\n \"CARD_NOT_SUSPENDED\",\n \"CARD_STATUS_CHANGE_UNAVAILABLE\",\n ))\n .route({\n method: \"POST\",\n path: \"/srs/card/suspend\",\n summary: \"Manually suspend or unsuspend a card\",\n tags: [\"SRS\"],\n })\n .input(srsSetCardSuspendedInputSchema)\n .output(srsSetCardSuspendedOutputSchema),\n}\n","import { z } from \"zod\"\nimport { timezoneSchema } from \"./timezone\"\n\nexport const userEnsureTimezoneInputSchema = z.object({\n timezone: timezoneSchema,\n}).strict()\nexport type UserEnsureTimezoneInput = z.infer<typeof userEnsureTimezoneInputSchema>\n\nexport const userEnsureTimezoneOutputSchema = z.object({\n timezone: timezoneSchema,\n updated: z.boolean(),\n}).strict()\nexport type UserEnsureTimezoneOutput = z.infer<typeof userEnsureTimezoneOutputSchema>\n\nexport const userUpdateTimezoneInputSchema = z.object({\n timezone: timezoneSchema,\n}).strict()\nexport type UserUpdateTimezoneInput = z.infer<typeof userUpdateTimezoneInputSchema>\n\nexport const userUpdateTimezoneOutputSchema = z.object({\n timezone: timezoneSchema,\n}).strict()\nexport type UserUpdateTimezoneOutput = z.infer<typeof userUpdateTimezoneOutputSchema>\n","import { oc } from \"@orpc/contract\"\nimport {\n userEnsureTimezoneInputSchema,\n userEnsureTimezoneOutputSchema,\n userUpdateTimezoneInputSchema,\n userUpdateTimezoneOutputSchema,\n} from \"#/schemas/user\"\n\nexport const userContract = {\n ensureTimezone: oc\n .route({\n method: \"POST\",\n path: \"/users/me/timezone/ensure\",\n summary: \"Ensure the authenticated user has a timezone\",\n tags: [\"Users\"],\n })\n .input(userEnsureTimezoneInputSchema)\n .output(userEnsureTimezoneOutputSchema),\n updateTimezone: oc\n .route({\n method: \"PATCH\",\n path: \"/users/me/timezone\",\n summary: \"Update the authenticated user's timezone\",\n tags: [\"Users\"],\n })\n .input(userUpdateTimezoneInputSchema)\n .output(userUpdateTimezoneOutputSchema),\n}\n","import type { ContractRouterClient } from \"@orpc/contract\"\nimport { betaAccessContract } from \"./contracts/beta-access\"\nimport { cardContract } from \"./contracts/card\"\nimport { cardTemplateContract } from \"./contracts/card-template\"\nimport { hostedAiContract } from \"./contracts/hosted-ai\"\nimport { notebaseContract } from \"./contracts/notebase\"\nimport { notebaseColumnContract } from \"./contracts/notebase-column\"\nimport { notebaseRowContract } from \"./contracts/notebase-row\"\nimport { srsContract } from \"./contracts/srs\"\nimport { userContract } from \"./contracts/user\"\n\nexport const contract = {\n betaAccess: betaAccessContract,\n card: cardContract,\n cardTemplate: cardTemplateContract,\n hostedAi: hostedAiContract,\n notebase: notebaseContract,\n notebaseColumn: notebaseColumnContract,\n notebaseRow: notebaseRowContract,\n srs: srsContract,\n user: userContract,\n}\n\nexport type ORPCRouterClient = ContractRouterClient<typeof contract>\n\nexport * from \"./public-errors\"\nexport * from \"./schemas/beta-access\"\nexport * from \"./schemas/card\"\nexport * from \"./schemas/hosted-ai\"\nexport * from \"./schemas/notebase\"\nexport * from \"./schemas/notebase-column\"\nexport * from \"./schemas/notebase-row\"\nexport * from \"./schemas/notebase-view\"\nexport * from \"./schemas/srs\"\nexport * from \"./schemas/timezone\"\nexport * from \"./schemas/user\"\n"],"mappings":";;;;AAGA,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;GACT,MAAM,CAAC,OAAO;EAChB,CAAC,CAAC,CACD,MAAM,6BAA6B,CAAC,CACpC,OAAO,8BAA8B;CCNlC;AACR"}
1
+ {"version":3,"file":"index.js","names":["cardStateSchema","scheduleStatusSchema"],"sources":["../src/schemas/beta-access.ts","../src/contracts/beta-access.ts","../src/public-errors.ts","../src/schemas/billing.ts","../src/contracts/billing.ts","../src/schemas/card.ts","../src/contracts/shared.ts","../src/contracts/card.ts","../src/contracts/card-template.ts","../src/schemas/hosted-ai.ts","../src/contracts/hosted-ai.ts","../src/schemas/notebase-column.ts","../src/schemas/notebase-row.ts","../src/schemas/notebase-view.ts","../src/schemas/notebase.ts","../src/contracts/notebase.ts","../src/contracts/notebase-column.ts","../src/contracts/notebase-row.ts","../src/schemas/timezone.ts","../src/schemas/srs.ts","../src/contracts/srs.ts","../src/schemas/user.ts","../src/contracts/user.ts","../src/index.ts"],"sourcesContent":["import { BETA_FEATURE_KEYS } from \"@read-frog/definitions\"\nimport { z } from \"zod\"\n\nexport const BetaFeatureKeySchema = z.enum(BETA_FEATURE_KEYS)\nexport type BetaFeatureKey = z.infer<typeof BetaFeatureKeySchema>\n\nexport const BetaAccessStatusInputSchema = z.object({\n featureKey: BetaFeatureKeySchema,\n}).strict()\nexport type BetaAccessStatusInput = z.infer<typeof BetaAccessStatusInputSchema>\n\nexport const BetaAccessStatusOutputSchema = z.object({\n featureKey: BetaFeatureKeySchema,\n allowed: z.boolean(),\n})\nexport type BetaAccessStatusOutput = z.infer<typeof BetaAccessStatusOutputSchema>\n","import { oc } from \"@orpc/contract\"\nimport {\n BetaAccessStatusInputSchema,\n BetaAccessStatusOutputSchema,\n} from \"#/schemas/beta-access\"\n\nexport const betaAccessContract = {\n status: oc\n .route({\n method: \"GET\",\n path: \"/beta-access/status\",\n summary: \"Get beta access status for a feature\",\n tags: [\"Beta Access\"],\n })\n .input(BetaAccessStatusInputSchema)\n .output(BetaAccessStatusOutputSchema),\n}\n","import type { ErrorMap } from \"@orpc/contract\"\nimport { z } from \"zod\"\n\ninterface PublicAppErrorDefinition {\n data?: z.ZodTypeAny\n message: string\n status: number\n}\n\nexport const CellValidationFailureReasonSchema = z.enum([\n \"unknown_notebase_column\",\n \"type_mismatch\",\n \"invalid_select_option\",\n \"invalid_date_format\",\n])\nexport type CellValidationFailureReason = z.infer<typeof CellValidationFailureReasonSchema>\n\nexport const CellValidationFailureDetailsSchema = z.object({\n expectedFormat: z.string().optional(),\n expectedType: z.string().optional(),\n receivedType: z.string().optional(),\n receivedValue: z.unknown().optional(),\n validOptions: z.array(z.string()).optional(),\n}).strict()\nexport type CellValidationFailureDetails = z.infer<typeof CellValidationFailureDetailsSchema>\n\nexport const CellValidationFailedDataSchema = z.object({\n notebaseColumnId: z.string(),\n details: CellValidationFailureDetailsSchema,\n reason: CellValidationFailureReasonSchema,\n}).strict()\nexport type CellValidationFailedData = z.infer<typeof CellValidationFailedDataSchema>\n\nexport const CardTemplateInvalidColumnsDataSchema = z.object({\n notebaseColumnIds: z.array(z.string()),\n}).strict()\nexport type CardTemplateInvalidColumnsData = z.infer<typeof CardTemplateInvalidColumnsDataSchema>\n\nexport const PUBLIC_APP_ERROR_DEFS = {\n NOTEBASE_BETA_RESTRICTED: {\n message: \"Notebase is currently in beta for selected accounts\",\n status: 403,\n },\n NOTEBASE_NOT_FOUND: {\n message: \"Notebase not found\",\n status: 404,\n },\n NOTEBASE_COLUMN_NOT_FOUND: {\n message: \"Notebase column not found\",\n status: 404,\n },\n NOTEBASE_ROW_NOT_FOUND: {\n message: \"Notebase row not found\",\n status: 404,\n },\n CARD_NOT_FOUND: {\n message: \"Card not found\",\n status: 404,\n },\n CARD_TEMPLATE_NOT_FOUND: {\n message: \"Card template not found\",\n status: 404,\n },\n CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS: {\n data: CardTemplateInvalidColumnsDataSchema,\n message: \"Card template references unknown notebase columns\",\n status: 422,\n },\n CARD_TEMPLATE_NOTEBASE_COLUMN_IN_USE: {\n message: \"Notebase column is used by a card template\",\n status: 409,\n },\n NOTE_LIMIT_EXCEEDED: {\n message: \"Upgrade is required to create more Notebase notes\",\n status: 403,\n },\n BILLING_NOT_CONFIGURED: {\n message: \"Billing is not configured\",\n status: 503,\n },\n BILLING_CUSTOMER_NOT_FOUND: {\n message: \"Billing customer not found\",\n status: 404,\n },\n CARD_NOT_REVIEWABLE: {\n message: \"Card cannot be reviewed in its current state\",\n status: 409,\n },\n CARD_REVIEW_STATE_STALE: {\n message: \"Card review state is stale\",\n status: 409,\n },\n CARD_REVIEW_ROLLBACK_UNAVAILABLE: {\n message: \"Card review cannot be rolled back\",\n status: 409,\n },\n CARD_ALREADY_BURIED: {\n message: \"Card is already buried\",\n status: 409,\n },\n CARD_NOT_BURIED: {\n message: \"Card is not buried\",\n status: 409,\n },\n CARD_ALREADY_SUSPENDED: {\n message: \"Card is already suspended\",\n status: 409,\n },\n CARD_NOT_SUSPENDED: {\n message: \"Card is not suspended\",\n status: 409,\n },\n CARD_STATUS_CHANGE_UNAVAILABLE: {\n message: \"Card status change is unavailable\",\n status: 409,\n },\n NOTEBASE_VIEW_NOT_FOUND: {\n message: \"Notebase view not found\",\n status: 404,\n },\n CELL_VALIDATION_FAILED: {\n data: CellValidationFailedDataSchema,\n message: \"Cell validation failed\",\n status: 422,\n },\n PRIMARY_NOTEBASE_COLUMN_DELETE_NOT_ALLOWED: {\n message: \"Cannot delete primary notebase column\",\n status: 400,\n },\n CONCURRENT_POSITION_CONFLICT: {\n message: \"Concurrent position conflict, please retry\",\n status: 409,\n },\n} as const satisfies Record<string, PublicAppErrorDefinition>\n\nexport type PublicAppErrorCode = keyof typeof PUBLIC_APP_ERROR_DEFS\n\nexport type PublicAppErrorData<TCode extends PublicAppErrorCode>\n = (typeof PUBLIC_APP_ERROR_DEFS)[TCode] extends { data: infer TSchema extends z.ZodTypeAny }\n ? z.output<TSchema>\n : undefined\n\nexport function isPublicAppErrorCode(code: string | undefined): code is PublicAppErrorCode {\n return code !== undefined && code in PUBLIC_APP_ERROR_DEFS\n}\n\nexport function getPublicErrorDefinition<TCode extends PublicAppErrorCode>(code: TCode) {\n return PUBLIC_APP_ERROR_DEFS[code]\n}\n\nexport function pickPublicErrorMap<const TCodes extends readonly PublicAppErrorCode[]>(\n ...codes: TCodes\n) {\n return Object.fromEntries(codes.map((code) => {\n const definition = PUBLIC_APP_ERROR_DEFS[code]\n\n if (\"data\" in definition) {\n return [code, {\n data: definition.data,\n message: definition.message,\n status: definition.status,\n }]\n }\n\n return [code, {\n message: definition.message,\n status: definition.status,\n }]\n })) as Pick<ErrorMap, TCodes[number]>\n}\n","import { z } from \"zod\"\n\nexport const billingIntervalSchema = z.enum([\"month\", \"year\"])\nexport type BillingInterval = z.infer<typeof billingIntervalSchema>\n\nexport const billingSubscriptionStatusSchema = z.enum([\n \"incomplete\",\n \"incomplete_expired\",\n \"trialing\",\n \"active\",\n \"past_due\",\n \"canceled\",\n \"unpaid\",\n \"paused\",\n])\nexport type BillingSubscriptionStatus = z.infer<typeof billingSubscriptionStatusSchema>\n\nexport const billingPlanSchema = z.enum([\"free\", \"pro\"])\nexport type BillingPlan = z.infer<typeof billingPlanSchema>\n\nexport const billingStatusSchema = z.object({\n plan: billingPlanSchema,\n status: billingSubscriptionStatusSchema.nullable(),\n interval: billingIntervalSchema.nullable(),\n currentPeriodEnd: z.coerce.date().nullable(),\n cancelAtPeriodEnd: z.boolean(),\n unlimitedNotebaseNotes: z.boolean(),\n notebaseNoteLimit: z.number().int().positive(),\n notebaseNoteCount: z.number().int().min(0),\n}).strict()\nexport type BillingStatus = z.infer<typeof billingStatusSchema>\n\nexport const billingCreateCheckoutSessionInputSchema = z.object({\n interval: billingIntervalSchema,\n}).strict()\nexport type BillingCreateCheckoutSessionInput = z.infer<typeof billingCreateCheckoutSessionInputSchema>\n\nexport const billingSessionUrlOutputSchema = z.object({\n url: z.url(),\n}).strict()\nexport type BillingSessionUrlOutput = z.infer<typeof billingSessionUrlOutputSchema>\n","import { oc } from \"@orpc/contract\"\nimport { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n billingCreateCheckoutSessionInputSchema,\n billingSessionUrlOutputSchema,\n billingStatusSchema,\n} from \"#/schemas/billing\"\n\nconst billingProcedure = oc.errors(\n pickPublicErrorMap(\"BILLING_NOT_CONFIGURED\", \"BILLING_CUSTOMER_NOT_FOUND\"),\n)\n\nexport const billingContract = {\n status: billingProcedure\n .route({\n method: \"GET\",\n path: \"/billing/status\",\n summary: \"Get authenticated user's billing status\",\n tags: [\"Billing\"],\n })\n .output(billingStatusSchema),\n createCheckoutSession: billingProcedure\n .route({\n method: \"POST\",\n path: \"/billing/checkout-sessions\",\n summary: \"Create a Stripe Checkout Session for a subscription\",\n tags: [\"Billing\"],\n })\n .input(billingCreateCheckoutSessionInputSchema)\n .output(billingSessionUrlOutputSchema),\n createCustomerPortalSession: billingProcedure\n .route({\n method: \"POST\",\n path: \"/billing/customer-portal-sessions\",\n summary: \"Create a Stripe Customer Portal Session\",\n tags: [\"Billing\"],\n })\n .output(billingSessionUrlOutputSchema),\n}\n","import {\n cardIdentityShape,\n cardMemoryStateShape,\n cardStateSchema,\n cardTemplateConfigSchema,\n scheduleStatusSchema,\n} from \"@read-frog/definitions\"\nimport { z } from \"zod\"\n\nexport {\n cardStateSchema,\n scheduleStatusSchema,\n}\nexport type { CardState, ScheduleStatus } from \"@read-frog/definitions\"\n\nexport const cardTemplateSchema = z.object({\n id: z.uuid(),\n notebaseId: z.uuid(),\n name: z.string(),\n config: cardTemplateConfigSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type CardTemplate = z.infer<typeof cardTemplateSchema>\n\nexport const CardTemplateListInputSchema = z.object({\n notebaseId: z.uuid(),\n})\nexport type CardTemplateListInput = z.infer<typeof CardTemplateListInputSchema>\n\nexport const CardTemplateListOutputSchema = z.array(cardTemplateSchema)\nexport type CardTemplateListOutput = z.infer<typeof CardTemplateListOutputSchema>\n\nexport const CardTemplateGetInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CardTemplateGetInput = z.infer<typeof CardTemplateGetInputSchema>\n\nexport const CardTemplateGetOutputSchema = cardTemplateSchema\nexport type CardTemplateGetOutput = z.infer<typeof CardTemplateGetOutputSchema>\n\nexport const CardTemplateCreateInputSchema = z.object({\n id: z.uuid().optional(),\n notebaseId: z.uuid(),\n name: z.string().min(1),\n config: cardTemplateConfigSchema,\n}).strict()\nexport type CardTemplateCreateInput = z.infer<typeof CardTemplateCreateInputSchema>\n\nexport const CardTemplateCreateOutputSchema = cardTemplateSchema.extend({\n txid: z.number(),\n})\nexport type CardTemplateCreateOutput = z.infer<typeof CardTemplateCreateOutputSchema>\n\nexport const CardTemplateUpdateInputSchema = z.object({\n id: z.uuid(),\n name: z.string().min(1).optional(),\n config: cardTemplateConfigSchema.optional(),\n}).strict()\nexport type CardTemplateUpdateInput = z.infer<typeof CardTemplateUpdateInputSchema>\n\nexport const CardTemplateUpdateOutputSchema = cardTemplateSchema.extend({\n txid: z.number(),\n})\nexport type CardTemplateUpdateOutput = z.infer<typeof CardTemplateUpdateOutputSchema>\n\nexport const CardTemplateDeleteInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CardTemplateDeleteInput = z.infer<typeof CardTemplateDeleteInputSchema>\n\nexport const CardTemplateDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type CardTemplateDeleteOutput = z.infer<typeof CardTemplateDeleteOutputSchema>\n\nexport const cardSchema = z.object({\n ...cardIdentityShape,\n ...cardMemoryStateShape,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type Card = z.infer<typeof cardSchema>\n\nexport const renderedCardSchema = cardSchema.extend({\n front: z.string(),\n back: z.string(),\n})\nexport type RenderedCard = z.infer<typeof renderedCardSchema>\n\nexport const CardListInputSchema = z.object({\n notebaseId: z.uuid(),\n templateId: z.uuid().optional(),\n limit: z.number().int().min(1).max(500).optional(),\n offset: z.number().int().min(0).optional(),\n})\nexport type CardListInput = z.infer<typeof CardListInputSchema>\n\nexport const CardListOutputSchema = z.array(renderedCardSchema)\nexport type CardListOutput = z.infer<typeof CardListOutputSchema>\n\nexport const CardGetInputSchema = z.object({\n id: z.uuid(),\n})\nexport type CardGetInput = z.infer<typeof CardGetInputSchema>\n\nexport const CardGetOutputSchema = renderedCardSchema\nexport type CardGetOutput = z.infer<typeof CardGetOutputSchema>\n\nexport const CardGenerateInputSchema = z.object({\n notebaseId: z.uuid(),\n templateId: z.uuid().optional(),\n})\nexport type CardGenerateInput = z.infer<typeof CardGenerateInputSchema>\n\nexport const CardGenerateOutputSchema = z.object({\n created: z.number().int().min(0),\n txid: z.number(),\n})\nexport type CardGenerateOutput = z.infer<typeof CardGenerateOutputSchema>\n","import { oc } from \"@orpc/contract\"\n\nexport const notebaseProcedure = oc\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n CardGenerateInputSchema,\n CardGenerateOutputSchema,\n CardGetInputSchema,\n CardGetOutputSchema,\n CardListInputSchema,\n CardListOutputSchema,\n} from \"#/schemas/card\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const cardContract = {\n list: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/cards\",\n summary: \"List rendered cards\",\n tags: [\"Cards\"],\n })\n .input(CardListInputSchema)\n .output(CardListOutputSchema),\n\n get: notebaseProcedure\n .errors(pickPublicErrorMap(\"CARD_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/cards/{id}\",\n summary: \"Get rendered card\",\n tags: [\"Cards\"],\n })\n .input(CardGetInputSchema)\n .output(CardGetOutputSchema),\n\n generate: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CARD_TEMPLATE_NOT_FOUND\"))\n .route({\n method: \"POST\",\n path: \"/cards/generate\",\n summary: \"Generate missing cards\",\n tags: [\"Cards\"],\n })\n .input(CardGenerateInputSchema)\n .output(CardGenerateOutputSchema),\n}\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n CardTemplateCreateInputSchema,\n CardTemplateCreateOutputSchema,\n CardTemplateDeleteInputSchema,\n CardTemplateDeleteOutputSchema,\n CardTemplateGetInputSchema,\n CardTemplateGetOutputSchema,\n CardTemplateListInputSchema,\n CardTemplateListOutputSchema,\n CardTemplateUpdateInputSchema,\n CardTemplateUpdateOutputSchema,\n} from \"#/schemas/card\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const cardTemplateContract = {\n list: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/card-templates\",\n summary: \"List card templates\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateListInputSchema)\n .output(CardTemplateListOutputSchema),\n\n get: notebaseProcedure\n .errors(pickPublicErrorMap(\"CARD_TEMPLATE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/card-templates/{id}\",\n summary: \"Get card template\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateGetInputSchema)\n .output(CardTemplateGetOutputSchema),\n\n create: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS\"))\n .route({\n method: \"POST\",\n path: \"/card-templates\",\n summary: \"Create card template\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateCreateInputSchema)\n .output(CardTemplateCreateOutputSchema),\n\n update: notebaseProcedure\n .errors(pickPublicErrorMap(\"CARD_TEMPLATE_NOT_FOUND\", \"CARD_TEMPLATE_INVALID_NOTEBASE_COLUMNS\"))\n .route({\n method: \"PATCH\",\n path: \"/card-templates/{id}\",\n summary: \"Update card template\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateUpdateInputSchema)\n .output(CardTemplateUpdateOutputSchema),\n\n delete: notebaseProcedure\n .errors(pickPublicErrorMap(\"CARD_TEMPLATE_NOT_FOUND\"))\n .route({\n method: \"DELETE\",\n path: \"/card-templates/{id}\",\n summary: \"Delete card template\",\n tags: [\"Card Templates\"],\n })\n .input(CardTemplateDeleteInputSchema)\n .output(CardTemplateDeleteOutputSchema),\n}\n","import type { RefinementCtx } from \"zod\"\nimport { z } from \"zod\"\n\nconst HOSTED_AI_SYSTEM_FALLBACK_REMOVAL_DATE = \"2026-07-11\"\n\nexport const HostedAiOutputFieldTypeSchema = z.enum([\"string\", \"number\"])\n\nexport const HostedAiOutputFieldSchema = z.strictObject({\n name: z.string().trim().min(1).max(80),\n type: HostedAiOutputFieldTypeSchema,\n})\n\nconst HostedAiInstructionsSchema = z.string().trim().min(1).max(16000)\n\ninterface HostedAiInstructionsCompatibilityInput {\n instructions?: string\n system?: string\n}\n\nfunction validateHostedAiInstructionsCompatibility(\n input: HostedAiInstructionsCompatibilityInput,\n ctx: RefinementCtx<HostedAiInstructionsCompatibilityInput>,\n): void {\n if (input.instructions !== undefined || input.system !== undefined) {\n return\n }\n\n ctx.addIssue({\n code: \"custom\",\n message: `instructions is required. The deprecated system field is accepted as a temporary fallback until ${HOSTED_AI_SYSTEM_FALLBACK_REMOVAL_DATE}.`,\n path: [\"instructions\"],\n })\n}\n\nexport const HostedAiStreamTextInputSchema = z.strictObject({\n instructions: HostedAiInstructionsSchema.optional(),\n system: HostedAiInstructionsSchema.optional(),\n prompt: z.string().trim().min(1).max(32000),\n temperature: z.number().min(0).max(2).optional(),\n}).superRefine(validateHostedAiInstructionsCompatibility)\n\nexport const HostedAiStreamStructuredObjectInputSchema = z.strictObject({\n instructions: HostedAiInstructionsSchema.optional(),\n system: HostedAiInstructionsSchema.optional(),\n prompt: z.string().trim().min(1).max(32000),\n outputSchema: z.array(HostedAiOutputFieldSchema).min(1).max(32),\n temperature: z.number().min(0).max(2).optional(),\n}).superRefine((input, ctx) => {\n validateHostedAiInstructionsCompatibility(input, ctx)\n\n const fieldNames = new Set<string>()\n\n input.outputSchema.forEach((field, index) => {\n if (fieldNames.has(field.name)) {\n ctx.addIssue({\n code: \"custom\",\n message: `Duplicate output schema name \"${field.name}\".`,\n path: [\"outputSchema\", index, \"name\"],\n })\n return\n }\n\n fieldNames.add(field.name)\n })\n})\n\nexport const HostedAiStreamPartSchema = z.looseObject({\n type: z.string().trim().min(1),\n})\n\nexport type HostedAiOutputFieldType = z.infer<typeof HostedAiOutputFieldTypeSchema>\nexport type HostedAiOutputField = z.infer<typeof HostedAiOutputFieldSchema>\nexport type HostedAiStreamTextInput = z.infer<typeof HostedAiStreamTextInputSchema>\nexport type HostedAiStreamStructuredObjectInput = z.infer<typeof HostedAiStreamStructuredObjectInputSchema>\nexport type HostedAiStreamPart = z.infer<typeof HostedAiStreamPartSchema>\n","import { eventIterator, oc } from \"@orpc/contract\"\nimport {\n HostedAiStreamPartSchema,\n HostedAiStreamStructuredObjectInputSchema,\n HostedAiStreamTextInputSchema,\n} from \"#/schemas/hosted-ai\"\n\nexport const hostedAiContract = {\n translate: {\n streamText: oc\n .route({\n method: \"POST\",\n path: \"/hosted-ai/translate/stream-text\",\n summary: \"Stream hosted translation text output\",\n tags: [\"Hosted AI\"],\n })\n .input(HostedAiStreamTextInputSchema)\n .output(eventIterator(HostedAiStreamPartSchema)),\n },\n customAction: {\n streamStructuredObject: oc\n .route({\n method: \"POST\",\n path: \"/hosted-ai/custom-actions/stream-structured-object\",\n summary: \"Stream hosted custom action structured output\",\n tags: [\"Hosted AI\"],\n })\n .input(HostedAiStreamStructuredObjectInputSchema)\n .output(eventIterator(HostedAiStreamPartSchema)),\n },\n}\n","import { NOTEBASE_COLUMN_MAX_WIDTH, NOTEBASE_COLUMN_MIN_WIDTH, notebaseColumnConfigSchema } from \"@read-frog/definitions\"\nimport { z } from \"zod\"\n\nexport const notebaseColumnWidthSchema = z.number().int().min(NOTEBASE_COLUMN_MIN_WIDTH).max(NOTEBASE_COLUMN_MAX_WIDTH)\n\nexport const notebaseColumnSchema = z.object({\n id: z.string(),\n notebaseId: z.string(),\n name: z.string(),\n config: notebaseColumnConfigSchema,\n position: z.number(),\n isPrimary: z.boolean(),\n width: z.number().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type NotebaseColumn = z.infer<typeof notebaseColumnSchema>\n\nexport const notebaseColumnCreateDataSchema = z.object({\n id: z.uuid().optional(),\n name: z.string().min(1),\n config: notebaseColumnConfigSchema,\n}).strict()\nexport type NotebaseColumnCreateData = z.infer<typeof notebaseColumnCreateDataSchema>\n\nexport const notebaseColumnUpdateDataSchema = z.object({\n name: z.string().min(1).optional(),\n config: notebaseColumnConfigSchema.optional(),\n width: notebaseColumnWidthSchema.nullable().optional(),\n}).strict()\nexport type NotebaseColumnUpdateData = z.infer<typeof notebaseColumnUpdateDataSchema>\n\nexport const NotebaseColumnCreateInputSchema = z.object({\n notebaseId: z.uuid(),\n data: notebaseColumnCreateDataSchema,\n})\nexport type NotebaseColumnCreateInput = z.infer<typeof NotebaseColumnCreateInputSchema>\n\nexport const NotebaseColumnCreateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseColumnCreateOutput = z.infer<typeof NotebaseColumnCreateOutputSchema>\n\nexport const NotebaseColumnUpdateInputSchema = z.object({\n notebaseColumnId: z.uuid(),\n data: notebaseColumnUpdateDataSchema,\n})\nexport type NotebaseColumnUpdateInput = z.infer<typeof NotebaseColumnUpdateInputSchema>\n\nexport const NotebaseColumnUpdateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseColumnUpdateOutput = z.infer<typeof NotebaseColumnUpdateOutputSchema>\n\nexport const NotebaseColumnDeleteInputSchema = z.object({\n notebaseColumnId: z.uuid(),\n})\nexport type NotebaseColumnDeleteInput = z.infer<typeof NotebaseColumnDeleteInputSchema>\n\nexport const NotebaseColumnDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseColumnDeleteOutput = z.infer<typeof NotebaseColumnDeleteOutputSchema>\n\nexport const NotebaseColumnReorderInputSchema = z.object({\n notebaseId: z.uuid(),\n ids: z.array(z.uuid()),\n})\nexport type NotebaseColumnReorderInput = z.infer<typeof NotebaseColumnReorderInputSchema>\n\nexport const NotebaseColumnReorderOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseColumnReorderOutput = z.infer<typeof NotebaseColumnReorderOutputSchema>\n","import { z } from \"zod\"\n\nexport const notebaseRowCellsSchema = z.record(z.string(), z.unknown())\n\nexport const notebaseRowSchema = z.object({\n id: z.string(),\n notebaseId: z.string(),\n cells: notebaseRowCellsSchema,\n position: z.number(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type NotebaseRow = z.infer<typeof notebaseRowSchema>\n\nexport const notebaseRowCreateDataSchema = z.object({\n id: z.uuid().optional(),\n cells: notebaseRowCellsSchema.optional(),\n}).strict()\nexport type NotebaseRowCreateData = z.infer<typeof notebaseRowCreateDataSchema>\n\nexport const notebaseRowUpdateDataSchema = z.object({\n cells: notebaseRowCellsSchema.optional(),\n}).strict()\nexport type NotebaseRowUpdateData = z.infer<typeof notebaseRowUpdateDataSchema>\n\nexport const NotebaseRowCreateInputSchema = z.object({\n notebaseId: z.uuid(),\n data: notebaseRowCreateDataSchema,\n})\nexport type NotebaseRowCreateInput = z.infer<typeof NotebaseRowCreateInputSchema>\n\nexport const NotebaseRowCreateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseRowCreateOutput = z.infer<typeof NotebaseRowCreateOutputSchema>\n\nexport const NotebaseRowUpdateInputSchema = z.object({\n notebaseRowId: z.uuid(),\n data: notebaseRowUpdateDataSchema,\n})\nexport type NotebaseRowUpdateInput = z.infer<typeof NotebaseRowUpdateInputSchema>\n\nexport const NotebaseRowUpdateOutputSchema = z.object({\n id: z.uuid(),\n notebaseId: z.uuid(),\n cells: notebaseRowCellsSchema,\n position: z.number().int(),\n createdAt: z.date(),\n updatedAt: z.date(),\n txid: z.number(),\n})\nexport type NotebaseRowUpdateOutput = z.infer<typeof NotebaseRowUpdateOutputSchema>\n\nexport const NotebaseRowDeleteInputSchema = z.object({\n notebaseRowId: z.uuid(),\n})\nexport type NotebaseRowDeleteInput = z.infer<typeof NotebaseRowDeleteInputSchema>\n\nexport const NotebaseRowDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseRowDeleteOutput = z.infer<typeof NotebaseRowDeleteOutputSchema>\n\nexport const NotebaseRowReorderInputSchema = z.object({\n notebaseId: z.uuid(),\n ids: z.array(z.uuid()),\n})\nexport type NotebaseRowReorderInput = z.infer<typeof NotebaseRowReorderInputSchema>\n\nexport const NotebaseRowReorderOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseRowReorderOutput = z.infer<typeof NotebaseRowReorderOutputSchema>\n","import { z } from \"zod\"\n\nexport const notebaseViewTypeSchema = z.enum([\"table\", \"kanban\", \"gallery\"])\nexport type NotebaseViewType = z.infer<typeof notebaseViewTypeSchema>\n\nexport const notebaseViewConfigSchema = z.object({\n notebaseColumnWidths: z.record(z.string(), z.number()).optional(),\n hiddenNotebaseColumns: z.array(z.string()).optional(),\n groupByNotebaseColumnId: z.string().optional(),\n}).catchall(z.unknown())\nexport type NotebaseViewConfig = z.infer<typeof notebaseViewConfigSchema>\n\nexport const notebaseViewFilterSchema = z.object({\n notebaseColumnId: z.string(),\n operator: z.string(),\n value: z.unknown(),\n}).strict()\nexport type NotebaseViewFilter = z.infer<typeof notebaseViewFilterSchema>\n\nexport const notebaseViewFiltersSchema = z.array(notebaseViewFilterSchema)\n\nexport const notebaseViewSortSchema = z.object({\n notebaseColumnId: z.string(),\n direction: z.enum([\"asc\", \"desc\"]),\n}).strict()\nexport type NotebaseViewSort = z.infer<typeof notebaseViewSortSchema>\n\nexport const notebaseViewSortsSchema = z.array(notebaseViewSortSchema)\n\nexport const notebaseViewCreateDataSchema = z.object({\n id: z.uuid().optional(),\n name: z.string().min(1),\n type: notebaseViewTypeSchema,\n config: notebaseViewConfigSchema.optional(),\n filters: notebaseViewFiltersSchema.optional(),\n sorts: notebaseViewSortsSchema.optional(),\n}).strict()\nexport type NotebaseViewCreateData = z.infer<typeof notebaseViewCreateDataSchema>\n\nexport const notebaseViewUpdateDataSchema = z.object({\n name: z.string().min(1).optional(),\n type: notebaseViewTypeSchema.optional(),\n config: notebaseViewConfigSchema.optional(),\n filters: notebaseViewFiltersSchema.optional(),\n sorts: notebaseViewSortsSchema.optional(),\n}).strict()\nexport type NotebaseViewUpdateData = z.infer<typeof notebaseViewUpdateDataSchema>\n\nexport const notebaseViewSchema = z.object({\n id: z.string(),\n notebaseId: z.string(),\n name: z.string(),\n type: notebaseViewTypeSchema,\n config: notebaseViewConfigSchema.nullable(),\n filters: z.array(z.unknown()).nullable(),\n sorts: z.array(z.unknown()).nullable(),\n position: z.number(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n})\nexport type NotebaseView = z.infer<typeof notebaseViewSchema>\n","import { notebaseColumnConfigSchema, schedulingParamsShape, srsWeightsSchema } from \"@read-frog/definitions\"\nimport { z } from \"zod\"\nimport { notebaseColumnSchema } from \"./notebase-column\"\nimport { notebaseRowSchema } from \"./notebase-row\"\nimport { notebaseViewSchema } from \"./notebase-view\"\n\nexport const NotebaseListInputSchema = z.object({})\nexport type NotebaseListInput = z.infer<typeof NotebaseListInputSchema>\n\nexport const NotebaseListItemSchema = z.object({\n id: z.string(),\n name: z.string(),\n})\nexport type NotebaseListItem = z.infer<typeof NotebaseListItemSchema>\n\nexport const NotebaseListOutputSchema = z.array(NotebaseListItemSchema)\nexport type NotebaseListOutput = z.infer<typeof NotebaseListOutputSchema>\n\nexport const notebaseSchema = z.object({\n id: z.string(),\n userId: z.string(),\n name: z.string(),\n srsNewPerDay: schedulingParamsShape.newPerDay,\n srsReviewsPerDay: schedulingParamsShape.reviewsPerDay,\n srsDesiredRetention: schedulingParamsShape.desiredRetention,\n srsEnableShortTerm: schedulingParamsShape.enableShortTerm,\n srsMaximumInterval: schedulingParamsShape.maximumInterval,\n srsLearningSteps: schedulingParamsShape.learningSteps,\n srsRelearningSteps: schedulingParamsShape.relearningSteps,\n srsLeechThreshold: schedulingParamsShape.leechThreshold,\n srsEnableFuzz: schedulingParamsShape.enableFuzz,\n srsWeights: srsWeightsSchema.nullable(),\n createdAt: z.date(),\n updatedAt: z.date(),\n})\nexport type Notebase = z.infer<typeof notebaseSchema>\n\nexport const notebaseCreateDataSchema = z.object({\n id: z.uuid().optional(),\n name: z.string().min(1),\n options: z.object({\n initialColumns: z.array(z.object({\n id: z.uuid(),\n name: z.string().min(1),\n config: notebaseColumnConfigSchema,\n }).strict()).min(1),\n initialRow: z.object({\n id: z.uuid().optional(),\n cells: z.record(z.string(), z.unknown()),\n }).strict().optional(),\n }).strict().optional(),\n}).strict()\nexport type NotebaseCreateData = z.infer<typeof notebaseCreateDataSchema>\n\nexport const NotebaseCreateInputSchema = notebaseCreateDataSchema\nexport type NotebaseCreateInput = z.infer<typeof NotebaseCreateInputSchema>\n\nexport const NotebaseCreateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseCreateOutput = z.infer<typeof NotebaseCreateOutputSchema>\n\nexport const notebaseUpdateDataSchema = z.object({\n name: z.string().min(1).optional(),\n srsNewPerDay: schedulingParamsShape.newPerDay.optional(),\n srsReviewsPerDay: schedulingParamsShape.reviewsPerDay.optional(),\n}).strict()\nexport type NotebaseUpdateData = z.infer<typeof notebaseUpdateDataSchema>\n\nexport const NotebaseUpdateInputSchema = notebaseUpdateDataSchema.extend({\n id: z.uuid(),\n})\nexport type NotebaseUpdateInput = z.infer<typeof NotebaseUpdateInputSchema>\n\nexport const NotebaseUpdateOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseUpdateOutput = z.infer<typeof NotebaseUpdateOutputSchema>\n\nexport const NotebaseDeleteInputSchema = z.object({\n id: z.uuid(),\n})\nexport type NotebaseDeleteInput = z.infer<typeof NotebaseDeleteInputSchema>\n\nexport const NotebaseDeleteOutputSchema = z.object({\n txid: z.number(),\n})\nexport type NotebaseDeleteOutput = z.infer<typeof NotebaseDeleteOutputSchema>\n\n// Get endpoint schemas\nexport const NotebaseGetInputSchema = z.object({\n id: z.uuid(),\n})\nexport type NotebaseGetInput = z.infer<typeof NotebaseGetInputSchema>\n\nexport const NotebaseGetSchemaInputSchema = z.object({\n id: z.uuid(),\n})\nexport type NotebaseGetSchemaInput = z.infer<typeof NotebaseGetSchemaInputSchema>\n\nexport const NotebaseGetOutputSchema = notebaseSchema.extend({\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n notebaseColumns: z.array(notebaseColumnSchema),\n notebaseRows: z.array(notebaseRowSchema),\n notebaseViews: z.array(notebaseViewSchema),\n})\nexport type NotebaseGetOutput = z.infer<typeof NotebaseGetOutputSchema>\n\nexport const NotebaseGetSchemaOutputSchema = z.object({\n id: z.string(),\n name: z.string(),\n updatedAt: z.coerce.date(),\n notebaseColumns: z.array(notebaseColumnSchema),\n})\nexport type NotebaseGetSchemaOutput = z.infer<typeof NotebaseGetSchemaOutputSchema>\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n NotebaseCreateInputSchema,\n NotebaseCreateOutputSchema,\n NotebaseDeleteInputSchema,\n NotebaseDeleteOutputSchema,\n NotebaseGetInputSchema,\n NotebaseGetOutputSchema,\n NotebaseGetSchemaInputSchema,\n NotebaseGetSchemaOutputSchema,\n NotebaseListInputSchema,\n NotebaseListOutputSchema,\n NotebaseUpdateInputSchema,\n NotebaseUpdateOutputSchema,\n} from \"#/schemas/notebase\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const notebaseContract = {\n list: notebaseProcedure\n .route({\n method: \"GET\",\n path: \"/notebases\",\n summary: \"List notebases\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseListInputSchema)\n .output(NotebaseListOutputSchema),\n\n get: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/notebases/{id}\",\n summary: \"Get notebase with notebase columns, rows, and views\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseGetInputSchema)\n .output(NotebaseGetOutputSchema),\n\n getSchema: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/notebases/{id}/schema\",\n summary: \"Get notebase schema\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseGetSchemaInputSchema)\n .output(NotebaseGetSchemaOutputSchema),\n\n create: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTE_LIMIT_EXCEEDED\"))\n .route({\n method: \"POST\",\n path: \"/notebases\",\n summary: \"Create notebase\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseCreateInputSchema)\n .output(NotebaseCreateOutputSchema),\n\n update: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"PUT\",\n path: \"/notebases/{id}\",\n summary: \"Update notebase\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseUpdateInputSchema)\n .output(NotebaseUpdateOutputSchema),\n\n delete: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"DELETE\",\n path: \"/notebases/{id}\",\n summary: \"Delete notebase\",\n tags: [\"Notebases\"],\n })\n .input(NotebaseDeleteInputSchema)\n .output(NotebaseDeleteOutputSchema),\n}\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n NotebaseColumnCreateInputSchema,\n NotebaseColumnCreateOutputSchema,\n NotebaseColumnDeleteInputSchema,\n NotebaseColumnDeleteOutputSchema,\n NotebaseColumnReorderInputSchema,\n NotebaseColumnReorderOutputSchema,\n NotebaseColumnUpdateInputSchema,\n NotebaseColumnUpdateOutputSchema,\n} from \"#/schemas/notebase-column\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const notebaseColumnContract = {\n create: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CONCURRENT_POSITION_CONFLICT\"))\n .route({\n method: \"POST\",\n path: \"/notebase-columns\",\n summary: \"Create notebase column\",\n tags: [\"Notebase Columns\"],\n })\n .input(NotebaseColumnCreateInputSchema)\n .output(NotebaseColumnCreateOutputSchema),\n\n update: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_COLUMN_NOT_FOUND\"))\n .route({\n method: \"PATCH\",\n path: \"/notebase-columns/{notebaseColumnId}\",\n summary: \"Update notebase column\",\n tags: [\"Notebase Columns\"],\n })\n .input(NotebaseColumnUpdateInputSchema)\n .output(NotebaseColumnUpdateOutputSchema),\n\n delete: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"NOTEBASE_COLUMN_NOT_FOUND\",\n \"PRIMARY_NOTEBASE_COLUMN_DELETE_NOT_ALLOWED\",\n \"CARD_TEMPLATE_NOTEBASE_COLUMN_IN_USE\",\n \"CONCURRENT_POSITION_CONFLICT\",\n ))\n .route({\n method: \"DELETE\",\n path: \"/notebase-columns/{notebaseColumnId}\",\n summary: \"Delete notebase column\",\n tags: [\"Notebase Columns\"],\n })\n .input(NotebaseColumnDeleteInputSchema)\n .output(NotebaseColumnDeleteOutputSchema),\n\n reorder: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CONCURRENT_POSITION_CONFLICT\"))\n .route({\n method: \"POST\",\n path: \"/notebase-columns/reorder\",\n summary: \"Reorder notebase columns\",\n tags: [\"Notebase Columns\"],\n })\n .input(NotebaseColumnReorderInputSchema)\n .output(NotebaseColumnReorderOutputSchema),\n}\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n NotebaseRowCreateInputSchema,\n NotebaseRowCreateOutputSchema,\n NotebaseRowDeleteInputSchema,\n NotebaseRowDeleteOutputSchema,\n NotebaseRowReorderInputSchema,\n NotebaseRowReorderOutputSchema,\n NotebaseRowUpdateInputSchema,\n NotebaseRowUpdateOutputSchema,\n} from \"#/schemas/notebase-row\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const notebaseRowContract = {\n create: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"NOTEBASE_NOT_FOUND\",\n \"CELL_VALIDATION_FAILED\",\n \"CONCURRENT_POSITION_CONFLICT\",\n \"NOTE_LIMIT_EXCEEDED\",\n ))\n .route({\n method: \"POST\",\n path: \"/notebase-rows\",\n summary: \"Create notebase row\",\n tags: [\"Notebase Rows\"],\n })\n .input(NotebaseRowCreateInputSchema)\n .output(NotebaseRowCreateOutputSchema),\n\n update: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_ROW_NOT_FOUND\", \"CELL_VALIDATION_FAILED\"))\n .route({\n method: \"PATCH\",\n path: \"/notebase-rows/{notebaseRowId}\",\n summary: \"Update notebase row cells\",\n tags: [\"Notebase Rows\"],\n })\n .input(NotebaseRowUpdateInputSchema)\n .output(NotebaseRowUpdateOutputSchema),\n\n delete: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_ROW_NOT_FOUND\", \"CONCURRENT_POSITION_CONFLICT\"))\n .route({\n method: \"DELETE\",\n path: \"/notebase-rows/{notebaseRowId}\",\n summary: \"Delete notebase row\",\n tags: [\"Notebase Rows\"],\n })\n .input(NotebaseRowDeleteInputSchema)\n .output(NotebaseRowDeleteOutputSchema),\n\n reorder: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\", \"CONCURRENT_POSITION_CONFLICT\"))\n .route({\n method: \"POST\",\n path: \"/notebase-rows/reorder\",\n summary: \"Reorder notebase rows\",\n tags: [\"Notebase Rows\"],\n })\n .input(NotebaseRowReorderInputSchema)\n .output(NotebaseRowReorderOutputSchema),\n}\n","import { z } from \"zod\"\n\n// @ref https://zenn.dev/herp_inc/articles/js-intl-date-time-format-performance\nconst localeTimeZoneFormatter = new Map<string, Intl.DateTimeFormat>()\nfunction createTimezoneFormatter(timezone: string): Intl.DateTimeFormat {\n let formatter = localeTimeZoneFormatter.get(timezone)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(\"en-US\", { timeZone: timezone })\n localeTimeZoneFormatter.set(timezone, formatter)\n }\n return formatter\n}\n\nexport const timezoneSchema = z.string().trim().min(1).refine((timezone) => {\n try {\n createTimezoneFormatter(timezone).format(new Date())\n return true\n }\n catch {\n return false\n }\n}, \"Invalid timezone\")\nexport type Timezone = z.infer<typeof timezoneSchema>\n","import {\n activeScheduleStatusSchema,\n cardStateSchema,\n fsrsReviewLogSnapshotSchema,\n reviewRatingSchema,\n scheduleStatusSchema,\n schedulingParamsSchema,\n SRS_REVIEW_DURATION_MS_MAX,\n srsStepSchema,\n} from \"@read-frog/definitions\"\nimport { z } from \"zod\"\nimport { cardSchema } from \"./card\"\nimport { timezoneSchema } from \"./timezone\"\n\nexport {\n reviewRatingSchema,\n schedulingParamsSchema,\n SRS_REVIEW_DURATION_MS_MAX,\n}\nexport { timezoneSchema } from \"./timezone\"\nexport type { Timezone } from \"./timezone\"\nexport type { ReviewRating, SchedulingParams } from \"@read-frog/definitions\"\n\nexport const stepSchema = srsStepSchema\nexport type Step = z.infer<typeof stepSchema>\n\nexport const SRS_REVIEW_CLIENT_ID_NAMESPACE = \"6ba7b811-9dad-11d1-80b4-00c04fd430c8\"\nconst srsReviewClientIdNamePrefix = \"readfrog:srs-review\"\nconst nullLastReviewTimeSentinel = \"null\"\n\nexport interface SrsReviewClientIdCard {\n id: string\n lastReviewTime: Date | string | null\n}\n\nexport async function createSrsReviewClientId(card: SrsReviewClientIdCard) {\n return uuidV5(\n `${srsReviewClientIdNamePrefix}:${card.id}:${formatLastReviewTime(card.lastReviewTime)}`,\n SRS_REVIEW_CLIENT_ID_NAMESPACE,\n )\n}\n\nexport const srsReviewInputSchema = z.object({\n cardId: z.uuid(),\n id: z.uuid().optional(),\n rating: reviewRatingSchema,\n durationMs: z.number().int().min(0).max(SRS_REVIEW_DURATION_MS_MAX),\n timezone: timezoneSchema,\n}).strict()\nexport type SrsReviewInput = z.infer<typeof srsReviewInputSchema>\n\nexport const srsRollbackReviewInputSchema = z.object({\n cardId: z.uuid(),\n}).strict()\nexport type SrsRollbackReviewInput = z.infer<typeof srsRollbackReviewInputSchema>\n\nexport const srsScheduleStatusStatsSchema = z.record(\n activeScheduleStatusSchema,\n z.number().int().min(0),\n)\nexport type SrsScheduleStatusStats = z.infer<typeof srsScheduleStatusStatsSchema>\n\nexport const srsScheduleStatusStatsInputSchema = z.object({\n notebaseIds: z.array(z.uuid()).optional(),\n timezone: timezoneSchema,\n}).strict()\nexport type SrsScheduleStatusStatsInput = z.infer<typeof srsScheduleStatusStatsInputSchema>\n\nexport const srsScheduleStatusStatsOutputSchema = z.record(\n z.uuid(),\n srsScheduleStatusStatsSchema,\n)\nexport type SrsScheduleStatusStatsOutput = z.infer<typeof srsScheduleStatusStatsOutputSchema>\n\nexport const srsManualCardStatusInputSchema = z.object({\n cardId: z.uuid(),\n enabled: z.boolean(),\n}).strict()\nexport type SrsManualCardStatusInput = z.infer<typeof srsManualCardStatusInputSchema>\n\nexport const srsSetCardBuriedInputSchema = srsManualCardStatusInputSchema\nexport type SrsSetCardBuriedInput = SrsManualCardStatusInput\n\nexport const srsSetCardSuspendedInputSchema = srsManualCardStatusInputSchema\nexport type SrsSetCardSuspendedInput = SrsManualCardStatusInput\n\nexport const srsRevlogSchema = z.object({\n id: z.uuid(),\n notebaseId: z.uuid(),\n cardId: z.uuid(),\n rating: reviewRatingSchema,\n state: cardStateSchema,\n afterScheduleStatus: scheduleStatusSchema,\n reviewedAt: z.coerce.date(),\n durationMs: z.number().int(),\n fsrsReviewLogSnapshot: fsrsReviewLogSnapshotSchema,\n createdAt: z.coerce.date(),\n})\nexport type SrsRevlog = z.infer<typeof srsRevlogSchema>\n\nexport const srsRevlogWithoutSnapshotSchema = srsRevlogSchema.omit({\n fsrsReviewLogSnapshot: true,\n})\nexport type SrsRevlogWithoutSnapshot = z.infer<typeof srsRevlogWithoutSnapshotSchema>\n\nexport const srsReviewOutputSchema = z.object({\n card: cardSchema,\n revlog: srsRevlogSchema,\n txid: z.number(),\n})\nexport type SrsReviewOutput = z.infer<typeof srsReviewOutputSchema>\n\nexport const srsRollbackReviewOutputSchema = z.object({\n card: cardSchema,\n rolledBackRevlogId: z.uuid(),\n txid: z.number(),\n})\nexport type SrsRollbackReviewOutput = z.infer<typeof srsRollbackReviewOutputSchema>\n\nexport const srsTxidOutputSchema = z.object({\n txid: z.number(),\n})\nexport type SrsTxidOutput = z.infer<typeof srsTxidOutputSchema>\n\nexport const srsSetCardBuriedOutputSchema = srsTxidOutputSchema\nexport type SrsSetCardBuriedOutput = SrsTxidOutput\n\nexport const srsSetCardSuspendedOutputSchema = srsTxidOutputSchema\nexport type SrsSetCardSuspendedOutput = SrsTxidOutput\n\nfunction formatLastReviewTime(lastReviewTime: Date | string | null) {\n return lastReviewTime ? new Date(lastReviewTime).toISOString() : nullLastReviewTimeSentinel\n}\n\nasync function uuidV5(name: string, namespace: string) {\n const namespaceBytes = uuidToBytes(namespace)\n const nameBytes = new TextEncoder().encode(name)\n const input = new Uint8Array(namespaceBytes.length + nameBytes.length)\n input.set(namespaceBytes)\n input.set(nameBytes, namespaceBytes.length)\n\n const hash = new Uint8Array(await crypto.subtle.digest(\"SHA-1\", input))\n const bytes = hash.slice(0, 16)\n const versionByte = bytes[6]\n const variantByte = bytes[8]\n if (versionByte === undefined || variantByte === undefined) {\n throw new Error(\"SHA-1 digest was too short\")\n }\n bytes[6] = (versionByte & 0x0F) | 0x50\n bytes[8] = (variantByte & 0x3F) | 0x80\n\n return bytesToUuid(bytes)\n}\n\nfunction uuidToBytes(uuid: string) {\n const hex = uuid.replaceAll(\"-\", \"\").toLowerCase()\n /* v8 ignore next 3 -- SRS_REVIEW_CLIENT_ID_NAMESPACE is a fixed valid UUID. */\n if (!/^[0-9a-f]{32}$/.test(hex)) {\n throw new Error(\"Invalid UUID namespace\")\n }\n\n return new Uint8Array(\n Array.from({ length: 16 }, (_, index) =>\n Number.parseInt(hex.slice(index * 2, index * 2 + 2), 16)),\n )\n}\n\nfunction bytesToUuid(bytes: Uint8Array) {\n const hex = Array.from(bytes, byte => byte.toString(16).padStart(2, \"0\"))\n return [\n hex.slice(0, 4).join(\"\"),\n hex.slice(4, 6).join(\"\"),\n hex.slice(6, 8).join(\"\"),\n hex.slice(8, 10).join(\"\"),\n hex.slice(10, 16).join(\"\"),\n ].join(\"-\")\n}\n","import { pickPublicErrorMap } from \"#/public-errors\"\nimport {\n srsReviewInputSchema,\n srsReviewOutputSchema,\n srsRollbackReviewInputSchema,\n srsRollbackReviewOutputSchema,\n srsScheduleStatusStatsInputSchema,\n srsScheduleStatusStatsOutputSchema,\n srsSetCardBuriedInputSchema,\n srsSetCardBuriedOutputSchema,\n srsSetCardSuspendedInputSchema,\n srsSetCardSuspendedOutputSchema,\n} from \"#/schemas/srs\"\nimport { notebaseProcedure } from \"./shared\"\n\nexport const srsContract = {\n scheduleStatusStats: notebaseProcedure\n .errors(pickPublicErrorMap(\"NOTEBASE_NOT_FOUND\"))\n .route({\n method: \"GET\",\n path: \"/srs/schedule-status-stats\",\n summary: \"List today schedule status stats for notebases\",\n tags: [\"SRS\"],\n })\n .input(srsScheduleStatusStatsInputSchema)\n .output(srsScheduleStatusStatsOutputSchema),\n\n review: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"CARD_NOT_FOUND\",\n \"CARD_NOT_REVIEWABLE\",\n \"CARD_REVIEW_STATE_STALE\",\n ))\n .route({\n method: \"POST\",\n path: \"/srs/review\",\n summary: \"Review a card with SRS scheduling\",\n tags: [\"SRS\"],\n })\n .input(srsReviewInputSchema)\n .output(srsReviewOutputSchema),\n rollbackReview: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"CARD_NOT_FOUND\",\n \"CARD_REVIEW_ROLLBACK_UNAVAILABLE\",\n ))\n .route({\n method: \"POST\",\n path: \"/srs/review/rollback\",\n summary: \"Roll back the latest SRS review for a card\",\n tags: [\"SRS\"],\n })\n .input(srsRollbackReviewInputSchema)\n .output(srsRollbackReviewOutputSchema),\n setCardBuried: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"CARD_NOT_FOUND\",\n \"CARD_ALREADY_BURIED\",\n \"CARD_NOT_BURIED\",\n \"CARD_STATUS_CHANGE_UNAVAILABLE\",\n ))\n .route({\n method: \"POST\",\n path: \"/srs/card/bury\",\n summary: \"Manually bury or unbury a card\",\n tags: [\"SRS\"],\n })\n .input(srsSetCardBuriedInputSchema)\n .output(srsSetCardBuriedOutputSchema),\n setCardSuspended: notebaseProcedure\n .errors(pickPublicErrorMap(\n \"CARD_NOT_FOUND\",\n \"CARD_ALREADY_SUSPENDED\",\n \"CARD_NOT_SUSPENDED\",\n \"CARD_STATUS_CHANGE_UNAVAILABLE\",\n ))\n .route({\n method: \"POST\",\n path: \"/srs/card/suspend\",\n summary: \"Manually suspend or unsuspend a card\",\n tags: [\"SRS\"],\n })\n .input(srsSetCardSuspendedInputSchema)\n .output(srsSetCardSuspendedOutputSchema),\n}\n","import { z } from \"zod\"\nimport { timezoneSchema } from \"./timezone\"\n\nexport const userEnsureTimezoneInputSchema = z.object({\n timezone: timezoneSchema,\n}).strict()\nexport type UserEnsureTimezoneInput = z.infer<typeof userEnsureTimezoneInputSchema>\n\nexport const userEnsureTimezoneOutputSchema = z.object({\n timezone: timezoneSchema,\n updated: z.boolean(),\n}).strict()\nexport type UserEnsureTimezoneOutput = z.infer<typeof userEnsureTimezoneOutputSchema>\n\nexport const userUpdateTimezoneInputSchema = z.object({\n timezone: timezoneSchema,\n}).strict()\nexport type UserUpdateTimezoneInput = z.infer<typeof userUpdateTimezoneInputSchema>\n\nexport const userUpdateTimezoneOutputSchema = z.object({\n timezone: timezoneSchema,\n}).strict()\nexport type UserUpdateTimezoneOutput = z.infer<typeof userUpdateTimezoneOutputSchema>\n","import { oc } from \"@orpc/contract\"\nimport {\n userEnsureTimezoneInputSchema,\n userEnsureTimezoneOutputSchema,\n userUpdateTimezoneInputSchema,\n userUpdateTimezoneOutputSchema,\n} from \"#/schemas/user\"\n\nexport const userContract = {\n ensureTimezone: oc\n .route({\n method: \"POST\",\n path: \"/users/me/timezone/ensure\",\n summary: \"Ensure the authenticated user has a timezone\",\n tags: [\"Users\"],\n })\n .input(userEnsureTimezoneInputSchema)\n .output(userEnsureTimezoneOutputSchema),\n updateTimezone: oc\n .route({\n method: \"PATCH\",\n path: \"/users/me/timezone\",\n summary: \"Update the authenticated user's timezone\",\n tags: [\"Users\"],\n })\n .input(userUpdateTimezoneInputSchema)\n .output(userUpdateTimezoneOutputSchema),\n}\n","import type { ContractRouterClient } from \"@orpc/contract\"\nimport { betaAccessContract } from \"./contracts/beta-access\"\nimport { billingContract } from \"./contracts/billing\"\nimport { cardContract } from \"./contracts/card\"\nimport { cardTemplateContract } from \"./contracts/card-template\"\nimport { hostedAiContract } from \"./contracts/hosted-ai\"\nimport { notebaseContract } from \"./contracts/notebase\"\nimport { notebaseColumnContract } from \"./contracts/notebase-column\"\nimport { notebaseRowContract } from \"./contracts/notebase-row\"\nimport { srsContract } from \"./contracts/srs\"\nimport { userContract } from \"./contracts/user\"\n\nexport const contract = {\n betaAccess: betaAccessContract,\n billing: billingContract,\n card: cardContract,\n cardTemplate: cardTemplateContract,\n hostedAi: hostedAiContract,\n notebase: notebaseContract,\n notebaseColumn: notebaseColumnContract,\n notebaseRow: notebaseRowContract,\n srs: srsContract,\n user: userContract,\n}\n\nexport type ORPCRouterClient = ContractRouterClient<typeof contract>\n\nexport * from \"./public-errors\"\nexport * from \"./schemas/beta-access\"\nexport * from \"./schemas/billing\"\nexport * from \"./schemas/card\"\nexport * from \"./schemas/hosted-ai\"\nexport * from \"./schemas/notebase\"\nexport * from \"./schemas/notebase-column\"\nexport * from \"./schemas/notebase-row\"\nexport * from \"./schemas/notebase-view\"\nexport * from \"./schemas/srs\"\nexport * from \"./schemas/timezone\"\nexport * from \"./schemas/user\"\n"],"mappings":";;;;AAGA,MAAa,uBAAuB,EAAE,KAAK,iBAAiB;AAG5D,MAAa,8BAA8B,EAAE,OAAO,EAClD,YAAY,qBACd,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,+BAA+B,EAAE,OAAO;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;GACT,MAAM,CAAC,OAAO;EAChB,CAAC,CAAC,CACD,MAAM,6BAA6B,CAAC,CACpC,OAAO,8BAA8B;CCJlC;AACR"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@read-frog/api-contract",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.9.0",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
@@ -0,0 +1,39 @@
1
+ import { oc } from "@orpc/contract"
2
+ import { pickPublicErrorMap } from "#/public-errors"
3
+ import {
4
+ billingCreateCheckoutSessionInputSchema,
5
+ billingSessionUrlOutputSchema,
6
+ billingStatusSchema,
7
+ } from "#/schemas/billing"
8
+
9
+ const billingProcedure = oc.errors(
10
+ pickPublicErrorMap("BILLING_NOT_CONFIGURED", "BILLING_CUSTOMER_NOT_FOUND"),
11
+ )
12
+
13
+ export const billingContract = {
14
+ status: billingProcedure
15
+ .route({
16
+ method: "GET",
17
+ path: "/billing/status",
18
+ summary: "Get authenticated user's billing status",
19
+ tags: ["Billing"],
20
+ })
21
+ .output(billingStatusSchema),
22
+ createCheckoutSession: billingProcedure
23
+ .route({
24
+ method: "POST",
25
+ path: "/billing/checkout-sessions",
26
+ summary: "Create a Stripe Checkout Session for a subscription",
27
+ tags: ["Billing"],
28
+ })
29
+ .input(billingCreateCheckoutSessionInputSchema)
30
+ .output(billingSessionUrlOutputSchema),
31
+ createCustomerPortalSession: billingProcedure
32
+ .route({
33
+ method: "POST",
34
+ path: "/billing/customer-portal-sessions",
35
+ summary: "Create a Stripe Customer Portal Session",
36
+ tags: ["Billing"],
37
+ })
38
+ .output(billingSessionUrlOutputSchema),
39
+ }
@@ -17,6 +17,7 @@ export const notebaseRowContract = {
17
17
  "NOTEBASE_NOT_FOUND",
18
18
  "CELL_VALIDATION_FAILED",
19
19
  "CONCURRENT_POSITION_CONFLICT",
20
+ "NOTE_LIMIT_EXCEEDED",
20
21
  ))
21
22
  .route({
22
23
  method: "POST",
@@ -49,6 +49,7 @@ export const notebaseContract = {
49
49
  .output(NotebaseGetSchemaOutputSchema),
50
50
 
51
51
  create: notebaseProcedure
52
+ .errors(pickPublicErrorMap("NOTE_LIMIT_EXCEEDED"))
52
53
  .route({
53
54
  method: "POST",
54
55
  path: "/notebases",
@@ -1,6 +1,3 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { pickPublicErrorMap } from "#/public-errors"
3
2
 
4
- export const notebaseProcedure = oc.errors(
5
- pickPublicErrorMap("NOTEBASE_BETA_RESTRICTED"),
6
- )
3
+ export const notebaseProcedure = oc
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { ContractRouterClient } from "@orpc/contract"
2
2
  import { betaAccessContract } from "./contracts/beta-access"
3
+ import { billingContract } from "./contracts/billing"
3
4
  import { cardContract } from "./contracts/card"
4
5
  import { cardTemplateContract } from "./contracts/card-template"
5
6
  import { hostedAiContract } from "./contracts/hosted-ai"
@@ -11,6 +12,7 @@ import { userContract } from "./contracts/user"
11
12
 
12
13
  export const contract = {
13
14
  betaAccess: betaAccessContract,
15
+ billing: billingContract,
14
16
  card: cardContract,
15
17
  cardTemplate: cardTemplateContract,
16
18
  hostedAi: hostedAiContract,
@@ -25,6 +27,7 @@ export type ORPCRouterClient = ContractRouterClient<typeof contract>
25
27
 
26
28
  export * from "./public-errors"
27
29
  export * from "./schemas/beta-access"
30
+ export * from "./schemas/billing"
28
31
  export * from "./schemas/card"
29
32
  export * from "./schemas/hosted-ai"
30
33
  export * from "./schemas/notebase"
@@ -70,6 +70,18 @@ export const PUBLIC_APP_ERROR_DEFS = {
70
70
  message: "Notebase column is used by a card template",
71
71
  status: 409,
72
72
  },
73
+ NOTE_LIMIT_EXCEEDED: {
74
+ message: "Upgrade is required to create more Notebase notes",
75
+ status: 403,
76
+ },
77
+ BILLING_NOT_CONFIGURED: {
78
+ message: "Billing is not configured",
79
+ status: 503,
80
+ },
81
+ BILLING_CUSTOMER_NOT_FOUND: {
82
+ message: "Billing customer not found",
83
+ status: 404,
84
+ },
73
85
  CARD_NOT_REVIEWABLE: {
74
86
  message: "Card cannot be reviewed in its current state",
75
87
  status: 409,
@@ -0,0 +1,41 @@
1
+ import { z } from "zod"
2
+
3
+ export const billingIntervalSchema = z.enum(["month", "year"])
4
+ export type BillingInterval = z.infer<typeof billingIntervalSchema>
5
+
6
+ export const billingSubscriptionStatusSchema = z.enum([
7
+ "incomplete",
8
+ "incomplete_expired",
9
+ "trialing",
10
+ "active",
11
+ "past_due",
12
+ "canceled",
13
+ "unpaid",
14
+ "paused",
15
+ ])
16
+ export type BillingSubscriptionStatus = z.infer<typeof billingSubscriptionStatusSchema>
17
+
18
+ export const billingPlanSchema = z.enum(["free", "pro"])
19
+ export type BillingPlan = z.infer<typeof billingPlanSchema>
20
+
21
+ export const billingStatusSchema = z.object({
22
+ plan: billingPlanSchema,
23
+ status: billingSubscriptionStatusSchema.nullable(),
24
+ interval: billingIntervalSchema.nullable(),
25
+ currentPeriodEnd: z.coerce.date().nullable(),
26
+ cancelAtPeriodEnd: z.boolean(),
27
+ unlimitedNotebaseNotes: z.boolean(),
28
+ notebaseNoteLimit: z.number().int().positive(),
29
+ notebaseNoteCount: z.number().int().min(0),
30
+ }).strict()
31
+ export type BillingStatus = z.infer<typeof billingStatusSchema>
32
+
33
+ export const billingCreateCheckoutSessionInputSchema = z.object({
34
+ interval: billingIntervalSchema,
35
+ }).strict()
36
+ export type BillingCreateCheckoutSessionInput = z.infer<typeof billingCreateCheckoutSessionInputSchema>
37
+
38
+ export const billingSessionUrlOutputSchema = z.object({
39
+ url: z.url(),
40
+ }).strict()
41
+ export type BillingSessionUrlOutput = z.infer<typeof billingSessionUrlOutputSchema>