@read-frog/definitions 0.3.2 → 0.3.4
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 +25 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/constants/beta-access.ts +6 -1
- package/src/index.ts +1 -0
- package/src/schemas/transcript.ts +9 -0
- package/src/types/card.ts +15 -2
- package/src/types/srs.ts +6 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@read-frog/definitions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"zod": "^4.4.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"tsdown": "^0.22.
|
|
34
|
-
"vitest": "^4.1.
|
|
33
|
+
"tsdown": "^0.22.3",
|
|
34
|
+
"vitest": "^4.1.9",
|
|
35
35
|
"@repo/eslint-config": "0.0.1",
|
|
36
36
|
"@repo/tsdown-config": "0.0.0",
|
|
37
37
|
"@repo/typescript-config": "0.0.0"
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
export const BETA_FEATURES = {
|
|
2
2
|
notebase: "notebase",
|
|
3
|
+
videoTranscription: "videoTranscription",
|
|
3
4
|
} as const
|
|
4
5
|
|
|
5
|
-
export const BETA_FEATURE_KEYS = [
|
|
6
|
+
export const BETA_FEATURE_KEYS = [
|
|
7
|
+
BETA_FEATURES.notebase,
|
|
8
|
+
BETA_FEATURES.videoTranscription,
|
|
9
|
+
] as const
|
|
6
10
|
|
|
7
11
|
export type BetaFeatureKey = (typeof BETA_FEATURE_KEYS)[number]
|
|
8
12
|
|
|
9
13
|
export const NOTEBASE_BETA_FEATURE_KEY = BETA_FEATURES.notebase
|
|
14
|
+
export const VIDEO_TRANSCRIPTION_BETA_FEATURE_KEY = BETA_FEATURES.videoTranscription
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./constants/dictionary"
|
|
|
5
5
|
export * from "./constants/notebase-column"
|
|
6
6
|
export * from "./constants/url"
|
|
7
7
|
export * from "./schemas/cell-value"
|
|
8
|
+
export * from "./schemas/transcript"
|
|
8
9
|
export * from "./schemas/version"
|
|
9
10
|
export * from "./types/card"
|
|
10
11
|
export * from "./types/languages"
|
package/src/types/card.ts
CHANGED
|
@@ -7,17 +7,30 @@ export const CARD_STATE_VALUES = [
|
|
|
7
7
|
"relearning",
|
|
8
8
|
] as const
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const ACTIVE_SCHEDULE_STATUS_VALUES = [
|
|
11
11
|
"new",
|
|
12
12
|
"learning",
|
|
13
13
|
"review",
|
|
14
|
+
] as const
|
|
15
|
+
|
|
16
|
+
export const SCHEDULE_STATUS_VALUES = [
|
|
17
|
+
...ACTIVE_SCHEDULE_STATUS_VALUES,
|
|
14
18
|
"suspended",
|
|
15
19
|
"buried",
|
|
16
20
|
] as const
|
|
17
21
|
|
|
22
|
+
export const EMPTY_SCHEDULE_STATUS_COUNTS = {
|
|
23
|
+
learning: 0,
|
|
24
|
+
new: 0,
|
|
25
|
+
review: 0,
|
|
26
|
+
} satisfies Record<ActiveScheduleStatus, number>
|
|
27
|
+
|
|
18
28
|
export const cardStateSchema = z.enum(CARD_STATE_VALUES)
|
|
19
29
|
export type CardState = z.infer<typeof cardStateSchema>
|
|
20
30
|
|
|
31
|
+
export const activeScheduleStatusSchema = z.enum(ACTIVE_SCHEDULE_STATUS_VALUES)
|
|
32
|
+
export type ActiveScheduleStatus = z.infer<typeof activeScheduleStatusSchema>
|
|
33
|
+
|
|
21
34
|
export const scheduleStatusSchema = z.enum(SCHEDULE_STATUS_VALUES)
|
|
22
35
|
export type ScheduleStatus = z.infer<typeof scheduleStatusSchema>
|
|
23
36
|
|
|
@@ -26,7 +39,7 @@ export const CARD_STATE_TO_SCHEDULE_STATUS = {
|
|
|
26
39
|
learning: "learning",
|
|
27
40
|
relearning: "learning",
|
|
28
41
|
review: "review",
|
|
29
|
-
} satisfies Record<CardState,
|
|
42
|
+
} satisfies Record<CardState, ActiveScheduleStatus>
|
|
30
43
|
|
|
31
44
|
export const basicCardTemplateConfigSchema = z.object({
|
|
32
45
|
type: z.literal("basic"),
|
package/src/types/srs.ts
CHANGED
|
@@ -26,9 +26,11 @@ export type SrsStep = z.infer<typeof srsStepSchema>
|
|
|
26
26
|
|
|
27
27
|
export const srsWeightsSchema = z.array(z.number())
|
|
28
28
|
|
|
29
|
+
export const UNLIMITED_DAILY_LIMIT = -1
|
|
30
|
+
|
|
29
31
|
export const schedulingParamsShape = {
|
|
30
|
-
newPerDay: z.number().int().gte(
|
|
31
|
-
reviewsPerDay: z.number().int().gte(
|
|
32
|
+
newPerDay: z.number().int().gte(UNLIMITED_DAILY_LIMIT),
|
|
33
|
+
reviewsPerDay: z.number().int().gte(UNLIMITED_DAILY_LIMIT),
|
|
32
34
|
desiredRetention: z.number().gt(0).lte(1),
|
|
33
35
|
enableShortTerm: z.boolean(),
|
|
34
36
|
maximumInterval: z.number().int().positive(),
|
|
@@ -43,8 +45,8 @@ export const schedulingParamsSchema = z.object(schedulingParamsShape).strict()
|
|
|
43
45
|
export type SchedulingParams = z.infer<typeof schedulingParamsSchema>
|
|
44
46
|
|
|
45
47
|
export const DEFAULT_SRS_SCHEDULING_PARAMS = {
|
|
46
|
-
newPerDay:
|
|
47
|
-
reviewsPerDay:
|
|
48
|
+
newPerDay: UNLIMITED_DAILY_LIMIT,
|
|
49
|
+
reviewsPerDay: UNLIMITED_DAILY_LIMIT,
|
|
48
50
|
desiredRetention: 0.9,
|
|
49
51
|
enableShortTerm: true,
|
|
50
52
|
maximumInterval: 36500,
|