@nikthegeek/dreamsforlittles-shared 0.18.7 → 0.18.8
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/activity-import-readers.d.ts +2 -0
- package/dist/activity-import-readers.js +9 -0
- package/dist/activity-import-readers.js.map +1 -1
- package/dist/admin.d.ts +6 -6
- package/dist/analysis.d.ts +206 -206
- package/dist/coach.d.ts +5735 -5735
- package/dist/family.d.ts +8776 -8774
- package/dist/family.js +3 -0
- package/dist/family.js.map +1 -1
- package/dist/home-activity-context.d.ts +476 -476
- package/dist/huckleberry-import.d.ts +112 -24
- package/dist/huckleberry-import.js +6 -3
- package/dist/huckleberry-import.js.map +1 -1
- package/dist/huckleberry-import.test.d.ts +1 -0
- package/dist/huckleberry-import.test.js +23 -0
- package/dist/huckleberry-import.test.js.map +1 -0
- package/dist/native-timer-state.d.ts +893 -893
- package/dist/sleep-completed-night.d.ts +428 -428
- package/dist/subscription-cancellation-feedback.d.ts +10 -10
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const HUCKLEBERRY_MAX_CSV_BYTES: number;
|
|
3
|
-
export declare const HUCKLEBERRY_MAX_ROWS =
|
|
3
|
+
export declare const HUCKLEBERRY_MAX_ROWS = 10000;
|
|
4
4
|
export declare const HUCKLEBERRY_DUPLICATE_WINDOW_MS: number;
|
|
5
5
|
export declare const HUCKLEBERRY_UNDO_DAYS = 7;
|
|
6
6
|
export declare const huckleberryImportContextSchema: z.ZodObject<{
|
|
@@ -44,15 +44,15 @@ export declare const huckleberryImportContextSchema: z.ZodObject<{
|
|
|
44
44
|
} | undefined;
|
|
45
45
|
}>;
|
|
46
46
|
export type HuckleberryImportContext = z.infer<typeof huckleberryImportContextSchema>;
|
|
47
|
-
export declare const huckleberryActivityTypeSchema: z.ZodEnum<["sleep", "breastfeed", "solids"]>;
|
|
47
|
+
export declare const huckleberryActivityTypeSchema: z.ZodEnum<["sleep", "breastfeed", "solids", "bottles", "nappies", "pumping", "medication"]>;
|
|
48
48
|
export declare const huckleberryImportInputSchema: z.ZodObject<{
|
|
49
49
|
babyId: z.ZodString;
|
|
50
50
|
csv: z.ZodString;
|
|
51
51
|
skipDuplicates: z.ZodDefault<z.ZodBoolean>;
|
|
52
52
|
}, "strict", z.ZodTypeAny, {
|
|
53
53
|
babyId: string;
|
|
54
|
-
csv: string;
|
|
55
54
|
skipDuplicates: boolean;
|
|
55
|
+
csv: string;
|
|
56
56
|
}, {
|
|
57
57
|
babyId: string;
|
|
58
58
|
csv: string;
|
|
@@ -69,16 +69,16 @@ export declare const huckleberryImportCommitSchema: z.ZodObject<{
|
|
|
69
69
|
}, "strict", z.ZodTypeAny, {
|
|
70
70
|
timeZone: string;
|
|
71
71
|
babyId: string;
|
|
72
|
-
csv: string;
|
|
73
72
|
skipDuplicates: boolean;
|
|
74
|
-
batchId: string;
|
|
75
73
|
previewHash: string;
|
|
74
|
+
csv: string;
|
|
75
|
+
batchId: string;
|
|
76
76
|
}, {
|
|
77
77
|
timeZone: string;
|
|
78
78
|
babyId: string;
|
|
79
|
+
previewHash: string;
|
|
79
80
|
csv: string;
|
|
80
81
|
batchId: string;
|
|
81
|
-
previewHash: string;
|
|
82
82
|
skipDuplicates?: boolean | undefined;
|
|
83
83
|
}>;
|
|
84
84
|
export declare const huckleberryImportSummarySchema: z.ZodObject<{
|
|
@@ -91,14 +91,26 @@ export declare const huckleberryImportSummarySchema: z.ZodObject<{
|
|
|
91
91
|
sleep: z.ZodNumber;
|
|
92
92
|
breastfeed: z.ZodNumber;
|
|
93
93
|
solids: z.ZodNumber;
|
|
94
|
+
bottles: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
nappies: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
pumping: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
medication: z.ZodOptional<z.ZodNumber>;
|
|
94
98
|
}, "strict", z.ZodTypeAny, {
|
|
95
99
|
breastfeed: number;
|
|
96
100
|
sleep: number;
|
|
97
101
|
solids: number;
|
|
102
|
+
pumping?: number | undefined;
|
|
103
|
+
bottles?: number | undefined;
|
|
104
|
+
nappies?: number | undefined;
|
|
105
|
+
medication?: number | undefined;
|
|
98
106
|
}, {
|
|
99
107
|
breastfeed: number;
|
|
100
108
|
sleep: number;
|
|
101
109
|
solids: number;
|
|
110
|
+
pumping?: number | undefined;
|
|
111
|
+
bottles?: number | undefined;
|
|
112
|
+
nappies?: number | undefined;
|
|
113
|
+
medication?: number | undefined;
|
|
102
114
|
}>;
|
|
103
115
|
startDate: z.ZodNullable<z.ZodString>;
|
|
104
116
|
endDate: z.ZodNullable<z.ZodString>;
|
|
@@ -120,17 +132,21 @@ export declare const huckleberryImportSummarySchema: z.ZodObject<{
|
|
|
120
132
|
breastfeed: number;
|
|
121
133
|
sleep: number;
|
|
122
134
|
solids: number;
|
|
135
|
+
pumping?: number | undefined;
|
|
136
|
+
bottles?: number | undefined;
|
|
137
|
+
nappies?: number | undefined;
|
|
138
|
+
medication?: number | undefined;
|
|
123
139
|
};
|
|
124
140
|
babyId: string;
|
|
125
141
|
accepted: number;
|
|
126
142
|
startDate: string | null;
|
|
127
143
|
endDate: string | null;
|
|
128
|
-
skipDuplicates: boolean;
|
|
129
144
|
duplicates: number;
|
|
130
145
|
skipped: {
|
|
131
146
|
count: number;
|
|
132
147
|
reason: string;
|
|
133
148
|
}[];
|
|
149
|
+
skipDuplicates: boolean;
|
|
134
150
|
}, {
|
|
135
151
|
timeZone: string;
|
|
136
152
|
total: number;
|
|
@@ -138,17 +154,21 @@ export declare const huckleberryImportSummarySchema: z.ZodObject<{
|
|
|
138
154
|
breastfeed: number;
|
|
139
155
|
sleep: number;
|
|
140
156
|
solids: number;
|
|
157
|
+
pumping?: number | undefined;
|
|
158
|
+
bottles?: number | undefined;
|
|
159
|
+
nappies?: number | undefined;
|
|
160
|
+
medication?: number | undefined;
|
|
141
161
|
};
|
|
142
162
|
babyId: string;
|
|
143
163
|
accepted: number;
|
|
144
164
|
startDate: string | null;
|
|
145
165
|
endDate: string | null;
|
|
146
|
-
skipDuplicates: boolean;
|
|
147
166
|
duplicates: number;
|
|
148
167
|
skipped: {
|
|
149
168
|
count: number;
|
|
150
169
|
reason: string;
|
|
151
170
|
}[];
|
|
171
|
+
skipDuplicates: boolean;
|
|
152
172
|
}>;
|
|
153
173
|
export declare const huckleberryImportPreviewSchema: z.ZodObject<{
|
|
154
174
|
babyId: z.ZodString;
|
|
@@ -160,14 +180,26 @@ export declare const huckleberryImportPreviewSchema: z.ZodObject<{
|
|
|
160
180
|
sleep: z.ZodNumber;
|
|
161
181
|
breastfeed: z.ZodNumber;
|
|
162
182
|
solids: z.ZodNumber;
|
|
183
|
+
bottles: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
nappies: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
pumping: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
medication: z.ZodOptional<z.ZodNumber>;
|
|
163
187
|
}, "strict", z.ZodTypeAny, {
|
|
164
188
|
breastfeed: number;
|
|
165
189
|
sleep: number;
|
|
166
190
|
solids: number;
|
|
191
|
+
pumping?: number | undefined;
|
|
192
|
+
bottles?: number | undefined;
|
|
193
|
+
nappies?: number | undefined;
|
|
194
|
+
medication?: number | undefined;
|
|
167
195
|
}, {
|
|
168
196
|
breastfeed: number;
|
|
169
197
|
sleep: number;
|
|
170
198
|
solids: number;
|
|
199
|
+
pumping?: number | undefined;
|
|
200
|
+
bottles?: number | undefined;
|
|
201
|
+
nappies?: number | undefined;
|
|
202
|
+
medication?: number | undefined;
|
|
171
203
|
}>;
|
|
172
204
|
startDate: z.ZodNullable<z.ZodString>;
|
|
173
205
|
endDate: z.ZodNullable<z.ZodString>;
|
|
@@ -191,18 +223,22 @@ export declare const huckleberryImportPreviewSchema: z.ZodObject<{
|
|
|
191
223
|
breastfeed: number;
|
|
192
224
|
sleep: number;
|
|
193
225
|
solids: number;
|
|
226
|
+
pumping?: number | undefined;
|
|
227
|
+
bottles?: number | undefined;
|
|
228
|
+
nappies?: number | undefined;
|
|
229
|
+
medication?: number | undefined;
|
|
194
230
|
};
|
|
195
231
|
babyId: string;
|
|
196
232
|
accepted: number;
|
|
197
233
|
startDate: string | null;
|
|
198
234
|
endDate: string | null;
|
|
199
|
-
skipDuplicates: boolean;
|
|
200
|
-
previewHash: string;
|
|
201
235
|
duplicates: number;
|
|
202
236
|
skipped: {
|
|
203
237
|
count: number;
|
|
204
238
|
reason: string;
|
|
205
239
|
}[];
|
|
240
|
+
skipDuplicates: boolean;
|
|
241
|
+
previewHash: string;
|
|
206
242
|
}, {
|
|
207
243
|
timeZone: string;
|
|
208
244
|
total: number;
|
|
@@ -210,18 +246,22 @@ export declare const huckleberryImportPreviewSchema: z.ZodObject<{
|
|
|
210
246
|
breastfeed: number;
|
|
211
247
|
sleep: number;
|
|
212
248
|
solids: number;
|
|
249
|
+
pumping?: number | undefined;
|
|
250
|
+
bottles?: number | undefined;
|
|
251
|
+
nappies?: number | undefined;
|
|
252
|
+
medication?: number | undefined;
|
|
213
253
|
};
|
|
214
254
|
babyId: string;
|
|
215
255
|
accepted: number;
|
|
216
256
|
startDate: string | null;
|
|
217
257
|
endDate: string | null;
|
|
218
|
-
skipDuplicates: boolean;
|
|
219
|
-
previewHash: string;
|
|
220
258
|
duplicates: number;
|
|
221
259
|
skipped: {
|
|
222
260
|
count: number;
|
|
223
261
|
reason: string;
|
|
224
262
|
}[];
|
|
263
|
+
skipDuplicates: boolean;
|
|
264
|
+
previewHash: string;
|
|
225
265
|
}>;
|
|
226
266
|
export declare const huckleberryImportBatchSchema: z.ZodObject<{
|
|
227
267
|
babyId: z.ZodString;
|
|
@@ -233,14 +273,26 @@ export declare const huckleberryImportBatchSchema: z.ZodObject<{
|
|
|
233
273
|
sleep: z.ZodNumber;
|
|
234
274
|
breastfeed: z.ZodNumber;
|
|
235
275
|
solids: z.ZodNumber;
|
|
276
|
+
bottles: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
nappies: z.ZodOptional<z.ZodNumber>;
|
|
278
|
+
pumping: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
medication: z.ZodOptional<z.ZodNumber>;
|
|
236
280
|
}, "strict", z.ZodTypeAny, {
|
|
237
281
|
breastfeed: number;
|
|
238
282
|
sleep: number;
|
|
239
283
|
solids: number;
|
|
284
|
+
pumping?: number | undefined;
|
|
285
|
+
bottles?: number | undefined;
|
|
286
|
+
nappies?: number | undefined;
|
|
287
|
+
medication?: number | undefined;
|
|
240
288
|
}, {
|
|
241
289
|
breastfeed: number;
|
|
242
290
|
sleep: number;
|
|
243
291
|
solids: number;
|
|
292
|
+
pumping?: number | undefined;
|
|
293
|
+
bottles?: number | undefined;
|
|
294
|
+
nappies?: number | undefined;
|
|
295
|
+
medication?: number | undefined;
|
|
244
296
|
}>;
|
|
245
297
|
startDate: z.ZodNullable<z.ZodString>;
|
|
246
298
|
endDate: z.ZodNullable<z.ZodString>;
|
|
@@ -270,18 +322,22 @@ export declare const huckleberryImportBatchSchema: z.ZodObject<{
|
|
|
270
322
|
breastfeed: number;
|
|
271
323
|
sleep: number;
|
|
272
324
|
solids: number;
|
|
325
|
+
pumping?: number | undefined;
|
|
326
|
+
bottles?: number | undefined;
|
|
327
|
+
nappies?: number | undefined;
|
|
328
|
+
medication?: number | undefined;
|
|
273
329
|
};
|
|
274
330
|
babyId: string;
|
|
275
331
|
accepted: number;
|
|
276
332
|
startDate: string | null;
|
|
277
333
|
endDate: string | null;
|
|
278
|
-
skipDuplicates: boolean;
|
|
279
|
-
batchId: string;
|
|
280
334
|
duplicates: number;
|
|
281
335
|
skipped: {
|
|
282
336
|
count: number;
|
|
283
337
|
reason: string;
|
|
284
338
|
}[];
|
|
339
|
+
skipDuplicates: boolean;
|
|
340
|
+
batchId: string;
|
|
285
341
|
undoUntil: string;
|
|
286
342
|
undoneAt: string | null;
|
|
287
343
|
}, {
|
|
@@ -293,18 +349,22 @@ export declare const huckleberryImportBatchSchema: z.ZodObject<{
|
|
|
293
349
|
breastfeed: number;
|
|
294
350
|
sleep: number;
|
|
295
351
|
solids: number;
|
|
352
|
+
pumping?: number | undefined;
|
|
353
|
+
bottles?: number | undefined;
|
|
354
|
+
nappies?: number | undefined;
|
|
355
|
+
medication?: number | undefined;
|
|
296
356
|
};
|
|
297
357
|
babyId: string;
|
|
298
358
|
accepted: number;
|
|
299
359
|
startDate: string | null;
|
|
300
360
|
endDate: string | null;
|
|
301
|
-
skipDuplicates: boolean;
|
|
302
|
-
batchId: string;
|
|
303
361
|
duplicates: number;
|
|
304
362
|
skipped: {
|
|
305
363
|
count: number;
|
|
306
364
|
reason: string;
|
|
307
365
|
}[];
|
|
366
|
+
skipDuplicates: boolean;
|
|
367
|
+
batchId: string;
|
|
308
368
|
undoUntil: string;
|
|
309
369
|
undoneAt: string | null;
|
|
310
370
|
}>;
|
|
@@ -319,14 +379,26 @@ export declare const huckleberryImportListSchema: z.ZodObject<{
|
|
|
319
379
|
sleep: z.ZodNumber;
|
|
320
380
|
breastfeed: z.ZodNumber;
|
|
321
381
|
solids: z.ZodNumber;
|
|
382
|
+
bottles: z.ZodOptional<z.ZodNumber>;
|
|
383
|
+
nappies: z.ZodOptional<z.ZodNumber>;
|
|
384
|
+
pumping: z.ZodOptional<z.ZodNumber>;
|
|
385
|
+
medication: z.ZodOptional<z.ZodNumber>;
|
|
322
386
|
}, "strict", z.ZodTypeAny, {
|
|
323
387
|
breastfeed: number;
|
|
324
388
|
sleep: number;
|
|
325
389
|
solids: number;
|
|
390
|
+
pumping?: number | undefined;
|
|
391
|
+
bottles?: number | undefined;
|
|
392
|
+
nappies?: number | undefined;
|
|
393
|
+
medication?: number | undefined;
|
|
326
394
|
}, {
|
|
327
395
|
breastfeed: number;
|
|
328
396
|
sleep: number;
|
|
329
397
|
solids: number;
|
|
398
|
+
pumping?: number | undefined;
|
|
399
|
+
bottles?: number | undefined;
|
|
400
|
+
nappies?: number | undefined;
|
|
401
|
+
medication?: number | undefined;
|
|
330
402
|
}>;
|
|
331
403
|
startDate: z.ZodNullable<z.ZodString>;
|
|
332
404
|
endDate: z.ZodNullable<z.ZodString>;
|
|
@@ -356,18 +428,22 @@ export declare const huckleberryImportListSchema: z.ZodObject<{
|
|
|
356
428
|
breastfeed: number;
|
|
357
429
|
sleep: number;
|
|
358
430
|
solids: number;
|
|
431
|
+
pumping?: number | undefined;
|
|
432
|
+
bottles?: number | undefined;
|
|
433
|
+
nappies?: number | undefined;
|
|
434
|
+
medication?: number | undefined;
|
|
359
435
|
};
|
|
360
436
|
babyId: string;
|
|
361
437
|
accepted: number;
|
|
362
438
|
startDate: string | null;
|
|
363
439
|
endDate: string | null;
|
|
364
|
-
skipDuplicates: boolean;
|
|
365
|
-
batchId: string;
|
|
366
440
|
duplicates: number;
|
|
367
441
|
skipped: {
|
|
368
442
|
count: number;
|
|
369
443
|
reason: string;
|
|
370
444
|
}[];
|
|
445
|
+
skipDuplicates: boolean;
|
|
446
|
+
batchId: string;
|
|
371
447
|
undoUntil: string;
|
|
372
448
|
undoneAt: string | null;
|
|
373
449
|
}, {
|
|
@@ -379,18 +455,22 @@ export declare const huckleberryImportListSchema: z.ZodObject<{
|
|
|
379
455
|
breastfeed: number;
|
|
380
456
|
sleep: number;
|
|
381
457
|
solids: number;
|
|
458
|
+
pumping?: number | undefined;
|
|
459
|
+
bottles?: number | undefined;
|
|
460
|
+
nappies?: number | undefined;
|
|
461
|
+
medication?: number | undefined;
|
|
382
462
|
};
|
|
383
463
|
babyId: string;
|
|
384
464
|
accepted: number;
|
|
385
465
|
startDate: string | null;
|
|
386
466
|
endDate: string | null;
|
|
387
|
-
skipDuplicates: boolean;
|
|
388
|
-
batchId: string;
|
|
389
467
|
duplicates: number;
|
|
390
468
|
skipped: {
|
|
391
469
|
count: number;
|
|
392
470
|
reason: string;
|
|
393
471
|
}[];
|
|
472
|
+
skipDuplicates: boolean;
|
|
473
|
+
batchId: string;
|
|
394
474
|
undoUntil: string;
|
|
395
475
|
undoneAt: string | null;
|
|
396
476
|
}>, "many">;
|
|
@@ -404,18 +484,22 @@ export declare const huckleberryImportListSchema: z.ZodObject<{
|
|
|
404
484
|
breastfeed: number;
|
|
405
485
|
sleep: number;
|
|
406
486
|
solids: number;
|
|
487
|
+
pumping?: number | undefined;
|
|
488
|
+
bottles?: number | undefined;
|
|
489
|
+
nappies?: number | undefined;
|
|
490
|
+
medication?: number | undefined;
|
|
407
491
|
};
|
|
408
492
|
babyId: string;
|
|
409
493
|
accepted: number;
|
|
410
494
|
startDate: string | null;
|
|
411
495
|
endDate: string | null;
|
|
412
|
-
skipDuplicates: boolean;
|
|
413
|
-
batchId: string;
|
|
414
496
|
duplicates: number;
|
|
415
497
|
skipped: {
|
|
416
498
|
count: number;
|
|
417
499
|
reason: string;
|
|
418
500
|
}[];
|
|
501
|
+
skipDuplicates: boolean;
|
|
502
|
+
batchId: string;
|
|
419
503
|
undoUntil: string;
|
|
420
504
|
undoneAt: string | null;
|
|
421
505
|
}[];
|
|
@@ -429,18 +513,22 @@ export declare const huckleberryImportListSchema: z.ZodObject<{
|
|
|
429
513
|
breastfeed: number;
|
|
430
514
|
sleep: number;
|
|
431
515
|
solids: number;
|
|
516
|
+
pumping?: number | undefined;
|
|
517
|
+
bottles?: number | undefined;
|
|
518
|
+
nappies?: number | undefined;
|
|
519
|
+
medication?: number | undefined;
|
|
432
520
|
};
|
|
433
521
|
babyId: string;
|
|
434
522
|
accepted: number;
|
|
435
523
|
startDate: string | null;
|
|
436
524
|
endDate: string | null;
|
|
437
|
-
skipDuplicates: boolean;
|
|
438
|
-
batchId: string;
|
|
439
525
|
duplicates: number;
|
|
440
526
|
skipped: {
|
|
441
527
|
count: number;
|
|
442
528
|
reason: string;
|
|
443
529
|
}[];
|
|
530
|
+
skipDuplicates: boolean;
|
|
531
|
+
batchId: string;
|
|
444
532
|
undoUntil: string;
|
|
445
533
|
undoneAt: string | null;
|
|
446
534
|
}[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
// Local implementation bounds (D-311), not a provider-wide CSV specification.
|
|
3
3
|
export const HUCKLEBERRY_MAX_CSV_BYTES = 512 * 1024;
|
|
4
|
-
export const HUCKLEBERRY_MAX_ROWS =
|
|
4
|
+
export const HUCKLEBERRY_MAX_ROWS = 10_000;
|
|
5
5
|
export const HUCKLEBERRY_DUPLICATE_WINDOW_MS = 2 * 60_000;
|
|
6
6
|
export const HUCKLEBERRY_UNDO_DAYS = 7;
|
|
7
7
|
// Read-only provenance: totals carry no invented side order; legacy sleep
|
|
@@ -10,7 +10,7 @@ export const huckleberryImportContextSchema = z.object({
|
|
|
10
10
|
breastfeed: z.object({ totalMinutes: z.number().int().positive().nullable(), leftMinutes: z.number().int().nonnegative().nullable(), rightMinutes: z.number().int().nonnegative().nullable() }).strict().optional(),
|
|
11
11
|
sleep: z.object({ environment: z.enum(["co-sleeping", "contact-napping", "baby-cot", "motion-nap", "other"]).nullable() }).strict().optional()
|
|
12
12
|
}).strict();
|
|
13
|
-
export const huckleberryActivityTypeSchema = z.enum(["sleep", "breastfeed", "solids"]);
|
|
13
|
+
export const huckleberryActivityTypeSchema = z.enum(["sleep", "breastfeed", "solids", "bottles", "nappies", "pumping", "medication"]);
|
|
14
14
|
export const huckleberryImportInputSchema = z.object({
|
|
15
15
|
babyId: z.string().min(1),
|
|
16
16
|
csv: z.string().min(1).max(HUCKLEBERRY_MAX_CSV_BYTES),
|
|
@@ -23,7 +23,10 @@ export const huckleberryImportSummarySchema = z.object({
|
|
|
23
23
|
babyId: z.string().min(1), timeZone: z.string().min(1),
|
|
24
24
|
total: z.number().int().nonnegative(), accepted: z.number().int().nonnegative(),
|
|
25
25
|
duplicates: z.number().int().nonnegative(),
|
|
26
|
-
|
|
26
|
+
// Old receipts omit the subsequently supported trackers.
|
|
27
|
+
counts: z.object({ sleep: z.number().int().nonnegative(), breastfeed: z.number().int().nonnegative(), solids: z.number().int().nonnegative(),
|
|
28
|
+
bottles: z.number().int().nonnegative().optional(), nappies: z.number().int().nonnegative().optional(),
|
|
29
|
+
pumping: z.number().int().nonnegative().optional(), medication: z.number().int().nonnegative().optional() }).strict(),
|
|
27
30
|
startDate: z.string().nullable(), endDate: z.string().nullable(),
|
|
28
31
|
skipped: z.array(z.object({ reason: z.string(), count: z.number().int().positive() }).strict()),
|
|
29
32
|
skipDuplicates: z.boolean()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"huckleberry-import.js","sourceRoot":"","sources":["../src/huckleberry-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,GAAG,IAAI,CAAC;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"file":"huckleberry-import.js","sourceRoot":"","sources":["../src/huckleberry-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,GAAG,IAAI,CAAC;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAC3C,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,GAAG,MAAM,CAAC;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AACvC,0EAA0E;AAC1E,uDAAuD;AACvD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ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ckleberryImportPreviewSchema, HUCKLEBERRY_MAX_ROWS } from "./huckleberry-import.js";
|
|
3
|
+
import { activityPumpingSide } from "./family.js";
|
|
4
|
+
import { hasUnknownImportedPumpingDuration } from "./activity-import-readers.js";
|
|
5
|
+
describe("Huckleberry import compatibility", () => {
|
|
6
|
+
it("keeps historical three-tracker receipts readable alongside extended counts", () => {
|
|
7
|
+
const preview = { babyId: "child", timeZone: "UTC", total: 1, accepted: 1, duplicates: 0,
|
|
8
|
+
counts: { sleep: 1, breastfeed: 0, solids: 0 }, startDate: "2026-01-15", endDate: "2026-01-15", skipped: [], skipDuplicates: true, previewHash: "a".repeat(64) };
|
|
9
|
+
expect(huckleberryImportPreviewSchema.parse(preview).counts).toEqual(preview.counts);
|
|
10
|
+
expect(huckleberryImportPreviewSchema.parse({ ...preview, counts: { ...preview.counts, bottles: 0, nappies: 0, pumping: 0, medication: 0 } }).counts.medication).toBe(0);
|
|
11
|
+
expect(HUCKLEBERRY_MAX_ROWS).toBeGreaterThanOrEqual(5784);
|
|
12
|
+
});
|
|
13
|
+
it("does not expose a total-only imported pump's compatibility side or zero-length placeholder as recorded facts", () => {
|
|
14
|
+
const activity = { activityType: "pumping", importSource: "huckleberry", details: { side: "left", start: "2026-01-15T10:00:00Z", end: "2026-01-15T10:00:00Z" } };
|
|
15
|
+
expect(activityPumpingSide(activity)).toBeNull();
|
|
16
|
+
expect(hasUnknownImportedPumpingDuration(activity)).toBe(true);
|
|
17
|
+
expect(activityPumpingSide({ ...activity, pumpingSide: "right" })).toBe("right");
|
|
18
|
+
expect(hasUnknownImportedPumpingDuration({ ...activity, details: { ...activity.details, end: "2026-01-15T10:05:00Z" } })).toBe(false);
|
|
19
|
+
expect(activityPumpingSide({ details: activity.details })).toBe("left");
|
|
20
|
+
expect(hasUnknownImportedPumpingDuration({ ...activity, importSource: undefined })).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=huckleberry-import.test.js.map
|
|
@@ -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