@voyantjs/notifications-react 0.6.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.
Files changed (55) hide show
  1. package/dist/client.d.ts +14 -0
  2. package/dist/client.d.ts.map +1 -0
  3. package/dist/client.js +71 -0
  4. package/dist/hooks/index.d.ts +12 -0
  5. package/dist/hooks/index.d.ts.map +1 -0
  6. package/dist/hooks/index.js +12 -0
  7. package/dist/hooks/use-notification-deliveries.d.ts +39 -0
  8. package/dist/hooks/use-notification-deliveries.d.ts.map +1 -0
  9. package/dist/hooks/use-notification-deliveries.js +12 -0
  10. package/dist/hooks/use-notification-delivery.d.ts +32 -0
  11. package/dist/hooks/use-notification-delivery.d.ts.map +1 -0
  12. package/dist/hooks/use-notification-delivery.js +12 -0
  13. package/dist/hooks/use-notification-reminder-rule-mutation.d.ts +54 -0
  14. package/dist/hooks/use-notification-reminder-rule-mutation.d.ts.map +1 -0
  15. package/dist/hooks/use-notification-reminder-rule-mutation.js +31 -0
  16. package/dist/hooks/use-notification-reminder-rule.d.ts +20 -0
  17. package/dist/hooks/use-notification-reminder-rule.d.ts.map +1 -0
  18. package/dist/hooks/use-notification-reminder-rule.js +12 -0
  19. package/dist/hooks/use-notification-reminder-rules.d.ts +26 -0
  20. package/dist/hooks/use-notification-reminder-rules.d.ts.map +1 -0
  21. package/dist/hooks/use-notification-reminder-rules.js +12 -0
  22. package/dist/hooks/use-notification-reminder-runs.d.ts +57 -0
  23. package/dist/hooks/use-notification-reminder-runs.d.ts.map +1 -0
  24. package/dist/hooks/use-notification-reminder-runs.js +12 -0
  25. package/dist/hooks/use-notification-template-authoring.d.ts +5 -0
  26. package/dist/hooks/use-notification-template-authoring.d.ts.map +1 -0
  27. package/dist/hooks/use-notification-template-authoring.js +8 -0
  28. package/dist/hooks/use-notification-template-mutation.d.ts +54 -0
  29. package/dist/hooks/use-notification-template-mutation.d.ts.map +1 -0
  30. package/dist/hooks/use-notification-template-mutation.js +31 -0
  31. package/dist/hooks/use-notification-template-tools.d.ts +80 -0
  32. package/dist/hooks/use-notification-template-tools.d.ts.map +1 -0
  33. package/dist/hooks/use-notification-template-tools.js +21 -0
  34. package/dist/hooks/use-notification-template.d.ts +20 -0
  35. package/dist/hooks/use-notification-template.d.ts.map +1 -0
  36. package/dist/hooks/use-notification-template.js +12 -0
  37. package/dist/hooks/use-notification-templates.d.ts +26 -0
  38. package/dist/hooks/use-notification-templates.d.ts.map +1 -0
  39. package/dist/hooks/use-notification-templates.js +12 -0
  40. package/dist/index.d.ts +7 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +6 -0
  43. package/dist/provider.d.ts +2 -0
  44. package/dist/provider.d.ts.map +1 -0
  45. package/dist/provider.js +1 -0
  46. package/dist/query-keys.d.ts +63 -0
  47. package/dist/query-keys.d.ts.map +1 -0
  48. package/dist/query-keys.js +15 -0
  49. package/dist/query-options.d.ts +979 -0
  50. package/dist/query-options.d.ts.map +1 -0
  51. package/dist/query-options.js +79 -0
  52. package/dist/schemas.d.ts +515 -0
  53. package/dist/schemas.d.ts.map +1 -0
  54. package/dist/schemas.js +89 -0
  55. package/package.json +79 -0
@@ -0,0 +1,89 @@
1
+ import { notificationChannelSchema, notificationDeliveryStatusSchema, notificationReminderRunRecordSchema, notificationReminderRunStatusSchema, notificationReminderStatusSchema, notificationReminderTargetTypeSchema, notificationTargetTypeSchema, previewNotificationTemplateResultSchema as notificationTemplatePreviewRecordSchema, notificationTemplateStatusSchema, } from "@voyantjs/notifications";
2
+ import { z } from "zod";
3
+ export const paginatedEnvelope = (item) => z.object({
4
+ data: z.array(item),
5
+ total: z.number().int(),
6
+ limit: z.number().int(),
7
+ offset: z.number().int(),
8
+ });
9
+ export const singleEnvelope = (item) => z.object({ data: item });
10
+ export const successEnvelope = z.object({ success: z.boolean() });
11
+ export const notificationTemplateRecordSchema = z.object({
12
+ id: z.string(),
13
+ slug: z.string(),
14
+ name: z.string(),
15
+ channel: notificationChannelSchema,
16
+ provider: z.string().nullable(),
17
+ status: notificationTemplateStatusSchema,
18
+ subjectTemplate: z.string().nullable(),
19
+ htmlTemplate: z.string().nullable(),
20
+ textTemplate: z.string().nullable(),
21
+ fromAddress: z.string().nullable(),
22
+ isSystem: z.boolean(),
23
+ metadata: z.record(z.string(), z.unknown()).nullable(),
24
+ createdAt: z.string(),
25
+ updatedAt: z.string(),
26
+ });
27
+ export const notificationDeliveryRecordSchema = z.object({
28
+ id: z.string(),
29
+ templateId: z.string().nullable(),
30
+ templateSlug: z.string().nullable(),
31
+ targetType: notificationTargetTypeSchema,
32
+ targetId: z.string().nullable(),
33
+ personId: z.string().nullable(),
34
+ organizationId: z.string().nullable(),
35
+ bookingId: z.string().nullable(),
36
+ invoiceId: z.string().nullable(),
37
+ paymentSessionId: z.string().nullable(),
38
+ channel: notificationChannelSchema,
39
+ provider: z.string(),
40
+ providerMessageId: z.string().nullable(),
41
+ status: notificationDeliveryStatusSchema,
42
+ toAddress: z.string(),
43
+ fromAddress: z.string().nullable(),
44
+ subject: z.string().nullable(),
45
+ htmlBody: z.string().nullable(),
46
+ textBody: z.string().nullable(),
47
+ payloadData: z.record(z.string(), z.unknown()).nullable(),
48
+ metadata: z.record(z.string(), z.unknown()).nullable(),
49
+ errorMessage: z.string().nullable(),
50
+ scheduledFor: z.string().nullable(),
51
+ sentAt: z.string().nullable(),
52
+ failedAt: z.string().nullable(),
53
+ createdAt: z.string(),
54
+ updatedAt: z.string(),
55
+ });
56
+ export const notificationReminderRuleRecordSchema = z.object({
57
+ id: z.string(),
58
+ slug: z.string(),
59
+ name: z.string(),
60
+ status: notificationReminderStatusSchema,
61
+ targetType: notificationReminderTargetTypeSchema,
62
+ channel: notificationChannelSchema,
63
+ provider: z.string().nullable(),
64
+ templateId: z.string().nullable(),
65
+ templateSlug: z.string().nullable(),
66
+ relativeDaysFromDueDate: z.number().int(),
67
+ isSystem: z.boolean(),
68
+ metadata: z.record(z.string(), z.unknown()).nullable(),
69
+ createdAt: z.string(),
70
+ updatedAt: z.string(),
71
+ });
72
+ export const notificationTemplateListResponse = paginatedEnvelope(notificationTemplateRecordSchema);
73
+ export const notificationTemplateSingleResponse = singleEnvelope(notificationTemplateRecordSchema);
74
+ export const notificationDeliveryListResponse = paginatedEnvelope(notificationDeliveryRecordSchema);
75
+ export const notificationDeliverySingleResponse = singleEnvelope(notificationDeliveryRecordSchema);
76
+ export const notificationReminderRuleListResponse = paginatedEnvelope(notificationReminderRuleRecordSchema);
77
+ export const notificationReminderRuleSingleResponse = singleEnvelope(notificationReminderRuleRecordSchema);
78
+ export const notificationReminderRunListResponse = z.object({
79
+ data: z.array(notificationReminderRunRecordSchema),
80
+ total: z.number().int(),
81
+ limit: z.number().int(),
82
+ offset: z.number().int(),
83
+ });
84
+ export const notificationReminderRunSingleResponse = singleEnvelope(notificationReminderRunRecordSchema);
85
+ export const notificationTemplatePreviewResponse = singleEnvelope(notificationTemplatePreviewRecordSchema);
86
+ export const notificationProviderOptionSchema = z.enum(["automatic", "resend", "twilio"]);
87
+ export const notificationTemplateEditorChannelSchema = notificationChannelSchema;
88
+ export const notificationReminderRuleStatusFilterSchema = notificationReminderStatusSchema;
89
+ export const notificationReminderRunStatusFilterSchema = notificationReminderRunStatusSchema;
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@voyantjs/notifications-react",
3
+ "version": "0.6.8",
4
+ "license": "FSL-1.1-Apache-2.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/voyantjs/voyant.git",
8
+ "directory": "packages/notifications-react"
9
+ },
10
+ "type": "module",
11
+ "exports": {
12
+ ".": "./src/index.ts",
13
+ "./provider": "./src/provider.tsx",
14
+ "./hooks": "./src/hooks/index.ts",
15
+ "./client": "./src/client.ts",
16
+ "./query-keys": "./src/query-keys.ts"
17
+ },
18
+ "scripts": {
19
+ "build": "tsc -p tsconfig.json",
20
+ "clean": "rm -rf dist",
21
+ "prepack": "pnpm run build",
22
+ "typecheck": "tsc --noEmit",
23
+ "lint": "biome check src/",
24
+ "test": "vitest run --passWithNoTests"
25
+ },
26
+ "peerDependencies": {
27
+ "@voyantjs/notifications": "workspace:*",
28
+ "@tanstack/react-query": "^5.0.0",
29
+ "react": "^19.0.0",
30
+ "react-dom": "^19.0.0",
31
+ "zod": "^4.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@tanstack/react-query": "^5.96.2",
35
+ "@types/react": "^19.2.14",
36
+ "@types/react-dom": "^19.2.3",
37
+ "@voyantjs/notifications": "workspace:*",
38
+ "@voyantjs/react": "workspace:*",
39
+ "@voyantjs/voyant-typescript-config": "workspace:*",
40
+ "react": "^19.2.4",
41
+ "react-dom": "^19.2.4",
42
+ "typescript": "^6.0.2",
43
+ "vitest": "^4.1.2",
44
+ "zod": "^4.3.6"
45
+ },
46
+ "dependencies": {
47
+ "@voyantjs/react": "workspace:*"
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "exports": {
55
+ ".": {
56
+ "types": "./dist/index.d.ts",
57
+ "import": "./dist/index.js"
58
+ },
59
+ "./provider": {
60
+ "types": "./dist/provider.d.ts",
61
+ "import": "./dist/provider.js"
62
+ },
63
+ "./hooks": {
64
+ "types": "./dist/hooks/index.d.ts",
65
+ "import": "./dist/hooks/index.js"
66
+ },
67
+ "./client": {
68
+ "types": "./dist/client.d.ts",
69
+ "import": "./dist/client.js"
70
+ },
71
+ "./query-keys": {
72
+ "types": "./dist/query-keys.d.ts",
73
+ "import": "./dist/query-keys.js"
74
+ }
75
+ },
76
+ "main": "./dist/index.js",
77
+ "types": "./dist/index.d.ts"
78
+ }
79
+ }