@krak-stack/notifications-admin 0.0.0-stage → 0.1.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.
@@ -0,0 +1,134 @@
1
+ // ../../src/components/ui/button.tsx
2
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
3
+ import { cva } from "class-variance-authority";
4
+
5
+ // ../../src/lib/utils.ts
6
+ import { cn } from "cn";
7
+
8
+ // ../../src/components/ui/button.tsx
9
+ import { jsx } from "react/jsx-runtime";
10
+ var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
11
+ variants: {
12
+ variant: {
13
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
14
+ outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
15
+ secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
16
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
17
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
18
+ link: "text-primary underline-offset-4 hover:underline"
19
+ },
20
+ size: {
21
+ default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
22
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
23
+ sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
24
+ lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
25
+ icon: "size-9",
26
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
27
+ "icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
28
+ "icon-lg": "size-10"
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ variant: "default",
33
+ size: "default"
34
+ }
35
+ });
36
+ function Button({
37
+ className,
38
+ variant = "default",
39
+ size = "default",
40
+ ...props
41
+ }) {
42
+ return /* @__PURE__ */ jsx(ButtonPrimitive, {
43
+ "data-slot": "button",
44
+ className: cn(buttonVariants({ variant, size, className })),
45
+ ...props
46
+ });
47
+ }
48
+
49
+ // ../../src/components/ui/dialog.tsx
50
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
51
+ import { XIcon } from "lucide-react";
52
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
53
+ function Dialog({ ...props }) {
54
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Root, {
55
+ "data-slot": "dialog",
56
+ ...props
57
+ });
58
+ }
59
+ function DialogPortal({ ...props }) {
60
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Portal, {
61
+ "data-slot": "dialog-portal",
62
+ ...props
63
+ });
64
+ }
65
+ function DialogOverlay({
66
+ className,
67
+ ...props
68
+ }) {
69
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Backdrop, {
70
+ "data-slot": "dialog-overlay",
71
+ className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
72
+ ...props
73
+ });
74
+ }
75
+ function DialogContent({
76
+ className,
77
+ children,
78
+ ...props
79
+ }) {
80
+ return /* @__PURE__ */ jsxs(DialogPortal, {
81
+ children: [
82
+ /* @__PURE__ */ jsx2(DialogOverlay, {}),
83
+ /* @__PURE__ */ jsxs(DialogPrimitive.Popup, {
84
+ "data-slot": "dialog-content",
85
+ className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
86
+ ...props,
87
+ children: [
88
+ children,
89
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
90
+ className: "focus-visible:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none",
91
+ children: [
92
+ /* @__PURE__ */ jsx2(XIcon, {
93
+ className: "size-4"
94
+ }),
95
+ /* @__PURE__ */ jsx2("span", {
96
+ className: "sr-only",
97
+ children: "Close"
98
+ })
99
+ ]
100
+ })
101
+ ]
102
+ })
103
+ ]
104
+ });
105
+ }
106
+ function DialogHeader({ className, ...props }) {
107
+ return /* @__PURE__ */ jsx2("div", {
108
+ "data-slot": "dialog-header",
109
+ className: cn("grid gap-1.5", className),
110
+ ...props
111
+ });
112
+ }
113
+ function DialogTitle({
114
+ className,
115
+ ...props
116
+ }) {
117
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Title, {
118
+ "data-slot": "dialog-title",
119
+ className: cn("text-lg font-medium", className),
120
+ ...props
121
+ });
122
+ }
123
+ function DialogDescription({
124
+ className,
125
+ ...props
126
+ }) {
127
+ return /* @__PURE__ */ jsx2(DialogPrimitive.Description, {
128
+ "data-slot": "dialog-description",
129
+ className: cn("text-sm text-muted-foreground", className),
130
+ ...props
131
+ });
132
+ }
133
+
134
+ export { cn, Button, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription };
@@ -0,0 +1,96 @@
1
+ import { Atom, AsyncResult } from "effect/reactivity";
2
+ import { TableState } from "@krak-stack/notifications/admin/table.schema";
3
+ export declare const makeSendContactAtoms: (baseUrl: string) => {
4
+ contacts: (arg: string) => Atom.Writable<AsyncResult.AsyncResult<{
5
+ items: readonly {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ readonly locale: "en" | "fr";
9
+ readonly email: string;
10
+ readonly emailConsent: "subscribed" | "unknown" | "unsubscribed";
11
+ readonly createdAt: Date;
12
+ readonly updatedAt: Date;
13
+ }[];
14
+ total: number;
15
+ nextCursor: null;
16
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>, Atom.Atom<AsyncResult.AsyncResult<AsyncResult.AsyncResult<{
17
+ items: readonly {
18
+ readonly id: string;
19
+ readonly name: string;
20
+ readonly locale: "en" | "fr";
21
+ readonly email: string;
22
+ readonly emailConsent: "subscribed" | "unknown" | "unsubscribed";
23
+ readonly createdAt: Date;
24
+ readonly updatedAt: Date;
25
+ }[];
26
+ total: number;
27
+ nextCursor: null;
28
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>, unknown>>>;
29
+ contact: (arg: string) => Atom.Writable<AsyncResult.AsyncResult<{
30
+ readonly id: string;
31
+ readonly name: string;
32
+ readonly locale: "en" | "fr";
33
+ readonly email: string;
34
+ readonly emailConsent: "subscribed" | "unknown" | "unsubscribed";
35
+ readonly createdAt: Date;
36
+ readonly updatedAt: Date;
37
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendNotFound | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>, Atom.Atom<AsyncResult.AsyncResult<AsyncResult.AsyncResult<{
38
+ readonly id: string;
39
+ readonly name: string;
40
+ readonly locale: "en" | "fr";
41
+ readonly email: string;
42
+ readonly emailConsent: "subscribed" | "unknown" | "unsubscribed";
43
+ readonly createdAt: Date;
44
+ readonly updatedAt: Date;
45
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendNotFound | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>, unknown>>>;
46
+ history: (id: string, table?: typeof TableState.Type) => Atom.Writable<AsyncResult.AsyncResult<{
47
+ items: readonly {
48
+ readonly requestId: string;
49
+ readonly status: "subscribed" | "unsubscribed";
50
+ readonly noticeVersion: string;
51
+ readonly contactId: string;
52
+ readonly source: string;
53
+ readonly actor: string;
54
+ readonly occurredAt: Date;
55
+ }[];
56
+ total: number;
57
+ nextCursor: null;
58
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendNotFound | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>, Atom.Atom<AsyncResult.AsyncResult<AsyncResult.AsyncResult<{
59
+ items: readonly {
60
+ readonly requestId: string;
61
+ readonly status: "subscribed" | "unsubscribed";
62
+ readonly noticeVersion: string;
63
+ readonly contactId: string;
64
+ readonly source: string;
65
+ readonly actor: string;
66
+ readonly occurredAt: Date;
67
+ }[];
68
+ total: number;
69
+ nextCursor: null;
70
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendNotFound | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>, unknown>>>;
71
+ create: Atom.AtomResultFn<{
72
+ readonly email: string;
73
+ readonly name?: string | undefined;
74
+ readonly locale?: "en" | "fr" | undefined;
75
+ }, {
76
+ readonly id: string;
77
+ readonly name: string;
78
+ readonly locale: "en" | "fr";
79
+ readonly email: string;
80
+ readonly emailConsent: "subscribed" | "unknown" | "unsubscribed";
81
+ readonly createdAt: Date;
82
+ readonly updatedAt: Date;
83
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendConflict | import("@krak-stack/notifications/admin/schema").SendNotFound | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>;
84
+ withdraw: (arg: string) => Atom.AtomResultFn<{
85
+ contactId: string;
86
+ requestId: string;
87
+ }, {
88
+ readonly requestId: string;
89
+ readonly status: "subscribed" | "unsubscribed";
90
+ readonly noticeVersion: string;
91
+ readonly contactId: string;
92
+ readonly source: string;
93
+ readonly actor: string;
94
+ readonly occurredAt: Date;
95
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendConflict | import("@krak-stack/notifications/admin/schema").SendNotFound | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>;
96
+ };
@@ -0,0 +1,67 @@
1
+ import { CreateContact, type Contact, type ContactPage, type EmailConsentEvent, type ConsentEventPage } from "@krak-stack/notifications/admin/schema";
2
+ import type { DataTableProps } from "@krak-stack/registry/data-table";
3
+ export { SendContacts as NotificationContacts, SendContactDetails as NotificationContactDetails, };
4
+ export type { SendContactsProps as NotificationContactsProps, SendContactsMessages as NotificationContactsMessages, };
5
+ export interface SendContactsMessages {
6
+ readonly title: string;
7
+ readonly description: string;
8
+ readonly create: string;
9
+ readonly name: string;
10
+ readonly email: string;
11
+ readonly consent: string;
12
+ readonly unknown: string;
13
+ readonly subscribed: string;
14
+ readonly unsubscribed: string;
15
+ readonly withdraw: string;
16
+ readonly save: string;
17
+ readonly savingFailed: string;
18
+ readonly loading: string;
19
+ readonly empty: string;
20
+ readonly previous: string;
21
+ readonly next: string;
22
+ }
23
+ export interface SendContactsProps {
24
+ readonly table?: Pick<DataTableProps<Contact>, "state" | "onStateChange" | "features" | "status">;
25
+ readonly page: typeof ContactPage.Type | undefined;
26
+ readonly pending?: boolean;
27
+ readonly error?: string;
28
+ readonly messages: SendContactsMessages;
29
+ readonly defaultContactLocale: "en" | "fr";
30
+ readonly onCreate: (input: CreateContact) => Promise<Contact | void>;
31
+ readonly onWithdraw: (contact: Contact) => Promise<typeof EmailConsentEvent.Type | void>;
32
+ readonly inspection?: {
33
+ readonly label: string;
34
+ readonly onSelect: (contact: Contact) => void;
35
+ };
36
+ }
37
+ export declare const SendContacts: ({ page, pending, error, messages, defaultContactLocale, onCreate, onWithdraw, inspection, table, }: SendContactsProps) => import("react").JSX.Element;
38
+ export interface SendContactDetailsMessages {
39
+ readonly title: string;
40
+ readonly id: string;
41
+ readonly email: string;
42
+ readonly name: string;
43
+ readonly locale: string;
44
+ readonly consent: string;
45
+ readonly created: string;
46
+ readonly updated: string;
47
+ readonly requestId: string;
48
+ readonly status: string;
49
+ readonly source: string;
50
+ readonly actor: string;
51
+ readonly noticeVersion: string;
52
+ readonly occurred: string;
53
+ readonly previous: string;
54
+ readonly next: string;
55
+ readonly close: string;
56
+ readonly activity: string;
57
+ readonly states: Readonly<Record<Contact["emailConsent"], string>>;
58
+ }
59
+ export declare const SendContactDetails: ({ contact, history, messages: m, error, onClose, onActivity, table, }: {
60
+ contact: Contact | undefined;
61
+ history: typeof ConsentEventPage.Type | undefined;
62
+ table?: Pick<DataTableProps<typeof EmailConsentEvent.Type>, "state" | "onStateChange" | "features" | "status">;
63
+ messages: SendContactDetailsMessages;
64
+ error?: string;
65
+ onClose: () => void;
66
+ onActivity: (id: string) => void;
67
+ }) => import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import {
2
+ SendContacts2,
3
+ SendContactDetails2
4
+ } from "./chunk-t0qhq7pj.js";
5
+ import"./chunk-tck9drx2.js";
6
+ export {
7
+ SendContactDetails2 as NotificationContactDetails,
8
+ SendContacts2 as NotificationContacts,
9
+ SendContactDetails2 as SendContactDetails,
10
+ SendContacts2 as SendContacts
11
+ };
@@ -0,0 +1,42 @@
1
+ import type * as S from "@krak-stack/notifications/admin/delivery.schema";
2
+ import { type DataTablePublicState } from "@krak-stack/registry/data-table";
3
+ import type { SendOperationsMessages } from "./operations.js";
4
+ export interface NotificationDeliveryMessages {
5
+ readonly common: SendOperationsMessages;
6
+ readonly title: string;
7
+ readonly description: string;
8
+ readonly source: string;
9
+ readonly sources: Readonly<Record<typeof S.DeliverySource.Type, string>>;
10
+ readonly recipientUserId: string;
11
+ readonly organizationId: string;
12
+ readonly workspaceId: string;
13
+ readonly template: string;
14
+ readonly purposes: Readonly<Record<(typeof S.AdminDelivery.Type)["purpose"], string>>;
15
+ readonly eventKey: string;
16
+ readonly references: string;
17
+ readonly feedbackNotice: string;
18
+ readonly feedbackCovered: string;
19
+ readonly feedbackUnavailable: string;
20
+ }
21
+ export interface NotificationDeliveriesProps {
22
+ readonly messages: NotificationDeliveryMessages;
23
+ readonly source: typeof S.DeliverySource.Type;
24
+ readonly onSource: (source: typeof S.DeliverySource.Type) => void;
25
+ readonly view: "overview" | "activity";
26
+ readonly onView: (view: "overview" | "activity") => void;
27
+ readonly overview?: typeof S.DeliveryOverview.Type;
28
+ readonly activity?: typeof S.AdminDeliveryPage.Type;
29
+ readonly table: DataTablePublicState;
30
+ readonly total: number;
31
+ readonly onTable: (table: DataTablePublicState) => void;
32
+ readonly pending: boolean;
33
+ readonly error?: string;
34
+ readonly inspection?: typeof S.AdminDeliveryInspection.Type;
35
+ readonly inspecting: boolean;
36
+ readonly inspectionError?: string;
37
+ readonly onInspect: (id: string | undefined) => void;
38
+ readonly onRefresh: () => void;
39
+ readonly onContact?: (id: string) => void;
40
+ readonly onCampaign?: (id: string) => void;
41
+ }
42
+ export declare const NotificationDeliveries: (p: NotificationDeliveriesProps) => import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import {
2
+ NotificationDeliveries2
3
+ } from "./chunk-nk9ge6g9.js";
4
+ import"./chunk-tck9drx2.js";
5
+ export {
6
+ NotificationDeliveries2 as NotificationDeliveries
7
+ };
@@ -0,0 +1,196 @@
1
+ import { Atom, AsyncResult } from "effect/reactivity";
2
+ import { type DeliveryOverview, type AdminDeliveryPage } from "@krak-stack/notifications/admin/delivery.schema";
3
+ import { NotificationScope } from "@krak-stack/notifications/schema";
4
+ export declare const deliveryQueryKey: (input: {
5
+ readonly view: "activity" | "overview";
6
+ readonly source?: "all" | "contacts" | "engine" | undefined;
7
+ readonly scope?: {
8
+ readonly recipientUserId: string | null;
9
+ readonly organizationId: string | null;
10
+ readonly workspaceId: string | null;
11
+ } | undefined;
12
+ readonly table: {
13
+ readonly page: number;
14
+ readonly pageSize: number;
15
+ readonly globalFilter?: string | undefined;
16
+ readonly filters?: readonly ({
17
+ readonly id: string;
18
+ readonly kind: "text";
19
+ readonly operator: "contains" | "endsWith" | "equals" | "startsWith";
20
+ readonly value: string;
21
+ } | {
22
+ readonly id: string;
23
+ readonly kind: "values";
24
+ readonly values: readonly [string, ...string[]];
25
+ } | {
26
+ readonly id: string;
27
+ readonly kind: "boolean";
28
+ readonly value: boolean;
29
+ } | {
30
+ readonly id: string;
31
+ readonly kind: "number";
32
+ readonly min?: number | undefined;
33
+ readonly max?: number | undefined;
34
+ } | {
35
+ readonly id: string;
36
+ readonly kind: "date";
37
+ readonly from?: string | undefined;
38
+ readonly to?: string | undefined;
39
+ })[] | undefined;
40
+ readonly sort?: readonly {
41
+ readonly id: string;
42
+ readonly direction: "asc" | "desc";
43
+ }[] | undefined;
44
+ };
45
+ }, options?: import("effect/SchemaAST").ParseOptions) => string;
46
+ export declare const deliveryInspectionKey: (input: {
47
+ readonly id: string;
48
+ readonly queryKey: string;
49
+ }, options?: import("effect/SchemaAST").ParseOptions) => string;
50
+ interface Data {
51
+ readonly overview?: typeof DeliveryOverview.Type;
52
+ readonly activity?: typeof AdminDeliveryPage.Type;
53
+ }
54
+ interface Resource {
55
+ readonly atom: Atom.Atom<AsyncResult.AsyncResult<Data, unknown>>;
56
+ readonly refresh: Atom.Atom<unknown>;
57
+ }
58
+ export declare const makeNotificationDeliveryAtoms: (options: {
59
+ baseUrl: string;
60
+ authorizationKey: string;
61
+ scope?: NotificationScope;
62
+ }) => {
63
+ query: (arg: string) => Resource;
64
+ inspection: (arg: string) => Atom.Writable<AsyncResult.AsyncResult<{
65
+ readonly delivery: {
66
+ readonly id: string;
67
+ readonly source: "contacts" | "engine";
68
+ readonly recipientUserId: string | null;
69
+ readonly organizationId: string | null;
70
+ readonly workspaceId: string | null;
71
+ readonly contactId: string | null;
72
+ readonly campaignId: string | null;
73
+ readonly campaignName: string | null;
74
+ readonly recipientAddress: string;
75
+ readonly recipientName: string | null;
76
+ readonly eventKey: string;
77
+ readonly purpose: "marketing" | "notification" | "transactional";
78
+ readonly template: string | null;
79
+ readonly status: "cancelled" | "failed" | "processing" | "queued" | "retrying" | "sent" | "suppressed";
80
+ readonly attempts: number;
81
+ readonly maxAttempts: number;
82
+ readonly provider: string | null;
83
+ readonly providerMessageId: string | null;
84
+ readonly errorMessage: string | null;
85
+ readonly createdAt: Date;
86
+ readonly updatedAt: Date;
87
+ readonly scheduledFor: Date;
88
+ readonly sentAt: Date | null;
89
+ };
90
+ readonly attempts: readonly {
91
+ readonly id: string;
92
+ readonly deliveryId: string;
93
+ readonly jobId: string;
94
+ readonly generation: number;
95
+ readonly attempt: number;
96
+ readonly outcome: {
97
+ readonly _tag: "Sent";
98
+ readonly provider: string;
99
+ readonly providerMessageId: string | null;
100
+ } | {
101
+ readonly _tag: "RetryableFailure";
102
+ readonly message: string;
103
+ readonly retryAfter: Date | null;
104
+ } | {
105
+ readonly _tag: "PermanentFailure";
106
+ readonly message: string;
107
+ } | {
108
+ readonly _tag: "Unavailable";
109
+ readonly message: string;
110
+ readonly retryAfter: Date | null;
111
+ } | {
112
+ readonly _tag: "Skipped";
113
+ readonly reason: "cancelled" | "deferred" | "expired" | "stale" | "suppressed" | "terminal";
114
+ } | null;
115
+ readonly queuedAt: Date;
116
+ readonly startedAt: Date | null;
117
+ readonly completedAt: Date | null;
118
+ readonly createdAt: Date;
119
+ }[];
120
+ readonly references: readonly {
121
+ readonly deliveryId: string;
122
+ readonly namespace: string;
123
+ readonly value: string;
124
+ readonly createdAt: Date;
125
+ }[];
126
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendNotFound | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>, Atom.Atom<AsyncResult.AsyncResult<AsyncResult.AsyncResult<{
127
+ readonly delivery: {
128
+ readonly id: string;
129
+ readonly source: "contacts" | "engine";
130
+ readonly recipientUserId: string | null;
131
+ readonly organizationId: string | null;
132
+ readonly workspaceId: string | null;
133
+ readonly contactId: string | null;
134
+ readonly campaignId: string | null;
135
+ readonly campaignName: string | null;
136
+ readonly recipientAddress: string;
137
+ readonly recipientName: string | null;
138
+ readonly eventKey: string;
139
+ readonly purpose: "marketing" | "notification" | "transactional";
140
+ readonly template: string | null;
141
+ readonly status: "cancelled" | "failed" | "processing" | "queued" | "retrying" | "sent" | "suppressed";
142
+ readonly attempts: number;
143
+ readonly maxAttempts: number;
144
+ readonly provider: string | null;
145
+ readonly providerMessageId: string | null;
146
+ readonly errorMessage: string | null;
147
+ readonly createdAt: Date;
148
+ readonly updatedAt: Date;
149
+ readonly scheduledFor: Date;
150
+ readonly sentAt: Date | null;
151
+ };
152
+ readonly attempts: readonly {
153
+ readonly id: string;
154
+ readonly deliveryId: string;
155
+ readonly jobId: string;
156
+ readonly generation: number;
157
+ readonly attempt: number;
158
+ readonly outcome: {
159
+ readonly _tag: "Sent";
160
+ readonly provider: string;
161
+ readonly providerMessageId: string | null;
162
+ } | {
163
+ readonly _tag: "RetryableFailure";
164
+ readonly message: string;
165
+ readonly retryAfter: Date | null;
166
+ } | {
167
+ readonly _tag: "PermanentFailure";
168
+ readonly message: string;
169
+ } | {
170
+ readonly _tag: "Unavailable";
171
+ readonly message: string;
172
+ readonly retryAfter: Date | null;
173
+ } | {
174
+ readonly _tag: "Skipped";
175
+ readonly reason: "cancelled" | "deferred" | "expired" | "stale" | "suppressed" | "terminal";
176
+ } | null;
177
+ readonly queuedAt: Date;
178
+ readonly startedAt: Date | null;
179
+ readonly completedAt: Date | null;
180
+ readonly createdAt: Date;
181
+ }[];
182
+ readonly references: readonly {
183
+ readonly deliveryId: string;
184
+ readonly namespace: string;
185
+ readonly value: string;
186
+ readonly createdAt: Date;
187
+ }[];
188
+ }, import("effect/http-api/HttpApiError").Forbidden | import("effect/http-api/HttpApiError").InternalServerError | import("@krak-stack/notifications/admin/schema").SendNotFound | import("@krak-stack/notifications/admin/schema").SendValidationError | import("effect/http-api/HttpApiError").Unauthorized>, unknown>>>;
189
+ authorizationKey: string;
190
+ scope: {
191
+ readonly recipientUserId: string | null;
192
+ readonly organizationId: string | null;
193
+ readonly workspaceId: string | null;
194
+ } | undefined;
195
+ };
196
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from "./contacts.js";
2
+ export * from "./campaigns.js";
3
+ export * from "./operations.js";
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ import"./chunk-tck9drx2.js";
2
+ import {
3
+ SendContacts2,
4
+ SendContactDetails2
5
+ } from "./chunk-t0qhq7pj.js";
6
+ import {
7
+ SendCampaignAdmin2
8
+ } from "./chunk-dxjvd9tb.js";
9
+ import {
10
+ NotificationDeliveries2
11
+ } from "./chunk-nk9ge6g9.js";
12
+ import {
13
+ SendOperationsAdmin2
14
+ } from "./chunk-8nawv50q.js";
15
+ export {
16
+ SendCampaignAdmin2 as NotificationCampaigns,
17
+ SendContactDetails2 as NotificationContactDetails,
18
+ SendContacts2 as NotificationContacts,
19
+ NotificationDeliveries2 as NotificationDeliveries,
20
+ SendOperationsAdmin2 as NotificationOperations,
21
+ SendCampaignAdmin2 as SendCampaignAdmin,
22
+ SendContactDetails2 as SendContactDetails,
23
+ SendContacts2 as SendContacts,
24
+ SendOperationsAdmin2 as SendOperationsAdmin
25
+ };