@erxes/core-contract 0.1.0-v2.0 → 0.1.0-v2.2

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 (102) hide show
  1. package/dist/activities.d.ts +1394 -139
  2. package/dist/activities.js +96 -40
  3. package/dist/audit.d.ts +1092 -48
  4. package/dist/audit.js +37 -23
  5. package/dist/auth.d.ts +2867 -61
  6. package/dist/auth.js +55 -25
  7. package/dist/automationRuns.d.ts +12 -13
  8. package/dist/automationRuns.js +15 -30
  9. package/dist/automations.d.ts +2474 -93
  10. package/dist/automations.js +56 -44
  11. package/dist/client.d.ts +30704 -0
  12. package/dist/client.js +62 -0
  13. package/dist/common.d.ts +28 -16
  14. package/dist/common.js +30 -22
  15. package/dist/companies.d.ts +1154 -44
  16. package/dist/companies.js +33 -17
  17. package/dist/contract/routes.json.js +1810 -0
  18. package/dist/customerAuth.d.ts +1661 -0
  19. package/dist/customerAuth.js +197 -0
  20. package/dist/customers.d.ts +1283 -65
  21. package/dist/customers.js +35 -25
  22. package/dist/{automationDefinition.d.ts → db/src/automationDefinition.d.ts} +4 -3
  23. package/dist/{automationDefinition.js → db/src/automationDefinition.js} +10 -32
  24. package/dist/db/src/enums.d.ts +8 -0
  25. package/dist/db/src/enums.js +334 -0
  26. package/dist/db/src/schema/auditStreams.js +6 -14
  27. package/dist/db/src/schema/authTokens.js +4 -6
  28. package/dist/db/src/schema/automations.d.ts +1 -0
  29. package/dist/db/src/schema/automations.js +15 -31
  30. package/dist/db/src/schema/common.d.ts +2 -6
  31. package/dist/db/src/schema/common.js +1 -24
  32. package/dist/db/src/schema/companies.js +6 -5
  33. package/dist/db/src/schema/customerAuth.js +101 -0
  34. package/dist/db/src/schema/customers.js +6 -6
  35. package/dist/db/src/schema/events.js +12 -60
  36. package/dist/db/src/schema/fieldValues.js +2 -2
  37. package/dist/db/src/schema/fields.js +10 -28
  38. package/dist/db/src/schema/index.d.ts +3 -0
  39. package/dist/db/src/schema/index.js +22 -20
  40. package/dist/db/src/schema/leadStages.js +5 -10
  41. package/dist/db/src/schema/leads.js +6 -11
  42. package/dist/db/src/schema/notes.js +92 -0
  43. package/dist/db/src/schema/oauth.js +3 -3
  44. package/dist/db/src/schema/payments.js +13 -23
  45. package/dist/db/src/schema/platform.js +11 -31
  46. package/dist/db/src/schema/plugins.js +10 -5
  47. package/dist/db/src/schema/products.js +7 -8
  48. package/dist/db/src/schema/rateLimits.js +7 -0
  49. package/dist/db/src/schema/saas.js +3 -9
  50. package/dist/db/src/schema/tags.js +6 -5
  51. package/dist/db/src/schema/transfer.js +13 -33
  52. package/dist/db/src/schema/trash.js +6 -7
  53. package/dist/db/src/schema/users.js +6 -10
  54. package/dist/db/src/schema/views.js +5 -13
  55. package/dist/db/src/schema/webhooks.js +7 -14
  56. package/dist/db/src/table.js +16 -2
  57. package/dist/errors.d.ts +516 -0
  58. package/dist/errors.js +218 -0
  59. package/dist/events.d.ts +585 -140
  60. package/dist/events.js +57 -42
  61. package/dist/fields.d.ts +1478 -66
  62. package/dist/fields.js +33 -47
  63. package/dist/files.d.ts +766 -62
  64. package/dist/files.js +34 -22
  65. package/dist/index.d.ts +25707 -902
  66. package/dist/index.js +22 -20
  67. package/dist/leads.d.ts +1108 -22
  68. package/dist/leads.js +39 -20
  69. package/dist/notifications.d.ts +691 -94
  70. package/dist/notifications.js +45 -91
  71. package/dist/organizations.d.ts +263 -5
  72. package/dist/organizations.js +21 -2
  73. package/dist/payments.d.ts +1794 -120
  74. package/dist/payments.js +58 -60
  75. package/dist/platform.d.ts +12 -20
  76. package/dist/platform.js +8 -21
  77. package/dist/plugins.d.ts +808 -71
  78. package/dist/plugins.js +66 -35
  79. package/dist/products.d.ts +1411 -53
  80. package/dist/products.js +40 -23
  81. package/dist/roles.d.ts +560 -8
  82. package/dist/roles.js +25 -11
  83. package/dist/routes.d.ts +8 -0
  84. package/dist/routes.js +13 -0
  85. package/dist/saas.d.ts +164 -8
  86. package/dist/saas.js +14 -29
  87. package/dist/tags.d.ts +344 -8
  88. package/dist/tags.js +16 -8
  89. package/dist/transfer.d.ts +1361 -36
  90. package/dist/transfer.js +47 -49
  91. package/dist/trash.d.ts +299 -23
  92. package/dist/trash.js +27 -20
  93. package/dist/users.d.ts +1233 -59
  94. package/dist/users.js +48 -39
  95. package/dist/values.d.ts +150 -0
  96. package/dist/values.js +139 -0
  97. package/dist/views.d.ts +404 -13
  98. package/dist/views.js +18 -28
  99. package/dist/webhooks.d.ts +791 -29
  100. package/dist/webhooks.js +36 -21
  101. package/package.json +9 -2
  102. package/dist/db/src/schema/jobs.js +0 -44
@@ -6,27 +6,22 @@ export declare const Notification: z.ZodObject<{
6
6
  title: z.ZodString;
7
7
  body: z.ZodNullable<z.ZodString>;
8
8
  link: z.ZodNullable<z.ZodString>;
9
+ entityType: z.ZodNullable<z.ZodString>;
10
+ entityId: z.ZodNullable<z.ZodString>;
9
11
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
10
12
  priority: z.ZodEnum<{
11
13
  high: "high";
12
14
  normal: "normal";
13
15
  }>;
14
- createdAt: z.ZodISODateTime;
15
- entity: z.ZodNullable<z.ZodObject<{
16
- type: z.ZodString;
17
- id: z.ZodString;
18
- }, z.core.$strip>>;
19
- actor: z.ZodObject<{
20
- type: z.ZodEnum<{
21
- plugin: "plugin";
22
- system: "system";
23
- user: "user";
24
- }>;
25
- id: z.ZodNullable<z.ZodString>;
26
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
- avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
- }, z.core.$strip>;
29
- read: z.ZodBoolean;
16
+ actorType: z.ZodEnum<{
17
+ customer: "customer";
18
+ plugin: "plugin";
19
+ system: "system";
20
+ user: "user";
21
+ }>;
22
+ actorId: z.ZodNullable<z.ZodString>;
23
+ readAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
24
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
30
25
  }, {
31
26
  out: {};
32
27
  in: {};
@@ -37,6 +32,8 @@ export declare const NotificationInput: z.ZodObject<{
37
32
  title: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
38
33
  body: z.ZodOptional<z.ZodString>;
39
34
  link: z.ZodOptional<z.ZodString>;
35
+ entityType: z.ZodOptional<z.ZodString>;
36
+ entityId: z.ZodOptional<z.ZodString>;
40
37
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
41
38
  priority: z.ZodDefault<z.ZodEnum<{
42
39
  high: "high";
@@ -44,10 +41,6 @@ export declare const NotificationInput: z.ZodObject<{
44
41
  }>>;
45
42
  dedupeKey: z.ZodOptional<z.ZodString>;
46
43
  userIds: z.ZodArray<z.ZodString>;
47
- entity: z.ZodOptional<z.ZodObject<{
48
- type: z.ZodString;
49
- id: z.ZodString;
50
- }, z.core.$strip>>;
51
44
  actorUserId: z.ZodOptional<z.ZodString>;
52
45
  }, {
53
46
  out: {};
@@ -60,52 +53,6 @@ export type NotificationInput = z.infer<typeof NotificationInput>;
60
53
  */
61
54
  export declare const CORE_NOTIFICATION_KINDS: readonly ['core.customer.assigned', 'core.customer.updated', 'core.customer.merged', 'core.customer.deleted', 'core.customer.activity', 'core.company.assigned', 'core.company.updated', 'core.company.merged', 'core.company.deleted', 'core.company.activity', 'core.user.role_changed', 'core.user.password_set', 'core.note.mentioned', 'core.automation.message', 'core.automation.failed', 'core.security.mass_deletion', 'core.security.alert', 'core.import.done', 'core.export.ready', 'core.security.new_sign_in'];
62
55
  export type CoreNotificationKind = (typeof CORE_NOTIFICATION_KINDS)[number];
63
- /** Security notices a member can't mute. */
64
- export declare const UNMUTABLE_NOTIFICATION_KINDS: readonly string[];
65
- /** Where a group of notifications goes: the inbox and email, the inbox only, or nowhere. */
66
- export declare const NotificationDelivery: z.ZodEnum<{
67
- email: "email";
68
- inbox: "inbox";
69
- off: "off";
70
- }>;
71
- export type NotificationDelivery = z.infer<typeof NotificationDelivery>;
72
- /**
73
- * Core's notifications in groups a member chooses for at once (each plugin
74
- * is a group of its own). `security` is always on.
75
- */
76
- export declare const CORE_NOTIFICATION_GROUPS: readonly [{
77
- readonly key: 'assigned';
78
- readonly label: 'Assigned to me';
79
- readonly kinds: readonly ["core.customer.assigned", "core.company.assigned"];
80
- readonly default: 'email';
81
- }, {
82
- readonly key: 'records';
83
- readonly label: 'Changes to records I own';
84
- readonly kinds: readonly ["core.customer.updated", "core.customer.merged", "core.customer.deleted", "core.company.updated", "core.company.merged", "core.company.deleted", "core.customer.activity", "core.company.activity"];
85
- readonly default: 'inbox';
86
- }, {
87
- readonly key: 'mentions';
88
- readonly label: 'Mentions';
89
- readonly kinds: readonly ["core.note.mentioned"];
90
- readonly default: 'email';
91
- }, {
92
- readonly key: 'automations';
93
- readonly label: 'Automations';
94
- readonly kinds: readonly ["core.automation.message", "core.automation.failed"];
95
- readonly default: 'inbox';
96
- }, {
97
- readonly key: 'transfer';
98
- readonly label: 'Imports and exports';
99
- readonly kinds: readonly ["core.import.done", "core.export.ready"];
100
- readonly default: 'inbox';
101
- }, {
102
- readonly key: 'security';
103
- readonly label: 'Security';
104
- readonly kinds: readonly string[];
105
- readonly default: 'inbox';
106
- }];
107
- /** The group a notification belongs to: a core group, or the plugin that sent it. */
108
- export declare const notificationGroupOf: (source: string, kind: string) => string;
109
56
  export declare const NotificationGroupSetting: z.ZodObject<{
110
57
  key: z.ZodString;
111
58
  label: z.ZodString;
@@ -133,7 +80,6 @@ export declare const NotificationSettings: z.ZodObject<{
133
80
  browser: z.ZodBoolean;
134
81
  }, z.core.$strip>;
135
82
  export type NotificationSettings = z.infer<typeof NotificationSettings>;
136
- /** The signed-in member's inbox. Plugins create notifications with `create`. */
137
83
  export declare const notificationsContract: {
138
84
  list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
139
85
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -164,27 +110,22 @@ export declare const notificationsContract: {
164
110
  title: z.ZodString;
165
111
  body: z.ZodNullable<z.ZodString>;
166
112
  link: z.ZodNullable<z.ZodString>;
113
+ entityType: z.ZodNullable<z.ZodString>;
114
+ entityId: z.ZodNullable<z.ZodString>;
167
115
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
168
116
  priority: z.ZodEnum<{
169
117
  high: "high";
170
118
  normal: "normal";
171
119
  }>;
172
- createdAt: z.ZodISODateTime;
173
- entity: z.ZodNullable<z.ZodObject<{
174
- type: z.ZodString;
175
- id: z.ZodString;
176
- }, z.core.$strip>>;
177
- actor: z.ZodObject<{
178
- type: z.ZodEnum<{
179
- plugin: "plugin";
180
- system: "system";
181
- user: "user";
182
- }>;
183
- id: z.ZodNullable<z.ZodString>;
184
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
185
- avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
186
- }, z.core.$strip>;
187
- read: z.ZodBoolean;
120
+ actorType: z.ZodEnum<{
121
+ customer: "customer";
122
+ plugin: "plugin";
123
+ system: "system";
124
+ user: "user";
125
+ }>;
126
+ actorId: z.ZodNullable<z.ZodString>;
127
+ readAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
128
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
188
129
  }, {
189
130
  out: {};
190
131
  in: {};
@@ -197,25 +138,401 @@ export declare const notificationsContract: {
197
138
  }, z.core.$strip>;
198
139
  totalCount: z.ZodInt;
199
140
  totalCapped: z.ZodOptional<z.ZodBoolean>;
200
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
141
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
142
+ UNAUTHORIZED: {
143
+ status: number;
144
+ };
145
+ NOT_ALLOWED: {
146
+ status: number;
147
+ data: z.ZodOptional<z.ZodObject<{
148
+ permission: z.ZodString;
149
+ }, z.core.$strip>>;
150
+ };
151
+ PLUGIN_ONLY: {
152
+ status: number;
153
+ };
154
+ MEMBERS_ONLY: {
155
+ status: number;
156
+ };
157
+ ORG_REQUIRED: {
158
+ status: number;
159
+ };
160
+ SCOPE_REQUIRED: {
161
+ status: number;
162
+ };
163
+ SERVICE_TOKEN_REQUIRED: {
164
+ status: number;
165
+ };
166
+ ORGANIZATION_DISABLED: {
167
+ status: number;
168
+ data: z.ZodObject<{
169
+ manageUrl: z.ZodNullable<z.ZodString>;
170
+ }, z.core.$strip>;
171
+ };
172
+ NOT_IN_PLAN: {
173
+ status: number;
174
+ data: z.ZodOptional<z.ZodObject<{
175
+ manageUrl: z.ZodNullable<z.ZodString>;
176
+ }, z.core.$strip>>;
177
+ };
178
+ READ_ONLY: {
179
+ status: number;
180
+ };
181
+ TOO_MANY_REQUESTS: {
182
+ status: number;
183
+ };
184
+ INVALID_INPUT: {
185
+ status: number;
186
+ data: z.ZodObject<{
187
+ issues: z.ZodArray<z.ZodObject<{
188
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
189
+ message: z.ZodString;
190
+ }, z.core.$strip>>;
191
+ }, z.core.$strip>;
192
+ };
193
+ NOT_FOUND: {
194
+ status: number;
195
+ };
196
+ TAKEN: {
197
+ status: number;
198
+ data: z.ZodObject<{
199
+ field: z.ZodString;
200
+ id: z.ZodOptional<z.ZodString>;
201
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
202
+ }, z.core.$strip>;
203
+ };
204
+ INVALID_CURSOR: {
205
+ status: number;
206
+ };
207
+ INVALID_REFERENCE: {
208
+ status: number;
209
+ data: z.ZodObject<{
210
+ field: z.ZodString;
211
+ }, z.core.$strip>;
212
+ };
213
+ INVALID_FILTER: {
214
+ status: number;
215
+ };
216
+ FILTER_TOO_SLOW: {
217
+ status: number;
218
+ };
219
+ /** The signed-in member's inbox. Plugins create notifications with `create`. */
220
+ ALWAYS_ON: {
221
+ status: number;
222
+ };
223
+ INVALID_ACTOR: {
224
+ status: number;
225
+ };
226
+ INVALID_OWNER: {
227
+ status: number;
228
+ };
229
+ INVALID_RECIPIENT: {
230
+ status: number;
231
+ };
232
+ INVALID_TYPE: {
233
+ status: number;
234
+ };
235
+ }>, Record<never, never>>;
201
236
  unreadCount: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
202
237
  source: z.ZodOptional<z.ZodString>;
203
238
  }, z.core.$strip>, z.ZodObject<{
204
239
  count: z.ZodInt;
205
240
  bySource: z.ZodRecord<z.ZodString, z.ZodInt>;
206
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
241
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
242
+ UNAUTHORIZED: {
243
+ status: number;
244
+ };
245
+ NOT_ALLOWED: {
246
+ status: number;
247
+ data: z.ZodOptional<z.ZodObject<{
248
+ permission: z.ZodString;
249
+ }, z.core.$strip>>;
250
+ };
251
+ PLUGIN_ONLY: {
252
+ status: number;
253
+ };
254
+ MEMBERS_ONLY: {
255
+ status: number;
256
+ };
257
+ ORG_REQUIRED: {
258
+ status: number;
259
+ };
260
+ SCOPE_REQUIRED: {
261
+ status: number;
262
+ };
263
+ SERVICE_TOKEN_REQUIRED: {
264
+ status: number;
265
+ };
266
+ ORGANIZATION_DISABLED: {
267
+ status: number;
268
+ data: z.ZodObject<{
269
+ manageUrl: z.ZodNullable<z.ZodString>;
270
+ }, z.core.$strip>;
271
+ };
272
+ NOT_IN_PLAN: {
273
+ status: number;
274
+ data: z.ZodOptional<z.ZodObject<{
275
+ manageUrl: z.ZodNullable<z.ZodString>;
276
+ }, z.core.$strip>>;
277
+ };
278
+ READ_ONLY: {
279
+ status: number;
280
+ };
281
+ TOO_MANY_REQUESTS: {
282
+ status: number;
283
+ };
284
+ INVALID_INPUT: {
285
+ status: number;
286
+ data: z.ZodObject<{
287
+ issues: z.ZodArray<z.ZodObject<{
288
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
289
+ message: z.ZodString;
290
+ }, z.core.$strip>>;
291
+ }, z.core.$strip>;
292
+ };
293
+ NOT_FOUND: {
294
+ status: number;
295
+ };
296
+ TAKEN: {
297
+ status: number;
298
+ data: z.ZodObject<{
299
+ field: z.ZodString;
300
+ id: z.ZodOptional<z.ZodString>;
301
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
302
+ }, z.core.$strip>;
303
+ };
304
+ INVALID_CURSOR: {
305
+ status: number;
306
+ };
307
+ INVALID_REFERENCE: {
308
+ status: number;
309
+ data: z.ZodObject<{
310
+ field: z.ZodString;
311
+ }, z.core.$strip>;
312
+ };
313
+ INVALID_FILTER: {
314
+ status: number;
315
+ };
316
+ FILTER_TOO_SLOW: {
317
+ status: number;
318
+ };
319
+ /** The signed-in member's inbox. Plugins create notifications with `create`. */
320
+ ALWAYS_ON: {
321
+ status: number;
322
+ };
323
+ INVALID_ACTOR: {
324
+ status: number;
325
+ };
326
+ INVALID_OWNER: {
327
+ status: number;
328
+ };
329
+ INVALID_RECIPIENT: {
330
+ status: number;
331
+ };
332
+ INVALID_TYPE: {
333
+ status: number;
334
+ };
335
+ }>, Record<never, never>>;
207
336
  markRead: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
208
337
  ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
209
338
  source: z.ZodOptional<z.ZodString>;
210
339
  read: z.ZodDefault<z.ZodBoolean>;
211
340
  }, z.core.$strip>, z.ZodObject<{
212
341
  updated: z.ZodInt;
213
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
342
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
343
+ UNAUTHORIZED: {
344
+ status: number;
345
+ };
346
+ NOT_ALLOWED: {
347
+ status: number;
348
+ data: z.ZodOptional<z.ZodObject<{
349
+ permission: z.ZodString;
350
+ }, z.core.$strip>>;
351
+ };
352
+ PLUGIN_ONLY: {
353
+ status: number;
354
+ };
355
+ MEMBERS_ONLY: {
356
+ status: number;
357
+ };
358
+ ORG_REQUIRED: {
359
+ status: number;
360
+ };
361
+ SCOPE_REQUIRED: {
362
+ status: number;
363
+ };
364
+ SERVICE_TOKEN_REQUIRED: {
365
+ status: number;
366
+ };
367
+ ORGANIZATION_DISABLED: {
368
+ status: number;
369
+ data: z.ZodObject<{
370
+ manageUrl: z.ZodNullable<z.ZodString>;
371
+ }, z.core.$strip>;
372
+ };
373
+ NOT_IN_PLAN: {
374
+ status: number;
375
+ data: z.ZodOptional<z.ZodObject<{
376
+ manageUrl: z.ZodNullable<z.ZodString>;
377
+ }, z.core.$strip>>;
378
+ };
379
+ READ_ONLY: {
380
+ status: number;
381
+ };
382
+ TOO_MANY_REQUESTS: {
383
+ status: number;
384
+ };
385
+ INVALID_INPUT: {
386
+ status: number;
387
+ data: z.ZodObject<{
388
+ issues: z.ZodArray<z.ZodObject<{
389
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
390
+ message: z.ZodString;
391
+ }, z.core.$strip>>;
392
+ }, z.core.$strip>;
393
+ };
394
+ NOT_FOUND: {
395
+ status: number;
396
+ };
397
+ TAKEN: {
398
+ status: number;
399
+ data: z.ZodObject<{
400
+ field: z.ZodString;
401
+ id: z.ZodOptional<z.ZodString>;
402
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
403
+ }, z.core.$strip>;
404
+ };
405
+ INVALID_CURSOR: {
406
+ status: number;
407
+ };
408
+ INVALID_REFERENCE: {
409
+ status: number;
410
+ data: z.ZodObject<{
411
+ field: z.ZodString;
412
+ }, z.core.$strip>;
413
+ };
414
+ INVALID_FILTER: {
415
+ status: number;
416
+ };
417
+ FILTER_TOO_SLOW: {
418
+ status: number;
419
+ };
420
+ /** The signed-in member's inbox. Plugins create notifications with `create`. */
421
+ ALWAYS_ON: {
422
+ status: number;
423
+ };
424
+ INVALID_ACTOR: {
425
+ status: number;
426
+ };
427
+ INVALID_OWNER: {
428
+ status: number;
429
+ };
430
+ INVALID_RECIPIENT: {
431
+ status: number;
432
+ };
433
+ INVALID_TYPE: {
434
+ status: number;
435
+ };
436
+ }>, Record<never, never>>;
214
437
  remove: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
215
438
  id: z.ZodString;
216
439
  }, z.core.$strip>, z.ZodObject<{
217
440
  ok: z.ZodLiteral<true>;
218
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
441
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
442
+ UNAUTHORIZED: {
443
+ status: number;
444
+ };
445
+ NOT_ALLOWED: {
446
+ status: number;
447
+ data: z.ZodOptional<z.ZodObject<{
448
+ permission: z.ZodString;
449
+ }, z.core.$strip>>;
450
+ };
451
+ PLUGIN_ONLY: {
452
+ status: number;
453
+ };
454
+ MEMBERS_ONLY: {
455
+ status: number;
456
+ };
457
+ ORG_REQUIRED: {
458
+ status: number;
459
+ };
460
+ SCOPE_REQUIRED: {
461
+ status: number;
462
+ };
463
+ SERVICE_TOKEN_REQUIRED: {
464
+ status: number;
465
+ };
466
+ ORGANIZATION_DISABLED: {
467
+ status: number;
468
+ data: z.ZodObject<{
469
+ manageUrl: z.ZodNullable<z.ZodString>;
470
+ }, z.core.$strip>;
471
+ };
472
+ NOT_IN_PLAN: {
473
+ status: number;
474
+ data: z.ZodOptional<z.ZodObject<{
475
+ manageUrl: z.ZodNullable<z.ZodString>;
476
+ }, z.core.$strip>>;
477
+ };
478
+ READ_ONLY: {
479
+ status: number;
480
+ };
481
+ TOO_MANY_REQUESTS: {
482
+ status: number;
483
+ };
484
+ INVALID_INPUT: {
485
+ status: number;
486
+ data: z.ZodObject<{
487
+ issues: z.ZodArray<z.ZodObject<{
488
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
489
+ message: z.ZodString;
490
+ }, z.core.$strip>>;
491
+ }, z.core.$strip>;
492
+ };
493
+ NOT_FOUND: {
494
+ status: number;
495
+ };
496
+ TAKEN: {
497
+ status: number;
498
+ data: z.ZodObject<{
499
+ field: z.ZodString;
500
+ id: z.ZodOptional<z.ZodString>;
501
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
502
+ }, z.core.$strip>;
503
+ };
504
+ INVALID_CURSOR: {
505
+ status: number;
506
+ };
507
+ INVALID_REFERENCE: {
508
+ status: number;
509
+ data: z.ZodObject<{
510
+ field: z.ZodString;
511
+ }, z.core.$strip>;
512
+ };
513
+ INVALID_FILTER: {
514
+ status: number;
515
+ };
516
+ FILTER_TOO_SLOW: {
517
+ status: number;
518
+ };
519
+ /** The signed-in member's inbox. Plugins create notifications with `create`. */
520
+ ALWAYS_ON: {
521
+ status: number;
522
+ };
523
+ INVALID_ACTOR: {
524
+ status: number;
525
+ };
526
+ INVALID_OWNER: {
527
+ status: number;
528
+ };
529
+ INVALID_RECIPIENT: {
530
+ status: number;
531
+ };
532
+ INVALID_TYPE: {
533
+ status: number;
534
+ };
535
+ }>, Record<never, never>>;
219
536
  settings: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
220
537
  groups: z.ZodArray<z.ZodObject<{
221
538
  key: z.ZodString;
@@ -230,7 +547,101 @@ export declare const notificationsContract: {
230
547
  }, z.core.$strip>>;
231
548
  email: z.ZodBoolean;
232
549
  browser: z.ZodBoolean;
233
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
550
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
551
+ UNAUTHORIZED: {
552
+ status: number;
553
+ };
554
+ NOT_ALLOWED: {
555
+ status: number;
556
+ data: z.ZodOptional<z.ZodObject<{
557
+ permission: z.ZodString;
558
+ }, z.core.$strip>>;
559
+ };
560
+ PLUGIN_ONLY: {
561
+ status: number;
562
+ };
563
+ MEMBERS_ONLY: {
564
+ status: number;
565
+ };
566
+ ORG_REQUIRED: {
567
+ status: number;
568
+ };
569
+ SCOPE_REQUIRED: {
570
+ status: number;
571
+ };
572
+ SERVICE_TOKEN_REQUIRED: {
573
+ status: number;
574
+ };
575
+ ORGANIZATION_DISABLED: {
576
+ status: number;
577
+ data: z.ZodObject<{
578
+ manageUrl: z.ZodNullable<z.ZodString>;
579
+ }, z.core.$strip>;
580
+ };
581
+ NOT_IN_PLAN: {
582
+ status: number;
583
+ data: z.ZodOptional<z.ZodObject<{
584
+ manageUrl: z.ZodNullable<z.ZodString>;
585
+ }, z.core.$strip>>;
586
+ };
587
+ READ_ONLY: {
588
+ status: number;
589
+ };
590
+ TOO_MANY_REQUESTS: {
591
+ status: number;
592
+ };
593
+ INVALID_INPUT: {
594
+ status: number;
595
+ data: z.ZodObject<{
596
+ issues: z.ZodArray<z.ZodObject<{
597
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
598
+ message: z.ZodString;
599
+ }, z.core.$strip>>;
600
+ }, z.core.$strip>;
601
+ };
602
+ NOT_FOUND: {
603
+ status: number;
604
+ };
605
+ TAKEN: {
606
+ status: number;
607
+ data: z.ZodObject<{
608
+ field: z.ZodString;
609
+ id: z.ZodOptional<z.ZodString>;
610
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
611
+ }, z.core.$strip>;
612
+ };
613
+ INVALID_CURSOR: {
614
+ status: number;
615
+ };
616
+ INVALID_REFERENCE: {
617
+ status: number;
618
+ data: z.ZodObject<{
619
+ field: z.ZodString;
620
+ }, z.core.$strip>;
621
+ };
622
+ INVALID_FILTER: {
623
+ status: number;
624
+ };
625
+ FILTER_TOO_SLOW: {
626
+ status: number;
627
+ };
628
+ /** The signed-in member's inbox. Plugins create notifications with `create`. */
629
+ ALWAYS_ON: {
630
+ status: number;
631
+ };
632
+ INVALID_ACTOR: {
633
+ status: number;
634
+ };
635
+ INVALID_OWNER: {
636
+ status: number;
637
+ };
638
+ INVALID_RECIPIENT: {
639
+ status: number;
640
+ };
641
+ INVALID_TYPE: {
642
+ status: number;
643
+ };
644
+ }>, Record<never, never>>;
234
645
  updateSettings: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
235
646
  groups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
236
647
  email: "email";
@@ -253,12 +664,108 @@ export declare const notificationsContract: {
253
664
  }, z.core.$strip>>;
254
665
  email: z.ZodBoolean;
255
666
  browser: z.ZodBoolean;
256
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
667
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
668
+ UNAUTHORIZED: {
669
+ status: number;
670
+ };
671
+ NOT_ALLOWED: {
672
+ status: number;
673
+ data: z.ZodOptional<z.ZodObject<{
674
+ permission: z.ZodString;
675
+ }, z.core.$strip>>;
676
+ };
677
+ PLUGIN_ONLY: {
678
+ status: number;
679
+ };
680
+ MEMBERS_ONLY: {
681
+ status: number;
682
+ };
683
+ ORG_REQUIRED: {
684
+ status: number;
685
+ };
686
+ SCOPE_REQUIRED: {
687
+ status: number;
688
+ };
689
+ SERVICE_TOKEN_REQUIRED: {
690
+ status: number;
691
+ };
692
+ ORGANIZATION_DISABLED: {
693
+ status: number;
694
+ data: z.ZodObject<{
695
+ manageUrl: z.ZodNullable<z.ZodString>;
696
+ }, z.core.$strip>;
697
+ };
698
+ NOT_IN_PLAN: {
699
+ status: number;
700
+ data: z.ZodOptional<z.ZodObject<{
701
+ manageUrl: z.ZodNullable<z.ZodString>;
702
+ }, z.core.$strip>>;
703
+ };
704
+ READ_ONLY: {
705
+ status: number;
706
+ };
707
+ TOO_MANY_REQUESTS: {
708
+ status: number;
709
+ };
710
+ INVALID_INPUT: {
711
+ status: number;
712
+ data: z.ZodObject<{
713
+ issues: z.ZodArray<z.ZodObject<{
714
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
715
+ message: z.ZodString;
716
+ }, z.core.$strip>>;
717
+ }, z.core.$strip>;
718
+ };
719
+ NOT_FOUND: {
720
+ status: number;
721
+ };
722
+ TAKEN: {
723
+ status: number;
724
+ data: z.ZodObject<{
725
+ field: z.ZodString;
726
+ id: z.ZodOptional<z.ZodString>;
727
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
728
+ }, z.core.$strip>;
729
+ };
730
+ INVALID_CURSOR: {
731
+ status: number;
732
+ };
733
+ INVALID_REFERENCE: {
734
+ status: number;
735
+ data: z.ZodObject<{
736
+ field: z.ZodString;
737
+ }, z.core.$strip>;
738
+ };
739
+ INVALID_FILTER: {
740
+ status: number;
741
+ };
742
+ FILTER_TOO_SLOW: {
743
+ status: number;
744
+ };
745
+ /** The signed-in member's inbox. Plugins create notifications with `create`. */
746
+ ALWAYS_ON: {
747
+ status: number;
748
+ };
749
+ INVALID_ACTOR: {
750
+ status: number;
751
+ };
752
+ INVALID_OWNER: {
753
+ status: number;
754
+ };
755
+ INVALID_RECIPIENT: {
756
+ status: number;
757
+ };
758
+ INVALID_TYPE: {
759
+ status: number;
760
+ };
761
+ }>, Record<never, never>>;
257
762
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
258
763
  kind: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
259
764
  title: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
260
765
  body: z.ZodOptional<z.ZodString>;
261
766
  link: z.ZodOptional<z.ZodString>;
767
+ entityType: z.ZodOptional<z.ZodString>;
768
+ entityId: z.ZodOptional<z.ZodString>;
262
769
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
263
770
  priority: z.ZodDefault<z.ZodEnum<{
264
771
  high: "high";
@@ -266,10 +773,6 @@ export declare const notificationsContract: {
266
773
  }>>;
267
774
  dedupeKey: z.ZodOptional<z.ZodString>;
268
775
  userIds: z.ZodArray<z.ZodString>;
269
- entity: z.ZodOptional<z.ZodObject<{
270
- type: z.ZodString;
271
- id: z.ZodString;
272
- }, z.core.$strip>>;
273
776
  actorUserId: z.ZodOptional<z.ZodString>;
274
777
  }, {
275
778
  out: {};
@@ -277,5 +780,99 @@ export declare const notificationsContract: {
277
780
  }>, z.ZodObject<{
278
781
  created: z.ZodInt;
279
782
  skipped: z.ZodInt;
280
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
783
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
784
+ UNAUTHORIZED: {
785
+ status: number;
786
+ };
787
+ NOT_ALLOWED: {
788
+ status: number;
789
+ data: z.ZodOptional<z.ZodObject<{
790
+ permission: z.ZodString;
791
+ }, z.core.$strip>>;
792
+ };
793
+ PLUGIN_ONLY: {
794
+ status: number;
795
+ };
796
+ MEMBERS_ONLY: {
797
+ status: number;
798
+ };
799
+ ORG_REQUIRED: {
800
+ status: number;
801
+ };
802
+ SCOPE_REQUIRED: {
803
+ status: number;
804
+ };
805
+ SERVICE_TOKEN_REQUIRED: {
806
+ status: number;
807
+ };
808
+ ORGANIZATION_DISABLED: {
809
+ status: number;
810
+ data: z.ZodObject<{
811
+ manageUrl: z.ZodNullable<z.ZodString>;
812
+ }, z.core.$strip>;
813
+ };
814
+ NOT_IN_PLAN: {
815
+ status: number;
816
+ data: z.ZodOptional<z.ZodObject<{
817
+ manageUrl: z.ZodNullable<z.ZodString>;
818
+ }, z.core.$strip>>;
819
+ };
820
+ READ_ONLY: {
821
+ status: number;
822
+ };
823
+ TOO_MANY_REQUESTS: {
824
+ status: number;
825
+ };
826
+ INVALID_INPUT: {
827
+ status: number;
828
+ data: z.ZodObject<{
829
+ issues: z.ZodArray<z.ZodObject<{
830
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
831
+ message: z.ZodString;
832
+ }, z.core.$strip>>;
833
+ }, z.core.$strip>;
834
+ };
835
+ NOT_FOUND: {
836
+ status: number;
837
+ };
838
+ TAKEN: {
839
+ status: number;
840
+ data: z.ZodObject<{
841
+ field: z.ZodString;
842
+ id: z.ZodOptional<z.ZodString>;
843
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
844
+ }, z.core.$strip>;
845
+ };
846
+ INVALID_CURSOR: {
847
+ status: number;
848
+ };
849
+ INVALID_REFERENCE: {
850
+ status: number;
851
+ data: z.ZodObject<{
852
+ field: z.ZodString;
853
+ }, z.core.$strip>;
854
+ };
855
+ INVALID_FILTER: {
856
+ status: number;
857
+ };
858
+ FILTER_TOO_SLOW: {
859
+ status: number;
860
+ };
861
+ /** The signed-in member's inbox. Plugins create notifications with `create`. */
862
+ ALWAYS_ON: {
863
+ status: number;
864
+ };
865
+ INVALID_ACTOR: {
866
+ status: number;
867
+ };
868
+ INVALID_OWNER: {
869
+ status: number;
870
+ };
871
+ INVALID_RECIPIENT: {
872
+ status: number;
873
+ };
874
+ INVALID_TYPE: {
875
+ status: number;
876
+ };
877
+ }>, Record<never, never>>;
281
878
  };