@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,281 @@
1
+ import { Atom, AsyncResult } from "effect/reactivity";
2
+ export declare const makeSendCampaignAtoms: (baseUrl: string) => {
3
+ campaigns: (arg: string) => Atom.Writable<AsyncResult.AsyncResult<{
4
+ items: readonly {
5
+ readonly id: string;
6
+ readonly name: string;
7
+ readonly from: string;
8
+ readonly audience: {
9
+ readonly _tag: "AllSubscribed";
10
+ } | {
11
+ readonly _tag: "Contacts";
12
+ readonly ids: readonly string[];
13
+ };
14
+ readonly content: {
15
+ readonly en: {
16
+ readonly subject: string;
17
+ readonly text: string;
18
+ readonly unsubscribeText: string;
19
+ };
20
+ readonly fr: {
21
+ readonly subject: string;
22
+ readonly text: string;
23
+ readonly unsubscribeText: string;
24
+ };
25
+ };
26
+ readonly status: "cancelled" | "completed" | "draft" | "paused" | "running" | "scheduled";
27
+ readonly scheduledFor: Date | null;
28
+ readonly snapshotAt: Date | null;
29
+ readonly batchNumber: number;
30
+ readonly createdAt: Date;
31
+ }[];
32
+ total: number;
33
+ nextCursor: null;
34
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>, Atom.Atom<AsyncResult.AsyncResult<AsyncResult.AsyncResult<{
35
+ items: readonly {
36
+ readonly id: string;
37
+ readonly name: string;
38
+ readonly from: string;
39
+ readonly audience: {
40
+ readonly _tag: "AllSubscribed";
41
+ } | {
42
+ readonly _tag: "Contacts";
43
+ readonly ids: readonly string[];
44
+ };
45
+ readonly content: {
46
+ readonly en: {
47
+ readonly subject: string;
48
+ readonly text: string;
49
+ readonly unsubscribeText: string;
50
+ };
51
+ readonly fr: {
52
+ readonly subject: string;
53
+ readonly text: string;
54
+ readonly unsubscribeText: string;
55
+ };
56
+ };
57
+ readonly status: "cancelled" | "completed" | "draft" | "paused" | "running" | "scheduled";
58
+ readonly scheduledFor: Date | null;
59
+ readonly snapshotAt: Date | null;
60
+ readonly batchNumber: number;
61
+ readonly createdAt: Date;
62
+ }[];
63
+ total: number;
64
+ nextCursor: null;
65
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>, unknown>>>;
66
+ campaign: (arg: string) => Atom.Writable<AsyncResult.AsyncResult<{
67
+ readonly id: string;
68
+ readonly name: string;
69
+ readonly from: string;
70
+ readonly audience: {
71
+ readonly _tag: "AllSubscribed";
72
+ } | {
73
+ readonly _tag: "Contacts";
74
+ readonly ids: readonly string[];
75
+ };
76
+ readonly content: {
77
+ readonly en: {
78
+ readonly subject: string;
79
+ readonly text: string;
80
+ readonly unsubscribeText: string;
81
+ };
82
+ readonly fr: {
83
+ readonly subject: string;
84
+ readonly text: string;
85
+ readonly unsubscribeText: string;
86
+ };
87
+ };
88
+ readonly status: "cancelled" | "completed" | "draft" | "paused" | "running" | "scheduled";
89
+ readonly scheduledFor: Date | null;
90
+ readonly snapshotAt: Date | null;
91
+ readonly batchNumber: number;
92
+ readonly createdAt: Date;
93
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>, Atom.Atom<AsyncResult.AsyncResult<AsyncResult.AsyncResult<{
94
+ readonly id: string;
95
+ readonly name: string;
96
+ readonly from: string;
97
+ readonly audience: {
98
+ readonly _tag: "AllSubscribed";
99
+ } | {
100
+ readonly _tag: "Contacts";
101
+ readonly ids: readonly string[];
102
+ };
103
+ readonly content: {
104
+ readonly en: {
105
+ readonly subject: string;
106
+ readonly text: string;
107
+ readonly unsubscribeText: string;
108
+ };
109
+ readonly fr: {
110
+ readonly subject: string;
111
+ readonly text: string;
112
+ readonly unsubscribeText: string;
113
+ };
114
+ };
115
+ readonly status: "cancelled" | "completed" | "draft" | "paused" | "running" | "scheduled";
116
+ readonly scheduledFor: Date | null;
117
+ readonly snapshotAt: Date | null;
118
+ readonly batchNumber: number;
119
+ readonly createdAt: Date;
120
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>, unknown>>>;
121
+ report: (arg: string) => Atom.Writable<AsyncResult.AsyncResult<{
122
+ readonly audience: number;
123
+ readonly pending: number;
124
+ readonly published: number;
125
+ readonly skipped: number;
126
+ readonly accepted: number;
127
+ readonly failed: number;
128
+ readonly suppressed: number;
129
+ readonly confirmed: number;
130
+ readonly hardBounced: number;
131
+ readonly complained: number;
132
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>, Atom.Atom<AsyncResult.AsyncResult<AsyncResult.AsyncResult<{
133
+ readonly audience: number;
134
+ readonly pending: number;
135
+ readonly published: number;
136
+ readonly skipped: number;
137
+ readonly accepted: number;
138
+ readonly failed: number;
139
+ readonly suppressed: number;
140
+ readonly confirmed: number;
141
+ readonly hardBounced: number;
142
+ readonly complained: number;
143
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>, unknown>>>;
144
+ create: Atom.AtomResultFn<{
145
+ readonly requestId: string;
146
+ readonly name: string;
147
+ readonly from: string;
148
+ readonly audience: {
149
+ readonly _tag: "AllSubscribed";
150
+ } | {
151
+ readonly _tag: "Contacts";
152
+ readonly ids: readonly string[];
153
+ };
154
+ readonly content: {
155
+ readonly en: {
156
+ readonly subject: string;
157
+ readonly text: string;
158
+ readonly unsubscribeText: string;
159
+ };
160
+ readonly fr: {
161
+ readonly subject: string;
162
+ readonly text: string;
163
+ readonly unsubscribeText: string;
164
+ };
165
+ };
166
+ }, {
167
+ readonly id: string;
168
+ readonly name: string;
169
+ readonly from: string;
170
+ readonly audience: {
171
+ readonly _tag: "AllSubscribed";
172
+ } | {
173
+ readonly _tag: "Contacts";
174
+ readonly ids: readonly string[];
175
+ };
176
+ readonly content: {
177
+ readonly en: {
178
+ readonly subject: string;
179
+ readonly text: string;
180
+ readonly unsubscribeText: string;
181
+ };
182
+ readonly fr: {
183
+ readonly subject: string;
184
+ readonly text: string;
185
+ readonly unsubscribeText: string;
186
+ };
187
+ };
188
+ readonly status: "cancelled" | "completed" | "draft" | "paused" | "running" | "scheduled";
189
+ readonly scheduledFor: Date | null;
190
+ readonly snapshotAt: Date | null;
191
+ readonly batchNumber: number;
192
+ readonly createdAt: Date;
193
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>;
194
+ schedule: Atom.AtomResultFn<{
195
+ readonly id: string;
196
+ readonly scheduledFor: Date;
197
+ }, {
198
+ readonly id: string;
199
+ readonly name: string;
200
+ readonly from: string;
201
+ readonly audience: {
202
+ readonly _tag: "AllSubscribed";
203
+ } | {
204
+ readonly _tag: "Contacts";
205
+ readonly ids: readonly string[];
206
+ };
207
+ readonly content: {
208
+ readonly en: {
209
+ readonly subject: string;
210
+ readonly text: string;
211
+ readonly unsubscribeText: string;
212
+ };
213
+ readonly fr: {
214
+ readonly subject: string;
215
+ readonly text: string;
216
+ readonly unsubscribeText: string;
217
+ };
218
+ };
219
+ readonly status: "cancelled" | "completed" | "draft" | "paused" | "running" | "scheduled";
220
+ readonly scheduledFor: Date | null;
221
+ readonly snapshotAt: Date | null;
222
+ readonly batchNumber: number;
223
+ readonly createdAt: Date;
224
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>;
225
+ cancel: Atom.AtomResultFn<string, {
226
+ readonly id: string;
227
+ readonly name: string;
228
+ readonly from: string;
229
+ readonly audience: {
230
+ readonly _tag: "AllSubscribed";
231
+ } | {
232
+ readonly _tag: "Contacts";
233
+ readonly ids: readonly string[];
234
+ };
235
+ readonly content: {
236
+ readonly en: {
237
+ readonly subject: string;
238
+ readonly text: string;
239
+ readonly unsubscribeText: string;
240
+ };
241
+ readonly fr: {
242
+ readonly subject: string;
243
+ readonly text: string;
244
+ readonly unsubscribeText: string;
245
+ };
246
+ };
247
+ readonly status: "cancelled" | "completed" | "draft" | "paused" | "running" | "scheduled";
248
+ readonly scheduledFor: Date | null;
249
+ readonly snapshotAt: Date | null;
250
+ readonly batchNumber: number;
251
+ readonly createdAt: Date;
252
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>;
253
+ transition: (arg: string) => Atom.AtomResultFn<"pause" | "resume", {
254
+ readonly id: string;
255
+ readonly name: string;
256
+ readonly from: string;
257
+ readonly audience: {
258
+ readonly _tag: "AllSubscribed";
259
+ } | {
260
+ readonly _tag: "Contacts";
261
+ readonly ids: readonly string[];
262
+ };
263
+ readonly content: {
264
+ readonly en: {
265
+ readonly subject: string;
266
+ readonly text: string;
267
+ readonly unsubscribeText: string;
268
+ };
269
+ readonly fr: {
270
+ readonly subject: string;
271
+ readonly text: string;
272
+ readonly unsubscribeText: string;
273
+ };
274
+ };
275
+ readonly status: "cancelled" | "completed" | "draft" | "paused" | "running" | "scheduled";
276
+ readonly scheduledFor: Date | null;
277
+ readonly snapshotAt: Date | null;
278
+ readonly batchNumber: number;
279
+ readonly createdAt: Date;
280
+ }, import("@krak-stack/notifications/admin/schema").CampaignSafetyError | 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>;
281
+ };
@@ -0,0 +1,51 @@
1
+ import { type Campaign, type CampaignPage, type CampaignReport, type CampaignStatus, type CampaignTransition, type CreateCampaign, type ScheduleCampaign } from "@krak-stack/notifications/admin/schema";
2
+ import type { DataTableProps } from "@krak-stack/registry/data-table";
3
+ export { SendCampaignAdmin as NotificationCampaigns };
4
+ export type { SendCampaignAdminProps as NotificationCampaignsProps, SendCampaignMessages as NotificationCampaignMessages, };
5
+ export interface SendCampaignMessages {
6
+ readonly title: string;
7
+ readonly description: string;
8
+ readonly create: string;
9
+ readonly name: string;
10
+ readonly from: string;
11
+ readonly subject: string;
12
+ readonly text: string;
13
+ readonly save: string;
14
+ readonly manage: string;
15
+ readonly status: string;
16
+ readonly schedule: string;
17
+ readonly scheduledFor: string;
18
+ readonly pause: string;
19
+ readonly resume: string;
20
+ readonly cancel: string;
21
+ readonly confirmCancel: string;
22
+ readonly cancelDescription: string;
23
+ readonly failed: string;
24
+ readonly empty: string;
25
+ readonly next: string;
26
+ readonly previous: string;
27
+ readonly close: string;
28
+ readonly reporting: string;
29
+ readonly statuses: Readonly<Record<typeof CampaignStatus.Type, string>>;
30
+ readonly metrics: Readonly<Record<keyof typeof CampaignReport.Type, string>>;
31
+ readonly enUnsubscribe: string;
32
+ readonly frUnsubscribe: string;
33
+ readonly english: string;
34
+ readonly french: string;
35
+ }
36
+ export interface SendCampaignAdminProps {
37
+ readonly table?: Pick<DataTableProps<typeof Campaign.Type>, "state" | "onStateChange" | "features" | "status">;
38
+ readonly page: typeof CampaignPage.Type | undefined;
39
+ readonly selected?: typeof Campaign.Type;
40
+ readonly report?: typeof CampaignReport.Type;
41
+ readonly pending?: boolean;
42
+ readonly error?: string;
43
+ readonly messages: SendCampaignMessages;
44
+ readonly onSelect: (campaign: typeof Campaign.Type) => void;
45
+ readonly onClose: () => void;
46
+ readonly onRecipients?: (id: string) => void;
47
+ readonly onCreate: (input: typeof CreateCampaign.Type) => Promise<typeof Campaign.Type | void>;
48
+ readonly onSchedule: (input: typeof ScheduleCampaign.Type) => Promise<typeof Campaign.Type | void>;
49
+ readonly onTransition: (input: typeof CampaignTransition.Type) => Promise<typeof Campaign.Type | void>;
50
+ }
51
+ export declare const SendCampaignAdmin: ({ page, selected, report, pending, error, messages: m, onSelect, onClose, onRecipients, table, onCreate, onSchedule, onTransition, }: SendCampaignAdminProps) => import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import {
2
+ SendCampaignAdmin2
3
+ } from "./chunk-dxjvd9tb.js";
4
+ import"./chunk-tck9drx2.js";
5
+ export {
6
+ SendCampaignAdmin2 as NotificationCampaigns,
7
+ SendCampaignAdmin2 as SendCampaignAdmin
8
+ };