@erxes/core-contract 0.1.0-v2.1 → 0.1.0-v2.3

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 (77) hide show
  1. package/dist/activities.d.ts +1387 -139
  2. package/dist/activities.js +90 -30
  3. package/dist/audit.d.ts +1081 -33
  4. package/dist/audit.js +28 -14
  5. package/dist/auth.d.ts +2834 -26
  6. package/dist/auth.js +47 -18
  7. package/dist/automationRuns.d.ts +7 -9
  8. package/dist/automationRuns.js +12 -13
  9. package/dist/automations.d.ts +2443 -61
  10. package/dist/automations.js +41 -21
  11. package/dist/client.d.ts +30704 -0
  12. package/dist/client.js +62 -0
  13. package/dist/common.d.ts +0 -13
  14. package/dist/common.js +1 -13
  15. package/dist/companies.d.ts +1120 -10
  16. package/dist/companies.js +27 -12
  17. package/dist/contract/routes.json.js +17 -1
  18. package/dist/customerAuth.d.ts +1456 -17
  19. package/dist/customerAuth.js +33 -16
  20. package/dist/customers.d.ts +1232 -11
  21. package/dist/customers.js +28 -13
  22. package/dist/{automationDefinition.d.ts → db/src/automationDefinition.d.ts} +2 -2
  23. package/dist/{automationDefinition.js → db/src/automationDefinition.js} +2 -2
  24. package/dist/db/src/enums.js +1 -3
  25. package/dist/db/src/schema/automations.d.ts +1 -0
  26. package/dist/db/src/schema/automations.js +3 -3
  27. package/dist/db/src/schema/index.d.ts +3 -0
  28. package/dist/db/src/schema/index.js +3 -2
  29. package/dist/db/src/schema/leads.js +2 -2
  30. package/dist/db/src/schema/notes.js +92 -0
  31. package/dist/db/src/schema/payments.js +2 -2
  32. package/dist/db/src/schema/platform.js +0 -5
  33. package/dist/db/src/schema/plugins.js +7 -2
  34. package/dist/db/src/schema/transfer.js +2 -2
  35. package/dist/errors.d.ts +516 -0
  36. package/dist/errors.js +218 -0
  37. package/dist/events.d.ts +570 -121
  38. package/dist/events.js +41 -24
  39. package/dist/fields.d.ts +1456 -16
  40. package/dist/fields.js +27 -19
  41. package/dist/files.d.ts +761 -62
  42. package/dist/files.js +32 -21
  43. package/dist/index.d.ts +25187 -618
  44. package/dist/index.js +8 -7
  45. package/dist/leads.d.ts +1105 -21
  46. package/dist/leads.js +31 -13
  47. package/dist/notifications.d.ts +689 -48
  48. package/dist/notifications.js +38 -18
  49. package/dist/organizations.d.ts +260 -2
  50. package/dist/organizations.js +21 -2
  51. package/dist/payments.d.ts +1766 -62
  52. package/dist/payments.js +48 -26
  53. package/dist/platform.d.ts +12 -21
  54. package/dist/platform.js +7 -17
  55. package/dist/plugins.d.ts +802 -71
  56. package/dist/plugins.js +48 -27
  57. package/dist/products.d.ts +1380 -17
  58. package/dist/products.js +32 -16
  59. package/dist/roles.d.ts +560 -5
  60. package/dist/roles.js +20 -6
  61. package/dist/saas.d.ts +164 -2
  62. package/dist/saas.js +9 -2
  63. package/dist/tags.d.ts +340 -4
  64. package/dist/tags.js +14 -6
  65. package/dist/transfer.d.ts +1299 -12
  66. package/dist/transfer.js +32 -13
  67. package/dist/trash.d.ts +278 -21
  68. package/dist/trash.js +23 -16
  69. package/dist/users.d.ts +1206 -18
  70. package/dist/users.js +35 -13
  71. package/dist/values.d.ts +0 -9
  72. package/dist/values.js +2 -7
  73. package/dist/views.d.ts +396 -5
  74. package/dist/views.js +10 -7
  75. package/dist/webhooks.d.ts +765 -9
  76. package/dist/webhooks.js +18 -10
  77. package/package.json +6 -2
package/dist/products.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import { PRODUCT_STATUSES } from "./db/src/enums.js";
2
2
  import { productCategories, products } from "./db/src/schema/products.js";
3
3
  import "./db/src/schema/index.js";
4
+ import { COMMON_ERRORS, ERRORS } from "./errors.js";
4
5
  import { ProductKind } from "./values.js";
5
6
  import { CursorQuery, CustomFields, CustomFieldsPatch, Id, IdList, QueryBoolean, cursorPageOf, isoDate, listOf } from "./common.js";
6
7
  import { Currency } from "./money.js";
7
8
  import { PluginName } from "./plugins.js";
8
9
  import { oc } from "@orpc/contract";
9
- import { createSelectSchema, createUpdateSchema } from "drizzle-zod";
10
10
  import { z } from "zod";
11
+ import { createSelectSchema, createUpdateSchema } from "drizzle-zod";
11
12
  // src/products.ts
12
13
  const ProductStatus = z.enum(PRODUCT_STATUSES);
13
14
  /**
@@ -119,8 +120,23 @@ const CategoryFields = createUpdateSchema(productCategories, {
119
120
  * Products are archived, never deleted: orders and invoices keep pointing at
120
121
  * them. Plugins read with `products:read` and write with `products:write`.
121
122
  */
123
+ const { CATEGORY_HAS_CHILDREN, INVALID_CATEGORY, INVALID_FIELD, INVALID_FIELD_VALUE, INVALID_FILE, INVALID_PRODUCT, LIMIT_EXCEEDED, NOTHING_TO_RETRY, PLUGIN_NOT_INSTALLED, SUBJECT_REQUIRED } = ERRORS;
124
+ /** What these procedures answer with besides the common errors. */
125
+ const base = oc.errors({
126
+ ...COMMON_ERRORS,
127
+ CATEGORY_HAS_CHILDREN,
128
+ INVALID_CATEGORY,
129
+ INVALID_FIELD,
130
+ INVALID_FIELD_VALUE,
131
+ INVALID_FILE,
132
+ INVALID_PRODUCT,
133
+ LIMIT_EXCEEDED,
134
+ NOTHING_TO_RETRY,
135
+ PLUGIN_NOT_INSTALLED,
136
+ SUBJECT_REQUIRED
137
+ });
122
138
  const productsContract = {
123
- list: oc.route({
139
+ list: base.route({
124
140
  method: "GET",
125
141
  path: "/products",
126
142
  summary: "Products, newest first. A plugin gets the products it uses unless `all`; members filter by `plugin`"
@@ -135,30 +151,30 @@ const productsContract = {
135
151
  /** A filter on `views.fields({ recordType: 'product' })`: JSON of a condition group (`RecordFilter`), as views save it. */
136
152
  filter: z.string().max(2e4).optional()
137
153
  })).output(cursorPageOf(Product)),
138
- get: oc.route({
154
+ get: base.route({
139
155
  method: "GET",
140
156
  path: "/products/{id}"
141
157
  }).input(z.object({ id: Id })).output(Product),
142
- lookup: oc.route({
158
+ lookup: base.route({
143
159
  method: "GET",
144
160
  path: "/products/lookup",
145
161
  summary: "The given products (archived ones too), for order lines: `?ids=a,b`, at most 100"
146
162
  }).input(z.object({ ids: IdList })).output(z.object({ data: z.array(Product).max(100) })),
147
- create: oc.route({
163
+ create: base.route({
148
164
  method: "POST",
149
165
  path: "/products",
150
166
  successStatus: 201,
151
- summary: "Add a product. 409 PRODUCT_CODE_EXISTS / PRODUCT_BARCODE_EXISTS with the existing product's id in `data.productId` (a plugin can `use` it instead); 400 INVALID_CATEGORY, INVALID_FILE, PLUGIN_NOT_INSTALLED"
167
+ summary: "Add a product. 409 TAKEN for a code or barcode, with the existing product's id in `data.id` (a plugin can `use` it instead); 400 INVALID_CATEGORY, INVALID_FILE, PLUGIN_NOT_INSTALLED"
152
168
  }).input(ProductFields.required({
153
169
  kind: true,
154
170
  name: true
155
171
  })).output(Product),
156
- update: oc.route({
172
+ update: base.route({
157
173
  method: "PATCH",
158
174
  path: "/products/{id}",
159
175
  summary: "Change a product (`plugins`: members only). Errors as for create"
160
176
  }).input(ProductFields.extend({ id: Id }).refine((value) => Object.keys(value).some((key) => key !== "id"), "nothing to update")).output(Product),
161
- use: oc.route({
177
+ use: base.route({
162
178
  method: "POST",
163
179
  path: "/products/use",
164
180
  summary: "A plugin starts (`used`) or stops using products, so they appear in its lists (plugins only)"
@@ -166,35 +182,35 @@ const productsContract = {
166
182
  ids: z.array(Id).min(1).max(100),
167
183
  used: z.boolean()
168
184
  })).output(z.object({ data: z.array(Product).max(100) })),
169
- archive: oc.route({
185
+ archive: base.route({
170
186
  method: "POST",
171
187
  path: "/products/{id}/archive",
172
188
  summary: "Take a product out of lists and pickers; orders and invoices keep it"
173
189
  }).input(z.object({ id: Id })).output(Product),
174
- restore: oc.route({
190
+ restore: base.route({
175
191
  method: "POST",
176
192
  path: "/products/{id}/restore"
177
193
  }).input(z.object({ id: Id })).output(Product)
178
194
  };
179
195
  /** Groups of products, nested by `parentId`. */
180
196
  const productCategoriesContract = {
181
- list: oc.route({
197
+ list: base.route({
182
198
  method: "GET",
183
199
  path: "/product-categories",
184
200
  summary: "Every category, by name"
185
201
  }).output(listOf(ProductCategory)),
186
- create: oc.route({
202
+ create: base.route({
187
203
  method: "POST",
188
204
  path: "/product-categories",
189
205
  successStatus: 201,
190
- summary: "409 CATEGORY_EXISTS (same name under the same parent); 400 INVALID_CATEGORY"
206
+ summary: "409 TAKEN (same name under the same parent); 400 INVALID_CATEGORY"
191
207
  }).input(CategoryFields.required({ name: true })).output(ProductCategory),
192
- update: oc.route({
208
+ update: base.route({
193
209
  method: "PATCH",
194
210
  path: "/product-categories/{id}",
195
- summary: "409 CATEGORY_EXISTS; 400 INVALID_CATEGORY (unknown parent, or one of its own)"
211
+ summary: "409 TAKEN; 400 INVALID_CATEGORY (unknown parent, or one of its own)"
196
212
  }).input(CategoryFields.extend({ id: Id }).refine((value) => Object.keys(value).some((key) => key !== "id"), "nothing to update")).output(ProductCategory),
197
- remove: oc.route({
213
+ remove: base.route({
198
214
  method: "DELETE",
199
215
  path: "/product-categories/{id}",
200
216
  summary: "Delete an empty category; its products lose it. 409 CATEGORY_HAS_CHILDREN while it has subcategories"
package/dist/roles.d.ts CHANGED
@@ -166,7 +166,118 @@ export declare const rolesContract: {
166
166
  out: {};
167
167
  in: {};
168
168
  }>>;
169
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
169
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
170
+ UNAUTHORIZED: {
171
+ status: number;
172
+ };
173
+ NOT_ALLOWED: {
174
+ status: number;
175
+ data: z.ZodOptional<z.ZodObject<{
176
+ permission: z.ZodString;
177
+ }, z.core.$strip>>;
178
+ };
179
+ PLUGIN_ONLY: {
180
+ status: number;
181
+ };
182
+ MEMBERS_ONLY: {
183
+ status: number;
184
+ };
185
+ ORG_REQUIRED: {
186
+ status: number;
187
+ };
188
+ SCOPE_REQUIRED: {
189
+ status: number;
190
+ };
191
+ SERVICE_TOKEN_REQUIRED: {
192
+ status: number;
193
+ };
194
+ ORGANIZATION_DISABLED: {
195
+ status: number;
196
+ data: z.ZodObject<{
197
+ manageUrl: z.ZodNullable<z.ZodString>;
198
+ }, z.core.$strip>;
199
+ };
200
+ NOT_IN_PLAN: {
201
+ status: number;
202
+ data: z.ZodOptional<z.ZodObject<{
203
+ manageUrl: z.ZodNullable<z.ZodString>;
204
+ }, z.core.$strip>>;
205
+ };
206
+ READ_ONLY: {
207
+ status: number;
208
+ };
209
+ TOO_MANY_REQUESTS: {
210
+ status: number;
211
+ };
212
+ INVALID_INPUT: {
213
+ status: number;
214
+ data: z.ZodObject<{
215
+ issues: z.ZodArray<z.ZodObject<{
216
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
217
+ message: z.ZodString;
218
+ }, z.core.$strip>>;
219
+ }, z.core.$strip>;
220
+ };
221
+ NOT_FOUND: {
222
+ status: number;
223
+ };
224
+ TAKEN: {
225
+ status: number;
226
+ data: z.ZodObject<{
227
+ field: z.ZodString;
228
+ id: z.ZodOptional<z.ZodString>;
229
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
230
+ }, z.core.$strip>;
231
+ };
232
+ INVALID_CURSOR: {
233
+ status: number;
234
+ };
235
+ INVALID_REFERENCE: {
236
+ status: number;
237
+ data: z.ZodObject<{
238
+ field: z.ZodString;
239
+ }, z.core.$strip>;
240
+ };
241
+ INVALID_FILTER: {
242
+ status: number;
243
+ };
244
+ FILTER_TOO_SLOW: {
245
+ status: number;
246
+ };
247
+ BEYOND_OWN_PERMISSIONS: {
248
+ status: number;
249
+ data: z.ZodOptional<z.ZodObject<{
250
+ permissions: z.ZodArray<z.ZodString>;
251
+ }, z.core.$strip>>;
252
+ };
253
+ BUILTIN_ROLE: {
254
+ status: number;
255
+ };
256
+ FIXED_ROLE: {
257
+ status: number;
258
+ };
259
+ LIMIT_EXCEEDED: {
260
+ status: number;
261
+ };
262
+ OWNER_ONLY_PERMISSION: {
263
+ status: number;
264
+ data: z.ZodObject<{
265
+ permissions: z.ZodArray<z.ZodString>;
266
+ }, z.core.$strip>;
267
+ };
268
+ ROLE_IN_USE: {
269
+ status: number;
270
+ };
271
+ ROLE_NOT_FOUND: {
272
+ status: number;
273
+ };
274
+ UNKNOWN_PERMISSION: {
275
+ status: number;
276
+ data: z.ZodObject<{
277
+ permissions: z.ZodArray<z.ZodString>;
278
+ }, z.core.$strip>;
279
+ };
280
+ }>, Record<never, never>>;
170
281
  permissions: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
171
282
  data: z.ZodArray<z.ZodObject<{
172
283
  action: z.ZodString;
@@ -176,7 +287,118 @@ export declare const rolesContract: {
176
287
  source: z.ZodString;
177
288
  ownerOnly: z.ZodBoolean;
178
289
  }, z.core.$strip>>;
179
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
290
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
291
+ UNAUTHORIZED: {
292
+ status: number;
293
+ };
294
+ NOT_ALLOWED: {
295
+ status: number;
296
+ data: z.ZodOptional<z.ZodObject<{
297
+ permission: z.ZodString;
298
+ }, z.core.$strip>>;
299
+ };
300
+ PLUGIN_ONLY: {
301
+ status: number;
302
+ };
303
+ MEMBERS_ONLY: {
304
+ status: number;
305
+ };
306
+ ORG_REQUIRED: {
307
+ status: number;
308
+ };
309
+ SCOPE_REQUIRED: {
310
+ status: number;
311
+ };
312
+ SERVICE_TOKEN_REQUIRED: {
313
+ status: number;
314
+ };
315
+ ORGANIZATION_DISABLED: {
316
+ status: number;
317
+ data: z.ZodObject<{
318
+ manageUrl: z.ZodNullable<z.ZodString>;
319
+ }, z.core.$strip>;
320
+ };
321
+ NOT_IN_PLAN: {
322
+ status: number;
323
+ data: z.ZodOptional<z.ZodObject<{
324
+ manageUrl: z.ZodNullable<z.ZodString>;
325
+ }, z.core.$strip>>;
326
+ };
327
+ READ_ONLY: {
328
+ status: number;
329
+ };
330
+ TOO_MANY_REQUESTS: {
331
+ status: number;
332
+ };
333
+ INVALID_INPUT: {
334
+ status: number;
335
+ data: z.ZodObject<{
336
+ issues: z.ZodArray<z.ZodObject<{
337
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
338
+ message: z.ZodString;
339
+ }, z.core.$strip>>;
340
+ }, z.core.$strip>;
341
+ };
342
+ NOT_FOUND: {
343
+ status: number;
344
+ };
345
+ TAKEN: {
346
+ status: number;
347
+ data: z.ZodObject<{
348
+ field: z.ZodString;
349
+ id: z.ZodOptional<z.ZodString>;
350
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
351
+ }, z.core.$strip>;
352
+ };
353
+ INVALID_CURSOR: {
354
+ status: number;
355
+ };
356
+ INVALID_REFERENCE: {
357
+ status: number;
358
+ data: z.ZodObject<{
359
+ field: z.ZodString;
360
+ }, z.core.$strip>;
361
+ };
362
+ INVALID_FILTER: {
363
+ status: number;
364
+ };
365
+ FILTER_TOO_SLOW: {
366
+ status: number;
367
+ };
368
+ BEYOND_OWN_PERMISSIONS: {
369
+ status: number;
370
+ data: z.ZodOptional<z.ZodObject<{
371
+ permissions: z.ZodArray<z.ZodString>;
372
+ }, z.core.$strip>>;
373
+ };
374
+ BUILTIN_ROLE: {
375
+ status: number;
376
+ };
377
+ FIXED_ROLE: {
378
+ status: number;
379
+ };
380
+ LIMIT_EXCEEDED: {
381
+ status: number;
382
+ };
383
+ OWNER_ONLY_PERMISSION: {
384
+ status: number;
385
+ data: z.ZodObject<{
386
+ permissions: z.ZodArray<z.ZodString>;
387
+ }, z.core.$strip>;
388
+ };
389
+ ROLE_IN_USE: {
390
+ status: number;
391
+ };
392
+ ROLE_NOT_FOUND: {
393
+ status: number;
394
+ };
395
+ UNKNOWN_PERMISSION: {
396
+ status: number;
397
+ data: z.ZodObject<{
398
+ permissions: z.ZodArray<z.ZodString>;
399
+ }, z.core.$strip>;
400
+ };
401
+ }>, Record<never, never>>;
180
402
  create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
181
403
  name: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
182
404
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -195,7 +417,118 @@ export declare const rolesContract: {
195
417
  }, {
196
418
  out: {};
197
419
  in: {};
198
- }>, Record<never, never>, Record<never, never>>;
420
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
421
+ UNAUTHORIZED: {
422
+ status: number;
423
+ };
424
+ NOT_ALLOWED: {
425
+ status: number;
426
+ data: z.ZodOptional<z.ZodObject<{
427
+ permission: z.ZodString;
428
+ }, z.core.$strip>>;
429
+ };
430
+ PLUGIN_ONLY: {
431
+ status: number;
432
+ };
433
+ MEMBERS_ONLY: {
434
+ status: number;
435
+ };
436
+ ORG_REQUIRED: {
437
+ status: number;
438
+ };
439
+ SCOPE_REQUIRED: {
440
+ status: number;
441
+ };
442
+ SERVICE_TOKEN_REQUIRED: {
443
+ status: number;
444
+ };
445
+ ORGANIZATION_DISABLED: {
446
+ status: number;
447
+ data: z.ZodObject<{
448
+ manageUrl: z.ZodNullable<z.ZodString>;
449
+ }, z.core.$strip>;
450
+ };
451
+ NOT_IN_PLAN: {
452
+ status: number;
453
+ data: z.ZodOptional<z.ZodObject<{
454
+ manageUrl: z.ZodNullable<z.ZodString>;
455
+ }, z.core.$strip>>;
456
+ };
457
+ READ_ONLY: {
458
+ status: number;
459
+ };
460
+ TOO_MANY_REQUESTS: {
461
+ status: number;
462
+ };
463
+ INVALID_INPUT: {
464
+ status: number;
465
+ data: z.ZodObject<{
466
+ issues: z.ZodArray<z.ZodObject<{
467
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
468
+ message: z.ZodString;
469
+ }, z.core.$strip>>;
470
+ }, z.core.$strip>;
471
+ };
472
+ NOT_FOUND: {
473
+ status: number;
474
+ };
475
+ TAKEN: {
476
+ status: number;
477
+ data: z.ZodObject<{
478
+ field: z.ZodString;
479
+ id: z.ZodOptional<z.ZodString>;
480
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
481
+ }, z.core.$strip>;
482
+ };
483
+ INVALID_CURSOR: {
484
+ status: number;
485
+ };
486
+ INVALID_REFERENCE: {
487
+ status: number;
488
+ data: z.ZodObject<{
489
+ field: z.ZodString;
490
+ }, z.core.$strip>;
491
+ };
492
+ INVALID_FILTER: {
493
+ status: number;
494
+ };
495
+ FILTER_TOO_SLOW: {
496
+ status: number;
497
+ };
498
+ BEYOND_OWN_PERMISSIONS: {
499
+ status: number;
500
+ data: z.ZodOptional<z.ZodObject<{
501
+ permissions: z.ZodArray<z.ZodString>;
502
+ }, z.core.$strip>>;
503
+ };
504
+ BUILTIN_ROLE: {
505
+ status: number;
506
+ };
507
+ FIXED_ROLE: {
508
+ status: number;
509
+ };
510
+ LIMIT_EXCEEDED: {
511
+ status: number;
512
+ };
513
+ OWNER_ONLY_PERMISSION: {
514
+ status: number;
515
+ data: z.ZodObject<{
516
+ permissions: z.ZodArray<z.ZodString>;
517
+ }, z.core.$strip>;
518
+ };
519
+ ROLE_IN_USE: {
520
+ status: number;
521
+ };
522
+ ROLE_NOT_FOUND: {
523
+ status: number;
524
+ };
525
+ UNKNOWN_PERMISSION: {
526
+ status: number;
527
+ data: z.ZodObject<{
528
+ permissions: z.ZodArray<z.ZodString>;
529
+ }, z.core.$strip>;
530
+ };
531
+ }>, Record<never, never>>;
199
532
  update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
200
533
  name: z.ZodOptional<z.ZodString>;
201
534
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -215,10 +548,232 @@ export declare const rolesContract: {
215
548
  }, {
216
549
  out: {};
217
550
  in: {};
218
- }>, Record<never, never>, Record<never, never>>;
551
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
552
+ UNAUTHORIZED: {
553
+ status: number;
554
+ };
555
+ NOT_ALLOWED: {
556
+ status: number;
557
+ data: z.ZodOptional<z.ZodObject<{
558
+ permission: z.ZodString;
559
+ }, z.core.$strip>>;
560
+ };
561
+ PLUGIN_ONLY: {
562
+ status: number;
563
+ };
564
+ MEMBERS_ONLY: {
565
+ status: number;
566
+ };
567
+ ORG_REQUIRED: {
568
+ status: number;
569
+ };
570
+ SCOPE_REQUIRED: {
571
+ status: number;
572
+ };
573
+ SERVICE_TOKEN_REQUIRED: {
574
+ status: number;
575
+ };
576
+ ORGANIZATION_DISABLED: {
577
+ status: number;
578
+ data: z.ZodObject<{
579
+ manageUrl: z.ZodNullable<z.ZodString>;
580
+ }, z.core.$strip>;
581
+ };
582
+ NOT_IN_PLAN: {
583
+ status: number;
584
+ data: z.ZodOptional<z.ZodObject<{
585
+ manageUrl: z.ZodNullable<z.ZodString>;
586
+ }, z.core.$strip>>;
587
+ };
588
+ READ_ONLY: {
589
+ status: number;
590
+ };
591
+ TOO_MANY_REQUESTS: {
592
+ status: number;
593
+ };
594
+ INVALID_INPUT: {
595
+ status: number;
596
+ data: z.ZodObject<{
597
+ issues: z.ZodArray<z.ZodObject<{
598
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
599
+ message: z.ZodString;
600
+ }, z.core.$strip>>;
601
+ }, z.core.$strip>;
602
+ };
603
+ NOT_FOUND: {
604
+ status: number;
605
+ };
606
+ TAKEN: {
607
+ status: number;
608
+ data: z.ZodObject<{
609
+ field: z.ZodString;
610
+ id: z.ZodOptional<z.ZodString>;
611
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
612
+ }, z.core.$strip>;
613
+ };
614
+ INVALID_CURSOR: {
615
+ status: number;
616
+ };
617
+ INVALID_REFERENCE: {
618
+ status: number;
619
+ data: z.ZodObject<{
620
+ field: z.ZodString;
621
+ }, z.core.$strip>;
622
+ };
623
+ INVALID_FILTER: {
624
+ status: number;
625
+ };
626
+ FILTER_TOO_SLOW: {
627
+ status: number;
628
+ };
629
+ BEYOND_OWN_PERMISSIONS: {
630
+ status: number;
631
+ data: z.ZodOptional<z.ZodObject<{
632
+ permissions: z.ZodArray<z.ZodString>;
633
+ }, z.core.$strip>>;
634
+ };
635
+ BUILTIN_ROLE: {
636
+ status: number;
637
+ };
638
+ FIXED_ROLE: {
639
+ status: number;
640
+ };
641
+ LIMIT_EXCEEDED: {
642
+ status: number;
643
+ };
644
+ OWNER_ONLY_PERMISSION: {
645
+ status: number;
646
+ data: z.ZodObject<{
647
+ permissions: z.ZodArray<z.ZodString>;
648
+ }, z.core.$strip>;
649
+ };
650
+ ROLE_IN_USE: {
651
+ status: number;
652
+ };
653
+ ROLE_NOT_FOUND: {
654
+ status: number;
655
+ };
656
+ UNKNOWN_PERMISSION: {
657
+ status: number;
658
+ data: z.ZodObject<{
659
+ permissions: z.ZodArray<z.ZodString>;
660
+ }, z.core.$strip>;
661
+ };
662
+ }>, Record<never, never>>;
219
663
  remove: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
220
664
  key: z.ZodString;
221
665
  }, z.core.$strip>, z.ZodObject<{
222
666
  ok: z.ZodLiteral<true>;
223
- }, 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
+ BEYOND_OWN_PERMISSIONS: {
746
+ status: number;
747
+ data: z.ZodOptional<z.ZodObject<{
748
+ permissions: z.ZodArray<z.ZodString>;
749
+ }, z.core.$strip>>;
750
+ };
751
+ BUILTIN_ROLE: {
752
+ status: number;
753
+ };
754
+ FIXED_ROLE: {
755
+ status: number;
756
+ };
757
+ LIMIT_EXCEEDED: {
758
+ status: number;
759
+ };
760
+ OWNER_ONLY_PERMISSION: {
761
+ status: number;
762
+ data: z.ZodObject<{
763
+ permissions: z.ZodArray<z.ZodString>;
764
+ }, z.core.$strip>;
765
+ };
766
+ ROLE_IN_USE: {
767
+ status: number;
768
+ };
769
+ ROLE_NOT_FOUND: {
770
+ status: number;
771
+ };
772
+ UNKNOWN_PERMISSION: {
773
+ status: number;
774
+ data: z.ZodObject<{
775
+ permissions: z.ZodArray<z.ZodString>;
776
+ }, z.core.$strip>;
777
+ };
778
+ }>, Record<never, never>>;
224
779
  };