shred-api-client 2.0.9 → 2.0.10-rc.1

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 (127) hide show
  1. package/dist/index.d.mts +2596 -0
  2. package/dist/index.d.ts +2596 -15
  3. package/dist/index.js +1788 -40
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +1747 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +6 -5
  8. package/dist/api/AppConfig.api.d.ts +0 -9
  9. package/dist/api/AppConfig.api.js +0 -42
  10. package/dist/api/Email.api.d.ts +0 -10
  11. package/dist/api/Email.api.js +0 -42
  12. package/dist/api/Goal.api.d.ts +0 -10
  13. package/dist/api/Goal.api.js +0 -42
  14. package/dist/api/Note.api.d.ts +0 -13
  15. package/dist/api/Note.api.js +0 -60
  16. package/dist/api/Notification.api.d.ts +0 -18
  17. package/dist/api/Notification.api.js +0 -80
  18. package/dist/api/Project.api.d.ts +0 -26
  19. package/dist/api/Project.api.js +0 -122
  20. package/dist/api/Prompt.api.d.ts +0 -14
  21. package/dist/api/Prompt.api.js +0 -41
  22. package/dist/api/Subscription.api.d.ts +0 -18
  23. package/dist/api/Subscription.api.js +0 -69
  24. package/dist/api/Tenant.api.d.ts +0 -14
  25. package/dist/api/Tenant.api.js +0 -47
  26. package/dist/api/Track.api.d.ts +0 -9
  27. package/dist/api/Track.api.js +0 -19
  28. package/dist/api/User.api.d.ts +0 -25
  29. package/dist/api/User.api.js +0 -98
  30. package/dist/model/Api.d.ts +0 -26
  31. package/dist/model/Api.js +0 -33
  32. package/dist/model/Context.d.ts +0 -5
  33. package/dist/model/Context.js +0 -2
  34. package/dist/model/Env.d.ts +0 -2
  35. package/dist/model/Env.js +0 -2
  36. package/dist/model/app-config/AppConfig.api.d.ts +0 -9
  37. package/dist/model/app-config/AppConfig.api.js +0 -9
  38. package/dist/model/app-config/index.d.ts +0 -1
  39. package/dist/model/app-config/index.js +0 -17
  40. package/dist/model/asset/Asset.schema.d.ts +0 -43
  41. package/dist/model/asset/Asset.schema.js +0 -19
  42. package/dist/model/asset/index.d.ts +0 -2
  43. package/dist/model/asset/index.js +0 -5
  44. package/dist/model/core/APIResponse.d.ts +0 -6
  45. package/dist/model/core/APIResponse.js +0 -2
  46. package/dist/model/core/Query.d.ts +0 -15
  47. package/dist/model/core/Query.js +0 -2
  48. package/dist/model/core/index.d.ts +0 -2
  49. package/dist/model/core/index.js +0 -18
  50. package/dist/model/email/Email.api.d.ts +0 -11
  51. package/dist/model/email/Email.api.js +0 -9
  52. package/dist/model/email/Email.schema.d.ts +0 -15
  53. package/dist/model/email/Email.schema.js +0 -9
  54. package/dist/model/email/index.d.ts +0 -3
  55. package/dist/model/email/index.js +0 -20
  56. package/dist/model/exceptions/ConflictException.d.ts +0 -4
  57. package/dist/model/exceptions/ConflictException.js +0 -13
  58. package/dist/model/exceptions/ForbiddenException.d.ts +0 -4
  59. package/dist/model/exceptions/ForbiddenException.js +0 -13
  60. package/dist/model/exceptions/InvalidArgumentException.d.ts +0 -4
  61. package/dist/model/exceptions/InvalidArgumentException.js +0 -13
  62. package/dist/model/exceptions/ResourceNotFoundException.d.ts +0 -4
  63. package/dist/model/exceptions/ResourceNotFoundException.js +0 -13
  64. package/dist/model/exceptions/ShredException.d.ts +0 -4
  65. package/dist/model/exceptions/ShredException.js +0 -10
  66. package/dist/model/exceptions/UnauthorizedException.d.ts +0 -4
  67. package/dist/model/exceptions/UnauthorizedException.js +0 -13
  68. package/dist/model/exceptions/index.d.ts +0 -16
  69. package/dist/model/exceptions/index.js +0 -20
  70. package/dist/model/goal/Goal.api.d.ts +0 -11
  71. package/dist/model/goal/Goal.api.js +0 -6
  72. package/dist/model/goal/Goal.schema.d.ts +0 -154
  73. package/dist/model/goal/Goal.schema.js +0 -26
  74. package/dist/model/goal/index.d.ts +0 -3
  75. package/dist/model/goal/index.js +0 -22
  76. package/dist/model/note/Note.api.d.ts +0 -26
  77. package/dist/model/note/Note.api.js +0 -21
  78. package/dist/model/note/Note.schema.d.ts +0 -141
  79. package/dist/model/note/Note.schema.js +0 -30
  80. package/dist/model/note/index.d.ts +0 -3
  81. package/dist/model/note/index.js +0 -21
  82. package/dist/model/notification/Notification.api.d.ts +0 -47
  83. package/dist/model/notification/Notification.api.js +0 -13
  84. package/dist/model/notification/Notification.schema.d.ts +0 -454
  85. package/dist/model/notification/Notification.schema.js +0 -111
  86. package/dist/model/notification/index.d.ts +0 -3
  87. package/dist/model/notification/index.js +0 -30
  88. package/dist/model/project/Project.api.d.ts +0 -83
  89. package/dist/model/project/Project.api.js +0 -26
  90. package/dist/model/project/Project.schema.d.ts +0 -209
  91. package/dist/model/project/Project.schema.js +0 -60
  92. package/dist/model/project/index.d.ts +0 -3
  93. package/dist/model/project/index.js +0 -24
  94. package/dist/model/prompt/Prompt.api.d.ts +0 -31
  95. package/dist/model/prompt/Prompt.api.js +0 -25
  96. package/dist/model/prompt/Prompt.schema.d.ts +0 -165
  97. package/dist/model/prompt/Prompt.schema.js +0 -24
  98. package/dist/model/prompt/index.d.ts +0 -3
  99. package/dist/model/prompt/index.js +0 -22
  100. package/dist/model/subscription/Subscription.api.d.ts +0 -59
  101. package/dist/model/subscription/Subscription.api.js +0 -49
  102. package/dist/model/subscription/Subscription.schema.d.ts +0 -314
  103. package/dist/model/subscription/Subscription.schema.js +0 -53
  104. package/dist/model/subscription/index.d.ts +0 -3
  105. package/dist/model/subscription/index.js +0 -25
  106. package/dist/model/tenant/Tenant.api.d.ts +0 -35
  107. package/dist/model/tenant/Tenant.api.js +0 -29
  108. package/dist/model/tenant/Tenant.schema.d.ts +0 -342
  109. package/dist/model/tenant/Tenant.schema.js +0 -29
  110. package/dist/model/tenant/index.d.ts +0 -3
  111. package/dist/model/tenant/index.js +0 -21
  112. package/dist/model/track/Track.api.d.ts +0 -10
  113. package/dist/model/track/Track.api.js +0 -9
  114. package/dist/model/track/Track.schema.d.ts +0 -44
  115. package/dist/model/track/Track.schema.js +0 -14
  116. package/dist/model/track/index.d.ts +0 -3
  117. package/dist/model/track/index.js +0 -21
  118. package/dist/model/user/User.api.d.ts +0 -86
  119. package/dist/model/user/User.api.js +0 -21
  120. package/dist/model/user/User.schema.d.ts +0 -117
  121. package/dist/model/user/User.schema.js +0 -42
  122. package/dist/model/user/index.d.ts +0 -3
  123. package/dist/model/user/index.js +0 -23
  124. package/dist/util/HTTPClient.d.ts +0 -5
  125. package/dist/util/HTTPClient.js +0 -71
  126. package/dist/util/parseQuery.d.ts +0 -2
  127. package/dist/util/parseQuery.js +0 -25
@@ -1,454 +0,0 @@
1
- import { z } from "zod";
2
- export declare enum Frequency {
3
- DAILY = "daily",
4
- WEEKLY = "weekly",
5
- MONTHLY = "monthly"
6
- }
7
- export declare enum WeekDay {
8
- MONDAY = 1,
9
- TUESDAY = 2,
10
- WEDNESDAY = 3,
11
- THURSDAY = 4,
12
- FRIDAY = 5,
13
- SATURDAY = 6,
14
- SUNDAY = 7
15
- }
16
- export declare enum CriteriaType {
17
- AllUsers = "allUsers",
18
- NoProjects = "noProjects",
19
- NoSubscription = "noSubscription",
20
- UsersFromTier = "usersFromTier"
21
- }
22
- export declare enum TransportType {
23
- Push = "push",
24
- Email = "email"
25
- }
26
- export declare enum Status {
27
- SCHEDULED = "scheduled",
28
- RUNNING = "running",
29
- COMPLETED = "completed",
30
- FAILED = "failed",
31
- PAUSED = "paused",
32
- CANCELLED = "cancelled",
33
- ACTIVE = "active",
34
- EXPIRED = "expired"
35
- }
36
- export declare const NotificationItemSchema: z.ZodObject<{
37
- id: z.ZodString;
38
- userId: z.ZodString;
39
- triggerId: z.ZodOptional<z.ZodString>;
40
- title: z.ZodString;
41
- body: z.ZodString;
42
- status: z.ZodEnum<["failed", "delivered", "deleted"]>;
43
- deliveredAt: z.ZodNumber;
44
- openedAt: z.ZodOptional<z.ZodNumber>;
45
- deletedAt: z.ZodOptional<z.ZodNumber>;
46
- cta: z.ZodOptional<z.ZodObject<{
47
- label: z.ZodString;
48
- url: z.ZodString;
49
- }, "strip", z.ZodTypeAny, {
50
- label: string;
51
- url: string;
52
- }, {
53
- label: string;
54
- url: string;
55
- }>>;
56
- metadata: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
57
- error: z.ZodOptional<z.ZodString>;
58
- }, "strip", z.ZodTypeAny, {
59
- id: string;
60
- userId: string;
61
- title: string;
62
- body: string;
63
- status: "failed" | "delivered" | "deleted";
64
- deliveredAt: number;
65
- metadata: Record<string, string | number>;
66
- triggerId?: string | undefined;
67
- openedAt?: number | undefined;
68
- deletedAt?: number | undefined;
69
- cta?: {
70
- label: string;
71
- url: string;
72
- } | undefined;
73
- error?: string | undefined;
74
- }, {
75
- id: string;
76
- userId: string;
77
- title: string;
78
- body: string;
79
- status: "failed" | "delivered" | "deleted";
80
- deliveredAt: number;
81
- metadata: Record<string, string | number>;
82
- triggerId?: string | undefined;
83
- openedAt?: number | undefined;
84
- deletedAt?: number | undefined;
85
- cta?: {
86
- label: string;
87
- url: string;
88
- } | undefined;
89
- error?: string | undefined;
90
- }>;
91
- export declare const NotificationDetailSchema: z.ZodObject<Pick<{
92
- id: z.ZodString;
93
- userId: z.ZodString;
94
- triggerId: z.ZodOptional<z.ZodString>;
95
- title: z.ZodString;
96
- body: z.ZodString;
97
- status: z.ZodEnum<["failed", "delivered", "deleted"]>;
98
- deliveredAt: z.ZodNumber;
99
- openedAt: z.ZodOptional<z.ZodNumber>;
100
- deletedAt: z.ZodOptional<z.ZodNumber>;
101
- cta: z.ZodOptional<z.ZodObject<{
102
- label: z.ZodString;
103
- url: z.ZodString;
104
- }, "strip", z.ZodTypeAny, {
105
- label: string;
106
- url: string;
107
- }, {
108
- label: string;
109
- url: string;
110
- }>>;
111
- metadata: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
112
- error: z.ZodOptional<z.ZodString>;
113
- }, "userId" | "title" | "body" | "metadata">, "strip", z.ZodTypeAny, {
114
- userId: string;
115
- title: string;
116
- body: string;
117
- metadata: Record<string, string | number>;
118
- }, {
119
- userId: string;
120
- title: string;
121
- body: string;
122
- metadata: Record<string, string | number>;
123
- }>;
124
- export declare const CriteriaSchema: z.ZodObject<{
125
- type: z.ZodNativeEnum<typeof CriteriaType>;
126
- params: z.ZodRecord<z.ZodString, z.ZodAny>;
127
- }, "strip", z.ZodTypeAny, {
128
- params: Record<string, any>;
129
- type: CriteriaType;
130
- }, {
131
- params: Record<string, any>;
132
- type: CriteriaType;
133
- }>;
134
- export declare const HistorySchema: z.ZodObject<{
135
- batchId: z.ZodString;
136
- executedAt: z.ZodNumber;
137
- timezone: z.ZodString;
138
- status: z.ZodEnum<["success", "failed", "info", "warn"]>;
139
- users: z.ZodObject<{
140
- total: z.ZodNumber;
141
- success: z.ZodNumber;
142
- error: z.ZodNumber;
143
- }, "strip", z.ZodTypeAny, {
144
- error: number;
145
- success: number;
146
- total: number;
147
- }, {
148
- error: number;
149
- success: number;
150
- total: number;
151
- }>;
152
- errorList: z.ZodOptional<z.ZodArray<z.ZodObject<{
153
- token: z.ZodString;
154
- error: z.ZodString;
155
- }, "strip", z.ZodTypeAny, {
156
- token: string;
157
- error: string;
158
- }, {
159
- token: string;
160
- error: string;
161
- }>, "many">>;
162
- executionTimeDuration: z.ZodOptional<z.ZodNumber>;
163
- }, "strip", z.ZodTypeAny, {
164
- status: "failed" | "success" | "info" | "warn";
165
- batchId: string;
166
- executedAt: number;
167
- timezone: string;
168
- users: {
169
- error: number;
170
- success: number;
171
- total: number;
172
- };
173
- errorList?: {
174
- token: string;
175
- error: string;
176
- }[] | undefined;
177
- executionTimeDuration?: number | undefined;
178
- }, {
179
- status: "failed" | "success" | "info" | "warn";
180
- batchId: string;
181
- executedAt: number;
182
- timezone: string;
183
- users: {
184
- error: number;
185
- success: number;
186
- total: number;
187
- };
188
- errorList?: {
189
- token: string;
190
- error: string;
191
- }[] | undefined;
192
- executionTimeDuration?: number | undefined;
193
- }>;
194
- export declare const RecurrenceRuleSchema: z.ZodObject<{
195
- frequency: z.ZodNativeEnum<typeof Frequency>;
196
- interval: z.ZodNumber;
197
- weekDays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof WeekDay>, "many">>;
198
- dayOfMonth: z.ZodOptional<z.ZodNumber>;
199
- endDate: z.ZodOptional<z.ZodString>;
200
- ocurrences: z.ZodOptional<z.ZodNumber>;
201
- }, "strip", z.ZodTypeAny, {
202
- frequency: Frequency;
203
- interval: number;
204
- weekDays?: WeekDay[] | undefined;
205
- dayOfMonth?: number | undefined;
206
- endDate?: string | undefined;
207
- ocurrences?: number | undefined;
208
- }, {
209
- frequency: Frequency;
210
- interval: number;
211
- weekDays?: WeekDay[] | undefined;
212
- dayOfMonth?: number | undefined;
213
- endDate?: string | undefined;
214
- ocurrences?: number | undefined;
215
- }>;
216
- export declare const TriggerSchema: z.ZodObject<{
217
- id: z.ZodString;
218
- title: z.ZodString;
219
- description: z.ZodString;
220
- transportType: z.ZodArray<z.ZodNativeEnum<typeof TransportType>, "many">;
221
- notification: z.ZodObject<Pick<{
222
- id: z.ZodString;
223
- userId: z.ZodString;
224
- triggerId: z.ZodOptional<z.ZodString>;
225
- title: z.ZodString;
226
- body: z.ZodString;
227
- status: z.ZodEnum<["failed", "delivered", "deleted"]>;
228
- deliveredAt: z.ZodNumber;
229
- openedAt: z.ZodOptional<z.ZodNumber>;
230
- deletedAt: z.ZodOptional<z.ZodNumber>;
231
- cta: z.ZodOptional<z.ZodObject<{
232
- label: z.ZodString;
233
- url: z.ZodString;
234
- }, "strip", z.ZodTypeAny, {
235
- label: string;
236
- url: string;
237
- }, {
238
- label: string;
239
- url: string;
240
- }>>;
241
- metadata: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
242
- error: z.ZodOptional<z.ZodString>;
243
- }, "userId" | "title" | "body" | "metadata">, "strip", z.ZodTypeAny, {
244
- userId: string;
245
- title: string;
246
- body: string;
247
- metadata: Record<string, string | number>;
248
- }, {
249
- userId: string;
250
- title: string;
251
- body: string;
252
- metadata: Record<string, string | number>;
253
- }>;
254
- history: z.ZodOptional<z.ZodArray<z.ZodObject<{
255
- batchId: z.ZodString;
256
- executedAt: z.ZodNumber;
257
- timezone: z.ZodString;
258
- status: z.ZodEnum<["success", "failed", "info", "warn"]>;
259
- users: z.ZodObject<{
260
- total: z.ZodNumber;
261
- success: z.ZodNumber;
262
- error: z.ZodNumber;
263
- }, "strip", z.ZodTypeAny, {
264
- error: number;
265
- success: number;
266
- total: number;
267
- }, {
268
- error: number;
269
- success: number;
270
- total: number;
271
- }>;
272
- errorList: z.ZodOptional<z.ZodArray<z.ZodObject<{
273
- token: z.ZodString;
274
- error: z.ZodString;
275
- }, "strip", z.ZodTypeAny, {
276
- token: string;
277
- error: string;
278
- }, {
279
- token: string;
280
- error: string;
281
- }>, "many">>;
282
- executionTimeDuration: z.ZodOptional<z.ZodNumber>;
283
- }, "strip", z.ZodTypeAny, {
284
- status: "failed" | "success" | "info" | "warn";
285
- batchId: string;
286
- executedAt: number;
287
- timezone: string;
288
- users: {
289
- error: number;
290
- success: number;
291
- total: number;
292
- };
293
- errorList?: {
294
- token: string;
295
- error: string;
296
- }[] | undefined;
297
- executionTimeDuration?: number | undefined;
298
- }, {
299
- status: "failed" | "success" | "info" | "warn";
300
- batchId: string;
301
- executedAt: number;
302
- timezone: string;
303
- users: {
304
- error: number;
305
- success: number;
306
- total: number;
307
- };
308
- errorList?: {
309
- token: string;
310
- error: string;
311
- }[] | undefined;
312
- executionTimeDuration?: number | undefined;
313
- }>, "many">>;
314
- status: z.ZodNativeEnum<typeof Status>;
315
- recurrence: z.ZodOptional<z.ZodObject<{
316
- frequency: z.ZodNativeEnum<typeof Frequency>;
317
- interval: z.ZodNumber;
318
- weekDays: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof WeekDay>, "many">>;
319
- dayOfMonth: z.ZodOptional<z.ZodNumber>;
320
- endDate: z.ZodOptional<z.ZodString>;
321
- ocurrences: z.ZodOptional<z.ZodNumber>;
322
- }, "strip", z.ZodTypeAny, {
323
- frequency: Frequency;
324
- interval: number;
325
- weekDays?: WeekDay[] | undefined;
326
- dayOfMonth?: number | undefined;
327
- endDate?: string | undefined;
328
- ocurrences?: number | undefined;
329
- }, {
330
- frequency: Frequency;
331
- interval: number;
332
- weekDays?: WeekDay[] | undefined;
333
- dayOfMonth?: number | undefined;
334
- endDate?: string | undefined;
335
- ocurrences?: number | undefined;
336
- }>>;
337
- timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
338
- tenantIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
339
- executionDate: z.ZodOptional<z.ZodString>;
340
- timeOfDay: z.ZodString;
341
- criteria: z.ZodObject<{
342
- type: z.ZodNativeEnum<typeof CriteriaType>;
343
- params: z.ZodRecord<z.ZodString, z.ZodAny>;
344
- }, "strip", z.ZodTypeAny, {
345
- params: Record<string, any>;
346
- type: CriteriaType;
347
- }, {
348
- params: Record<string, any>;
349
- type: CriteriaType;
350
- }>;
351
- nextExecution: z.ZodOptional<z.ZodNumber>;
352
- createdAt: z.ZodOptional<z.ZodNumber>;
353
- modified: z.ZodOptional<z.ZodNumber>;
354
- }, "strip", z.ZodTypeAny, {
355
- id: string;
356
- title: string;
357
- status: Status;
358
- description: string;
359
- transportType: TransportType[];
360
- notification: {
361
- userId: string;
362
- title: string;
363
- body: string;
364
- metadata: Record<string, string | number>;
365
- };
366
- timeOfDay: string;
367
- criteria: {
368
- params: Record<string, any>;
369
- type: CriteriaType;
370
- };
371
- timezone?: string | null | undefined;
372
- history?: {
373
- status: "failed" | "success" | "info" | "warn";
374
- batchId: string;
375
- executedAt: number;
376
- timezone: string;
377
- users: {
378
- error: number;
379
- success: number;
380
- total: number;
381
- };
382
- errorList?: {
383
- token: string;
384
- error: string;
385
- }[] | undefined;
386
- executionTimeDuration?: number | undefined;
387
- }[] | undefined;
388
- recurrence?: {
389
- frequency: Frequency;
390
- interval: number;
391
- weekDays?: WeekDay[] | undefined;
392
- dayOfMonth?: number | undefined;
393
- endDate?: string | undefined;
394
- ocurrences?: number | undefined;
395
- } | undefined;
396
- tenantIds?: string[] | undefined;
397
- executionDate?: string | undefined;
398
- nextExecution?: number | undefined;
399
- createdAt?: number | undefined;
400
- modified?: number | undefined;
401
- }, {
402
- id: string;
403
- title: string;
404
- status: Status;
405
- description: string;
406
- transportType: TransportType[];
407
- notification: {
408
- userId: string;
409
- title: string;
410
- body: string;
411
- metadata: Record<string, string | number>;
412
- };
413
- timeOfDay: string;
414
- criteria: {
415
- params: Record<string, any>;
416
- type: CriteriaType;
417
- };
418
- timezone?: string | null | undefined;
419
- history?: {
420
- status: "failed" | "success" | "info" | "warn";
421
- batchId: string;
422
- executedAt: number;
423
- timezone: string;
424
- users: {
425
- error: number;
426
- success: number;
427
- total: number;
428
- };
429
- errorList?: {
430
- token: string;
431
- error: string;
432
- }[] | undefined;
433
- executionTimeDuration?: number | undefined;
434
- }[] | undefined;
435
- recurrence?: {
436
- frequency: Frequency;
437
- interval: number;
438
- weekDays?: WeekDay[] | undefined;
439
- dayOfMonth?: number | undefined;
440
- endDate?: string | undefined;
441
- ocurrences?: number | undefined;
442
- } | undefined;
443
- tenantIds?: string[] | undefined;
444
- executionDate?: string | undefined;
445
- nextExecution?: number | undefined;
446
- createdAt?: number | undefined;
447
- modified?: number | undefined;
448
- }>;
449
- export type NotificationItem = z.infer<typeof NotificationItemSchema>;
450
- export type NotificationDetail = z.infer<typeof NotificationDetailSchema>;
451
- export type Trigger = z.infer<typeof TriggerSchema>;
452
- export type RecurrenceRule = z.infer<typeof RecurrenceRuleSchema>;
453
- export type History = z.infer<typeof HistorySchema>;
454
- export type Criteria = z.infer<typeof CriteriaSchema>;
@@ -1,111 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TriggerSchema = exports.RecurrenceRuleSchema = exports.HistorySchema = exports.CriteriaSchema = exports.NotificationDetailSchema = exports.NotificationItemSchema = exports.Status = exports.TransportType = exports.CriteriaType = exports.WeekDay = exports.Frequency = void 0;
4
- const zod_1 = require("zod");
5
- var Frequency;
6
- (function (Frequency) {
7
- Frequency["DAILY"] = "daily";
8
- Frequency["WEEKLY"] = "weekly";
9
- Frequency["MONTHLY"] = "monthly";
10
- })(Frequency || (exports.Frequency = Frequency = {}));
11
- var WeekDay;
12
- (function (WeekDay) {
13
- WeekDay[WeekDay["MONDAY"] = 1] = "MONDAY";
14
- WeekDay[WeekDay["TUESDAY"] = 2] = "TUESDAY";
15
- WeekDay[WeekDay["WEDNESDAY"] = 3] = "WEDNESDAY";
16
- WeekDay[WeekDay["THURSDAY"] = 4] = "THURSDAY";
17
- WeekDay[WeekDay["FRIDAY"] = 5] = "FRIDAY";
18
- WeekDay[WeekDay["SATURDAY"] = 6] = "SATURDAY";
19
- WeekDay[WeekDay["SUNDAY"] = 7] = "SUNDAY";
20
- })(WeekDay || (exports.WeekDay = WeekDay = {}));
21
- var CriteriaType;
22
- (function (CriteriaType) {
23
- CriteriaType["AllUsers"] = "allUsers";
24
- CriteriaType["NoProjects"] = "noProjects";
25
- CriteriaType["NoSubscription"] = "noSubscription";
26
- CriteriaType["UsersFromTier"] = "usersFromTier";
27
- })(CriteriaType || (exports.CriteriaType = CriteriaType = {}));
28
- var TransportType;
29
- (function (TransportType) {
30
- TransportType["Push"] = "push";
31
- TransportType["Email"] = "email";
32
- })(TransportType || (exports.TransportType = TransportType = {}));
33
- var Status;
34
- (function (Status) {
35
- Status["SCHEDULED"] = "scheduled";
36
- Status["RUNNING"] = "running";
37
- Status["COMPLETED"] = "completed";
38
- Status["FAILED"] = "failed";
39
- Status["PAUSED"] = "paused";
40
- Status["CANCELLED"] = "cancelled";
41
- Status["ACTIVE"] = "active";
42
- Status["EXPIRED"] = "expired";
43
- })(Status || (exports.Status = Status = {}));
44
- exports.NotificationItemSchema = zod_1.z.object({
45
- id: zod_1.z.string(),
46
- userId: zod_1.z.string(),
47
- triggerId: zod_1.z.string().optional(),
48
- title: zod_1.z.string(),
49
- body: zod_1.z.string(),
50
- status: zod_1.z.enum(["failed", "delivered", "deleted"]),
51
- deliveredAt: zod_1.z.number(),
52
- openedAt: zod_1.z.number().optional(),
53
- deletedAt: zod_1.z.number().optional(),
54
- cta: zod_1.z.object({ label: zod_1.z.string(), url: zod_1.z.string().url() }).optional(),
55
- metadata: zod_1.z.record(zod_1.z.union([zod_1.z.string(), zod_1.z.number()])),
56
- error: zod_1.z.string().optional(),
57
- });
58
- exports.NotificationDetailSchema = exports.NotificationItemSchema.pick({
59
- title: true,
60
- body: true,
61
- userId: true,
62
- metadata: true,
63
- });
64
- exports.CriteriaSchema = zod_1.z.object({
65
- type: zod_1.z.nativeEnum(CriteriaType),
66
- params: zod_1.z.record(zod_1.z.any()),
67
- });
68
- exports.HistorySchema = zod_1.z.object({
69
- batchId: zod_1.z.string(),
70
- executedAt: zod_1.z.number(),
71
- timezone: zod_1.z.string(),
72
- status: zod_1.z.enum(["success", "failed", "info", "warn"]),
73
- users: zod_1.z.object({
74
- total: zod_1.z.number(),
75
- success: zod_1.z.number(),
76
- error: zod_1.z.number(),
77
- }),
78
- errorList: zod_1.z
79
- .array(zod_1.z.object({
80
- token: zod_1.z.string(),
81
- error: zod_1.z.string(),
82
- }))
83
- .optional(),
84
- executionTimeDuration: zod_1.z.number().optional(),
85
- });
86
- exports.RecurrenceRuleSchema = zod_1.z.object({
87
- frequency: zod_1.z.nativeEnum(Frequency),
88
- interval: zod_1.z.number(),
89
- weekDays: zod_1.z.array(zod_1.z.nativeEnum(WeekDay)).optional(),
90
- dayOfMonth: zod_1.z.number().optional(),
91
- endDate: zod_1.z.string().optional(),
92
- ocurrences: zod_1.z.number().optional(),
93
- });
94
- exports.TriggerSchema = zod_1.z.object({
95
- id: zod_1.z.string(),
96
- title: zod_1.z.string(),
97
- description: zod_1.z.string(),
98
- transportType: zod_1.z.array(zod_1.z.nativeEnum(TransportType)),
99
- notification: exports.NotificationDetailSchema,
100
- history: zod_1.z.array(exports.HistorySchema).optional(),
101
- status: zod_1.z.nativeEnum(Status),
102
- recurrence: exports.RecurrenceRuleSchema.optional(),
103
- timezone: zod_1.z.string().nullable().optional(),
104
- tenantIds: zod_1.z.array(zod_1.z.string()).optional(),
105
- executionDate: zod_1.z.string().optional(),
106
- timeOfDay: zod_1.z.string(),
107
- criteria: exports.CriteriaSchema,
108
- nextExecution: zod_1.z.number().optional(),
109
- createdAt: zod_1.z.number().optional(),
110
- modified: zod_1.z.number().optional(),
111
- });
@@ -1,3 +0,0 @@
1
- export type { Trigger, NotificationDetail, NotificationItem, RecurrenceRule, History, Criteria, } from "./Notification.schema";
2
- export { TriggerSchema, NotificationDetailSchema, NotificationItemSchema, RecurrenceRuleSchema, CriteriaSchema, HistorySchema, Frequency, WeekDay, CriteriaType, TransportType, Status, } from "./Notification.schema";
3
- export * from "./Notification.api";
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Status = exports.TransportType = exports.CriteriaType = exports.WeekDay = exports.Frequency = exports.HistorySchema = exports.CriteriaSchema = exports.RecurrenceRuleSchema = exports.NotificationItemSchema = exports.NotificationDetailSchema = exports.TriggerSchema = void 0;
18
- var Notification_schema_1 = require("./Notification.schema");
19
- Object.defineProperty(exports, "TriggerSchema", { enumerable: true, get: function () { return Notification_schema_1.TriggerSchema; } });
20
- Object.defineProperty(exports, "NotificationDetailSchema", { enumerable: true, get: function () { return Notification_schema_1.NotificationDetailSchema; } });
21
- Object.defineProperty(exports, "NotificationItemSchema", { enumerable: true, get: function () { return Notification_schema_1.NotificationItemSchema; } });
22
- Object.defineProperty(exports, "RecurrenceRuleSchema", { enumerable: true, get: function () { return Notification_schema_1.RecurrenceRuleSchema; } });
23
- Object.defineProperty(exports, "CriteriaSchema", { enumerable: true, get: function () { return Notification_schema_1.CriteriaSchema; } });
24
- Object.defineProperty(exports, "HistorySchema", { enumerable: true, get: function () { return Notification_schema_1.HistorySchema; } });
25
- Object.defineProperty(exports, "Frequency", { enumerable: true, get: function () { return Notification_schema_1.Frequency; } });
26
- Object.defineProperty(exports, "WeekDay", { enumerable: true, get: function () { return Notification_schema_1.WeekDay; } });
27
- Object.defineProperty(exports, "CriteriaType", { enumerable: true, get: function () { return Notification_schema_1.CriteriaType; } });
28
- Object.defineProperty(exports, "TransportType", { enumerable: true, get: function () { return Notification_schema_1.TransportType; } });
29
- Object.defineProperty(exports, "Status", { enumerable: true, get: function () { return Notification_schema_1.Status; } });
30
- __exportStar(require("./Notification.api"), exports);
@@ -1,83 +0,0 @@
1
- import Context from "../Context";
2
- import { Project, ProjectCreation, SendToApproval, Approve } from "./Project.schema";
3
- import * as Core from "../core";
4
- export interface IAPI {
5
- find: (context: Context, projectId: string) => Promise<Project>;
6
- create: (context: Context, data: ProjectCreation) => Promise<Project>;
7
- review: (context: Context, projectId: string, revision: string) => Promise<boolean>;
8
- cancel: (context: Context, projectId: string) => Promise<boolean>;
9
- list: (context: Context, query: Core.QueryOptions<Project>) => Promise<Project[]>;
10
- start: (context: Context, projectId: string) => Promise<boolean>;
11
- sendToApproval: (context: Context, projectId: string, data: SendToApproval) => Promise<boolean>;
12
- approve: (context: Context, projectId: string, data: Approve) => Promise<boolean>;
13
- deny: (context: Context, projectId: string, denyFeedback: string, categories?: string[]) => Promise<boolean>;
14
- unschedule: (context: Context, projectId: string) => Promise<boolean>;
15
- rollback: (context: Context, projectId: string) => Promise<boolean>;
16
- getNext: (context: Context, userId: string) => Promise<Project | null>;
17
- getUserHistory: (context: Context, userId: string) => Promise<Core.APIResponse<Project>>;
18
- permissions: {
19
- isEligibleForFreeProject(context: Context): Promise<boolean>;
20
- };
21
- }
22
- export declare const Endpoints: {
23
- List: {
24
- uri: string;
25
- method: string;
26
- };
27
- GetNext: {
28
- uri: string;
29
- method: string;
30
- };
31
- CreateProject: {
32
- uri: string;
33
- method: string;
34
- };
35
- FindOne: {
36
- uri: string;
37
- method: string;
38
- };
39
- GetGoals: {
40
- uri: string;
41
- method: string;
42
- };
43
- Review: {
44
- uri: string;
45
- method: string;
46
- };
47
- Cancel: {
48
- uri: string;
49
- method: string;
50
- };
51
- StartEdition: {
52
- uri: string;
53
- method: string;
54
- };
55
- SendToApproval: {
56
- uri: string;
57
- method: string;
58
- };
59
- IsEligibleForFreeProject: {
60
- uri: string;
61
- method: string;
62
- };
63
- Approve: {
64
- uri: string;
65
- method: string;
66
- };
67
- Unschedule: {
68
- uri: string;
69
- method: string;
70
- };
71
- Rollback: {
72
- uri: string;
73
- method: string;
74
- };
75
- Deny: {
76
- uri: string;
77
- method: string;
78
- };
79
- GetUserHistory: {
80
- uri: string;
81
- method: string;
82
- };
83
- };