@nikthegeek/dreamsforlittles-shared 0.6.2 → 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.
Files changed (84) hide show
  1. package/dist/access.d.ts +352 -0
  2. package/dist/access.js +2 -1
  3. package/dist/access.js.map +1 -1
  4. package/dist/active-timer-reminders.d.ts +10 -0
  5. package/dist/active-timer-reminders.js +11 -0
  6. package/dist/active-timer-reminders.js.map +1 -0
  7. package/dist/admin.d.ts +1867 -0
  8. package/dist/admin.js +4 -0
  9. package/dist/admin.js.map +1 -1
  10. package/dist/analysis.d.ts +216 -8
  11. package/dist/api.d.ts +5 -5
  12. package/dist/app-feedback.d.ts +266 -0
  13. package/dist/app-feedback.js +6 -2
  14. package/dist/app-feedback.js.map +1 -1
  15. package/dist/branding.d.ts +80 -0
  16. package/dist/branding.js +234 -0
  17. package/dist/branding.js.map +1 -0
  18. package/dist/branding.test.js +101 -0
  19. package/dist/branding.test.js.map +1 -0
  20. package/dist/client-notices.d.ts +133 -133
  21. package/dist/coach-activity-notifications.d.ts +4 -3
  22. package/dist/coach-activity-notifications.js +33 -5
  23. package/dist/coach-activity-notifications.js.map +1 -1
  24. package/dist/coach-activity-notifications.test.d.ts +1 -0
  25. package/dist/coach-activity-notifications.test.js +57 -0
  26. package/dist/coach-activity-notifications.test.js.map +1 -0
  27. package/dist/coach.d.ts +4600 -686
  28. package/dist/coach.js +36 -2
  29. package/dist/coach.js.map +1 -1
  30. package/dist/enums.d.ts +1 -1
  31. package/dist/enums.js +4 -1
  32. package/dist/enums.js.map +1 -1
  33. package/dist/errors.d.ts +8 -4
  34. package/dist/errors.js +12 -0
  35. package/dist/errors.js.map +1 -1
  36. package/dist/family-invitations.d.ts +466 -14
  37. package/dist/family-profile-artifacts.d.ts +802 -58
  38. package/dist/family.d.ts +6425 -1442
  39. package/dist/family.js +214 -10
  40. package/dist/family.js.map +1 -1
  41. package/dist/family.test.d.ts +1 -0
  42. package/dist/family.test.js +207 -0
  43. package/dist/family.test.js.map +1 -0
  44. package/dist/files.d.ts +2 -2
  45. package/dist/getting-started-guides.d.ts +6 -6
  46. package/dist/index.d.ts +5 -1
  47. package/dist/index.js +5 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/invites.d.ts +98 -0
  50. package/dist/notification-banners.d.ts +76 -14
  51. package/dist/notification-banners.js +20 -2
  52. package/dist/notification-banners.js.map +1 -1
  53. package/dist/notification-banners.test.d.ts +1 -0
  54. package/dist/notification-banners.test.js +28 -0
  55. package/dist/notification-banners.test.js.map +1 -0
  56. package/dist/realtime.d.ts +4 -4
  57. package/dist/subscription-cancellation-feedback.d.ts +539 -0
  58. package/dist/subscription-cancellation-feedback.js +144 -0
  59. package/dist/subscription-cancellation-feedback.js.map +1 -0
  60. package/dist/subscription-cancellation-feedback.test.d.ts +1 -0
  61. package/dist/subscription-cancellation-feedback.test.js +27 -0
  62. package/dist/subscription-cancellation-feedback.test.js.map +1 -0
  63. package/dist/support-attachments.d.ts +320 -0
  64. package/dist/support-attachments.js +108 -0
  65. package/dist/support-attachments.js.map +1 -0
  66. package/dist/support-attachments.test.d.ts +1 -0
  67. package/dist/support-attachments.test.js +35 -0
  68. package/dist/support-attachments.test.js.map +1 -0
  69. package/dist/support-mutation-reconciliation.d.ts +74 -0
  70. package/dist/support-mutation-reconciliation.js +36 -0
  71. package/dist/support-mutation-reconciliation.js.map +1 -0
  72. package/dist/support-mutation-reconciliation.test.d.ts +1 -0
  73. package/dist/support-mutation-reconciliation.test.js +43 -0
  74. package/dist/support-mutation-reconciliation.test.js.map +1 -0
  75. package/dist/support-tickets.d.ts +424 -0
  76. package/dist/support-tickets.js +9 -3
  77. package/dist/support-tickets.js.map +1 -1
  78. package/package.json +1 -1
  79. package/dist/sleep-insights.d.ts +0 -7943
  80. package/dist/sleep-insights.js +0 -231
  81. package/dist/sleep-insights.js.map +0 -1
  82. package/dist/sleep-insights.test.js +0 -124
  83. package/dist/sleep-insights.test.js.map +0 -1
  84. /package/dist/{sleep-insights.test.d.ts → branding.test.d.ts} +0 -0
@@ -0,0 +1,35 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { MAX_SUPPORT_ATTACHMENT_IMAGE_BYTES, MAX_SUPPORT_ATTACHMENT_VIDEO_BYTES, supportAttachmentIdsSchema, supportAttachmentReservationRequestSchema } from "./support-attachments.js";
3
+ const request = {
4
+ clientRequestId: "72e5d605-fd8c-49ca-a13f-a5f2df13596d",
5
+ purpose: "app_feedback",
6
+ fileName: "screenshot.png",
7
+ contentType: "image/png",
8
+ sizeBytes: 1024
9
+ };
10
+ describe("support attachment contracts", () => {
11
+ it("accepts supported screenshots and short-video declarations", () => {
12
+ expect(supportAttachmentReservationRequestSchema.parse(request)).toEqual(request);
13
+ expect(supportAttachmentReservationRequestSchema.parse({
14
+ ...request,
15
+ purpose: "support_ticket_message",
16
+ fileName: "screen-recording.mov",
17
+ contentType: "video/quicktime",
18
+ sizeBytes: MAX_SUPPORT_ATTACHMENT_VIDEO_BYTES
19
+ })).toMatchObject({ contentType: "video/quicktime" });
20
+ });
21
+ it("enforces media-specific hard limits and an exact MIME allowlist", () => {
22
+ expect(() => supportAttachmentReservationRequestSchema.parse({
23
+ ...request,
24
+ sizeBytes: MAX_SUPPORT_ATTACHMENT_IMAGE_BYTES + 1
25
+ })).toThrow();
26
+ expect(() => supportAttachmentReservationRequestSchema.parse({
27
+ ...request,
28
+ contentType: "image/svg+xml"
29
+ })).toThrow();
30
+ });
31
+ it("rejects duplicate parent attachment IDs", () => {
32
+ expect(() => supportAttachmentIdsSchema.parse(["attachment_1", "attachment_1"])).toThrow();
33
+ });
34
+ });
35
+ //# sourceMappingURL=support-attachments.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-attachments.test.js","sourceRoot":"","sources":["../src/support-attachments.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,O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C,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { z } from "zod";
2
+ export declare const supportMutationReconciliationRequestSchema: z.ZodDiscriminatedUnion<"operation", [z.ZodObject<{
3
+ operation: z.ZodLiteral<"family_feedback">;
4
+ clientRequestId: z.ZodString;
5
+ }, "strict", z.ZodTypeAny, {
6
+ clientRequestId: string;
7
+ operation: "family_feedback";
8
+ }, {
9
+ clientRequestId: string;
10
+ operation: "family_feedback";
11
+ }>, z.ZodObject<{
12
+ operation: z.ZodLiteral<"coach_feedback">;
13
+ clientRequestId: z.ZodString;
14
+ }, "strict", z.ZodTypeAny, {
15
+ clientRequestId: string;
16
+ operation: "coach_feedback";
17
+ }, {
18
+ clientRequestId: string;
19
+ operation: "coach_feedback";
20
+ }>, z.ZodObject<{
21
+ operation: z.ZodLiteral<"coach_ticket_create">;
22
+ clientRequestId: z.ZodString;
23
+ }, "strict", z.ZodTypeAny, {
24
+ clientRequestId: string;
25
+ operation: "coach_ticket_create";
26
+ }, {
27
+ clientRequestId: string;
28
+ operation: "coach_ticket_create";
29
+ }>, z.ZodObject<{
30
+ operation: z.ZodLiteral<"coach_ticket_reply">;
31
+ clientRequestId: z.ZodString;
32
+ ticketId: z.ZodString;
33
+ }, "strict", z.ZodTypeAny, {
34
+ clientRequestId: string;
35
+ operation: "coach_ticket_reply";
36
+ ticketId: string;
37
+ }, {
38
+ clientRequestId: string;
39
+ operation: "coach_ticket_reply";
40
+ ticketId: string;
41
+ }>, z.ZodObject<{
42
+ operation: z.ZodLiteral<"admin_ticket_reply">;
43
+ clientRequestId: z.ZodString;
44
+ ticketId: z.ZodString;
45
+ }, "strict", z.ZodTypeAny, {
46
+ clientRequestId: string;
47
+ operation: "admin_ticket_reply";
48
+ ticketId: string;
49
+ }, {
50
+ clientRequestId: string;
51
+ operation: "admin_ticket_reply";
52
+ ticketId: string;
53
+ }>]>;
54
+ export declare const supportMutationReconciliationResponseSchema: z.ZodDiscriminatedUnion<"found", [z.ZodObject<{
55
+ found: z.ZodLiteral<false>;
56
+ }, "strict", z.ZodTypeAny, {
57
+ found: false;
58
+ }, {
59
+ found: false;
60
+ }>, z.ZodObject<{
61
+ found: z.ZodLiteral<true>;
62
+ resultKind: z.ZodEnum<["app_feedback", "support_ticket"]>;
63
+ resultId: z.ZodString;
64
+ }, "strict", z.ZodTypeAny, {
65
+ found: true;
66
+ resultKind: "app_feedback" | "support_ticket";
67
+ resultId: string;
68
+ }, {
69
+ found: true;
70
+ resultKind: "app_feedback" | "support_ticket";
71
+ resultId: string;
72
+ }>]>;
73
+ export type SupportMutationReconciliationRequest = z.infer<typeof supportMutationReconciliationRequestSchema>;
74
+ export type SupportMutationReconciliationResponse = z.infer<typeof supportMutationReconciliationResponseSchema>;
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ import { idSchema } from "./api.js";
3
+ const clientRequestIdSchema = z.string().uuid();
4
+ export const supportMutationReconciliationRequestSchema = z.discriminatedUnion("operation", [
5
+ z.object({
6
+ operation: z.literal("family_feedback"),
7
+ clientRequestId: clientRequestIdSchema
8
+ }).strict(),
9
+ z.object({
10
+ operation: z.literal("coach_feedback"),
11
+ clientRequestId: clientRequestIdSchema
12
+ }).strict(),
13
+ z.object({
14
+ operation: z.literal("coach_ticket_create"),
15
+ clientRequestId: clientRequestIdSchema
16
+ }).strict(),
17
+ z.object({
18
+ operation: z.literal("coach_ticket_reply"),
19
+ clientRequestId: clientRequestIdSchema,
20
+ ticketId: idSchema
21
+ }).strict(),
22
+ z.object({
23
+ operation: z.literal("admin_ticket_reply"),
24
+ clientRequestId: clientRequestIdSchema,
25
+ ticketId: idSchema
26
+ }).strict()
27
+ ]);
28
+ export const supportMutationReconciliationResponseSchema = z.discriminatedUnion("found", [
29
+ z.object({ found: z.literal(false) }).strict(),
30
+ z.object({
31
+ found: z.literal(true),
32
+ resultKind: z.enum(["app_feedback", "support_ticket"]),
33
+ resultId: idSchema
34
+ }).strict()
35
+ ]);
36
+ //# sourceMappingURL=support-mutation-reconciliation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-mutation-reconciliation.js","sourceRoot":"","sources":["../src/support-mutation-reconciliation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC,CAAC,kBAAkB,CAC5E,WAAW,EACX;IACE,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;QACvC,eAAe,EAAE,qBAAqB;KACvC,CAAC,CAAC,MAAM,EAAE;IACX,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACtC,eAAe,EAAE,qBAAqB;KACvC,CAAC,CAAC,MAAM,EAAE;IACX,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAC3C,eAAe,EAAE,qBAAqB;KACvC,CAAC,CAAC,MAAM,EAAE;IACX,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;QAC1C,eAAe,EAAE,qBAAqB;QACtC,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC,MAAM,EAAE;IACX,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;QAC1C,eAAe,EAAE,qBAAqB;QACtC,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC,MAAM,EAAE;CACZ,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,CAAC,kBAAkB,CAC7E,OAAO,EACP;IACE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9C,CAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QACtB,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;QACtD,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC,MAAM,EAAE;CACZ,CACF,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,43 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { supportMutationReconciliationRequestSchema, supportMutationReconciliationResponseSchema } from "./support-mutation-reconciliation.js";
3
+ const clientRequestId = "72e5d605-fd8c-49ca-a13f-a5f2df13596d";
4
+ describe("support mutation reconciliation contracts", () => {
5
+ it.each([
6
+ { operation: "family_feedback", clientRequestId },
7
+ { operation: "coach_feedback", clientRequestId },
8
+ { operation: "coach_ticket_create", clientRequestId },
9
+ { operation: "coach_ticket_reply", clientRequestId, ticketId: "ticket_1" },
10
+ { operation: "admin_ticket_reply", clientRequestId, ticketId: "ticket_1" }
11
+ ])("accepts $operation", (request) => {
12
+ expect(supportMutationReconciliationRequestSchema.parse(request)).toEqual(request);
13
+ });
14
+ it("requires a UUID and operation-specific ticket ID without extra fields", () => {
15
+ expect(() => supportMutationReconciliationRequestSchema.parse({
16
+ operation: "family_feedback",
17
+ clientRequestId: "not-a-uuid"
18
+ })).toThrow();
19
+ expect(() => supportMutationReconciliationRequestSchema.parse({
20
+ operation: "coach_ticket_reply",
21
+ clientRequestId
22
+ })).toThrow();
23
+ expect(() => supportMutationReconciliationRequestSchema.parse({
24
+ operation: "family_feedback",
25
+ clientRequestId,
26
+ ticketId: "ticket_1"
27
+ })).toThrow();
28
+ });
29
+ it("keeps responses privacy-minimal", () => {
30
+ expect(supportMutationReconciliationResponseSchema.parse({ found: false }))
31
+ .toEqual({ found: false });
32
+ expect(supportMutationReconciliationResponseSchema.parse({
33
+ found: true,
34
+ resultKind: "support_ticket",
35
+ resultId: "ticket_1"
36
+ })).toMatchObject({ found: true, resultKind: "support_ticket" });
37
+ expect(() => supportMutationReconciliationResponseSchema.parse({
38
+ found: false,
39
+ resultId: "private"
40
+ })).toThrow();
41
+ });
42
+ });
43
+ //# sourceMappingURL=support-mutation-reconciliation.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support-mutation-reconciliation.test.js","sourceRoot":"","sources":["../src/support-mutation-reconciliation.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,0CAA0C,EAC1C,2CAA2C,EAC5C,MAAM,sCAAsC,CAAC;AAE9C,MAAM,eAAe,GAAG,sCAAsC,CAAC;AAE/D,QAAQ,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACzD,EAAE,CAAC,IAAI,CAAC;QACN,EAAE,SAAS,EAAE,iBAAiB,EAAE,eAAe,EAAE;QACjD,EAAE,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE;QAChD,EAAE,SAAS,EAAE,qBAAqB,EAAE,eAAe,EAAE;QACrD,EAAE,SAAS,EAAE,oBAAoB,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE;QAC1E,EAAE,SAAS,EAAE,oBAAoB,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE;KAClE,CAAC,CAAC,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE;QAC5C,MAAM,CAAC,0CAA0C,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAA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