@erxes/core-contract 0.1.0-v2.8 → 0.1.0-v2.9
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.
- package/dist/activities.d.ts +154 -14
- package/dist/activities.js +20 -8
- package/dist/automationRuns.d.ts +38 -1
- package/dist/automationRuns.js +34 -3
- package/dist/automations.d.ts +3 -0
- package/dist/client.d.ts +501 -3
- package/dist/client.js +23 -1
- package/dist/contract/routes.json.js +8 -0
- package/dist/db/src/enums.js +2 -1
- package/dist/events.js +1 -1
- package/dist/index.d.ts +166 -3
- package/dist/index.js +4 -3
- package/dist/pluginJobs.d.ts +1 -0
- package/dist/pluginJobs.js +5 -0
- package/dist/plugins.d.ts +10 -0
- package/dist/plugins.js +7 -8
- package/dist/timelines.d.ts +36 -0
- package/dist/timelines.js +38 -0
- package/package.json +2 -1
package/dist/client.d.ts
CHANGED
|
@@ -325,6 +325,153 @@ export declare const orpc: {
|
|
|
325
325
|
targetType: string;
|
|
326
326
|
targetId: string;
|
|
327
327
|
}>;
|
|
328
|
+
importNote: import("@orpc/tanstack-query").ProcedureUtils<Record<never, never>, {
|
|
329
|
+
targetType: string;
|
|
330
|
+
targetId: string;
|
|
331
|
+
body: string;
|
|
332
|
+
authorId: string;
|
|
333
|
+
createdAt: string;
|
|
334
|
+
dedupeKey: string;
|
|
335
|
+
}, {
|
|
336
|
+
activity: {
|
|
337
|
+
id: string;
|
|
338
|
+
targetType: string;
|
|
339
|
+
targetId: string;
|
|
340
|
+
source: string;
|
|
341
|
+
type: string;
|
|
342
|
+
summary: string | null;
|
|
343
|
+
data: Record<string, unknown>;
|
|
344
|
+
entityType: string | null;
|
|
345
|
+
entityId: string | null;
|
|
346
|
+
link: string | null;
|
|
347
|
+
actorType: "customer" | "plugin" | "system" | "user";
|
|
348
|
+
actorId: string | null;
|
|
349
|
+
occurredAt: string;
|
|
350
|
+
actorName: string | null;
|
|
351
|
+
actorAvatarUrl: string | null;
|
|
352
|
+
note: {
|
|
353
|
+
body: string;
|
|
354
|
+
mentions: string[];
|
|
355
|
+
fileIds: string[];
|
|
356
|
+
pinnedAt: string | null;
|
|
357
|
+
editedAt: string | null;
|
|
358
|
+
} | null;
|
|
359
|
+
reactions: Record<string, string[]>;
|
|
360
|
+
};
|
|
361
|
+
created: boolean;
|
|
362
|
+
}, import("@orpc/contract").ErrorFromErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
363
|
+
UNAUTHORIZED: {
|
|
364
|
+
status: number;
|
|
365
|
+
};
|
|
366
|
+
NOT_ALLOWED: {
|
|
367
|
+
status: number;
|
|
368
|
+
data: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
369
|
+
permission: import("zod").ZodString;
|
|
370
|
+
}, import("zod/v4/core").$strip>>;
|
|
371
|
+
};
|
|
372
|
+
PLUGIN_ONLY: {
|
|
373
|
+
status: number;
|
|
374
|
+
};
|
|
375
|
+
MEMBERS_ONLY: {
|
|
376
|
+
status: number;
|
|
377
|
+
};
|
|
378
|
+
ORG_REQUIRED: {
|
|
379
|
+
status: number;
|
|
380
|
+
};
|
|
381
|
+
SCOPE_REQUIRED: {
|
|
382
|
+
status: number;
|
|
383
|
+
};
|
|
384
|
+
SERVICE_TOKEN_REQUIRED: {
|
|
385
|
+
status: number;
|
|
386
|
+
};
|
|
387
|
+
ORGANIZATION_DISABLED: {
|
|
388
|
+
status: number;
|
|
389
|
+
data: import("zod").ZodObject<{
|
|
390
|
+
manageUrl: import("zod").ZodNullable<import("zod").ZodString>;
|
|
391
|
+
}, import("zod/v4/core").$strip>;
|
|
392
|
+
};
|
|
393
|
+
NOT_IN_PLAN: {
|
|
394
|
+
status: number;
|
|
395
|
+
data: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
396
|
+
manageUrl: import("zod").ZodNullable<import("zod").ZodString>;
|
|
397
|
+
}, import("zod/v4/core").$strip>>;
|
|
398
|
+
};
|
|
399
|
+
READ_ONLY: {
|
|
400
|
+
status: number;
|
|
401
|
+
};
|
|
402
|
+
TOO_MANY_REQUESTS: {
|
|
403
|
+
status: number;
|
|
404
|
+
};
|
|
405
|
+
INVALID_INPUT: {
|
|
406
|
+
status: number;
|
|
407
|
+
data: import("zod").ZodObject<{
|
|
408
|
+
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
409
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
|
|
410
|
+
message: import("zod").ZodString;
|
|
411
|
+
}, import("zod/v4/core").$strip>>;
|
|
412
|
+
}, import("zod/v4/core").$strip>;
|
|
413
|
+
};
|
|
414
|
+
NOT_FOUND: {
|
|
415
|
+
status: number;
|
|
416
|
+
};
|
|
417
|
+
TAKEN: {
|
|
418
|
+
status: number;
|
|
419
|
+
data: import("zod").ZodObject<{
|
|
420
|
+
field: import("zod").ZodString;
|
|
421
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
422
|
+
values: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
423
|
+
}, import("zod/v4/core").$strip>;
|
|
424
|
+
};
|
|
425
|
+
INVALID_CURSOR: {
|
|
426
|
+
status: number;
|
|
427
|
+
};
|
|
428
|
+
INVALID_REFERENCE: {
|
|
429
|
+
status: number;
|
|
430
|
+
data: import("zod").ZodObject<{
|
|
431
|
+
field: import("zod").ZodString;
|
|
432
|
+
}, import("zod/v4/core").$strip>;
|
|
433
|
+
};
|
|
434
|
+
INVALID_FILTER: {
|
|
435
|
+
status: number;
|
|
436
|
+
};
|
|
437
|
+
FILTER_TOO_SLOW: {
|
|
438
|
+
status: number;
|
|
439
|
+
};
|
|
440
|
+
INVALID_ACTOR: {
|
|
441
|
+
status: number;
|
|
442
|
+
};
|
|
443
|
+
INVALID_FILE: {
|
|
444
|
+
status: number;
|
|
445
|
+
};
|
|
446
|
+
INVALID_OWNER: {
|
|
447
|
+
status: number;
|
|
448
|
+
};
|
|
449
|
+
INVALID_RECIPIENT: {
|
|
450
|
+
status: number;
|
|
451
|
+
};
|
|
452
|
+
INVALID_TYPE: {
|
|
453
|
+
status: number;
|
|
454
|
+
};
|
|
455
|
+
MASS_DELETE_STOPPED: {
|
|
456
|
+
status: number;
|
|
457
|
+
};
|
|
458
|
+
NOT_AUTHOR: {
|
|
459
|
+
status: number;
|
|
460
|
+
};
|
|
461
|
+
NO_TIMELINE: {
|
|
462
|
+
status: number;
|
|
463
|
+
};
|
|
464
|
+
TOO_MANY_REACTIONS: {
|
|
465
|
+
status: number;
|
|
466
|
+
};
|
|
467
|
+
}>>> & import("@orpc/tanstack-query").GeneralUtils<{
|
|
468
|
+
targetType: string;
|
|
469
|
+
targetId: string;
|
|
470
|
+
body: string;
|
|
471
|
+
authorId: string;
|
|
472
|
+
createdAt: string;
|
|
473
|
+
dedupeKey: string;
|
|
474
|
+
}>;
|
|
328
475
|
react: import("@orpc/tanstack-query").ProcedureUtils<Record<never, never>, {
|
|
329
476
|
id: string;
|
|
330
477
|
emoji: string;
|
|
@@ -1513,7 +1660,7 @@ export declare const orpc: {
|
|
|
1513
1660
|
fields: {
|
|
1514
1661
|
key: string;
|
|
1515
1662
|
label: string;
|
|
1516
|
-
type: "boolean" | "custom_field" | "date" | "json" | "lead_stage" | "longtext" | "members" | "number" | "recipients" | "select" | "tags" | "text";
|
|
1663
|
+
type: "boolean" | "custom_field" | "date" | "json" | "lead_stage" | "longtext" | "members" | "number" | "plugin_record" | "recipients" | "select" | "tags" | "text";
|
|
1517
1664
|
required: boolean;
|
|
1518
1665
|
options?: {
|
|
1519
1666
|
value: string;
|
|
@@ -1522,6 +1669,8 @@ export declare const orpc: {
|
|
|
1522
1669
|
description?: string | undefined;
|
|
1523
1670
|
placeholder?: string | undefined;
|
|
1524
1671
|
sameTypeAs?: string | undefined;
|
|
1672
|
+
recordType?: string | undefined;
|
|
1673
|
+
dependsOn?: string | undefined;
|
|
1525
1674
|
}[];
|
|
1526
1675
|
}[];
|
|
1527
1676
|
}, import("@orpc/contract").ErrorFromErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
@@ -22232,7 +22381,7 @@ export declare const orpc: {
|
|
|
22232
22381
|
fields?: {
|
|
22233
22382
|
key: string;
|
|
22234
22383
|
label: string;
|
|
22235
|
-
type: "boolean" | "custom_field" | "date" | "json" | "lead_stage" | "longtext" | "members" | "number" | "recipients" | "select" | "tags" | "text";
|
|
22384
|
+
type: "boolean" | "custom_field" | "date" | "json" | "lead_stage" | "longtext" | "members" | "number" | "plugin_record" | "recipients" | "select" | "tags" | "text";
|
|
22236
22385
|
required?: boolean | undefined;
|
|
22237
22386
|
options?: {
|
|
22238
22387
|
value: string;
|
|
@@ -22241,12 +22390,15 @@ export declare const orpc: {
|
|
|
22241
22390
|
description?: string | undefined;
|
|
22242
22391
|
placeholder?: string | undefined;
|
|
22243
22392
|
sameTypeAs?: string | undefined;
|
|
22393
|
+
recordType?: string | undefined;
|
|
22394
|
+
dependsOn?: string | undefined;
|
|
22244
22395
|
}[] | undefined;
|
|
22245
22396
|
}[] | undefined;
|
|
22246
22397
|
timelines?: {
|
|
22247
22398
|
type: string;
|
|
22248
22399
|
label: string;
|
|
22249
22400
|
permission?: string | undefined;
|
|
22401
|
+
recordAccess?: boolean | undefined;
|
|
22250
22402
|
}[] | undefined;
|
|
22251
22403
|
activityTypes?: {
|
|
22252
22404
|
type: string;
|
|
@@ -22258,6 +22410,7 @@ export declare const orpc: {
|
|
|
22258
22410
|
jobs?: {
|
|
22259
22411
|
name: string;
|
|
22260
22412
|
cron?: string | undefined;
|
|
22413
|
+
onInstall?: boolean | undefined;
|
|
22261
22414
|
retry?: {
|
|
22262
22415
|
attempts: number;
|
|
22263
22416
|
delay: number;
|
|
@@ -22432,7 +22585,7 @@ export declare const orpc: {
|
|
|
22432
22585
|
fields?: {
|
|
22433
22586
|
key: string;
|
|
22434
22587
|
label: string;
|
|
22435
|
-
type: "boolean" | "custom_field" | "date" | "json" | "lead_stage" | "longtext" | "members" | "number" | "recipients" | "select" | "tags" | "text";
|
|
22588
|
+
type: "boolean" | "custom_field" | "date" | "json" | "lead_stage" | "longtext" | "members" | "number" | "plugin_record" | "recipients" | "select" | "tags" | "text";
|
|
22436
22589
|
required?: boolean | undefined;
|
|
22437
22590
|
options?: {
|
|
22438
22591
|
value: string;
|
|
@@ -22441,12 +22594,15 @@ export declare const orpc: {
|
|
|
22441
22594
|
description?: string | undefined;
|
|
22442
22595
|
placeholder?: string | undefined;
|
|
22443
22596
|
sameTypeAs?: string | undefined;
|
|
22597
|
+
recordType?: string | undefined;
|
|
22598
|
+
dependsOn?: string | undefined;
|
|
22444
22599
|
}[] | undefined;
|
|
22445
22600
|
}[] | undefined;
|
|
22446
22601
|
timelines?: {
|
|
22447
22602
|
type: string;
|
|
22448
22603
|
label: string;
|
|
22449
22604
|
permission?: string | undefined;
|
|
22605
|
+
recordAccess?: boolean | undefined;
|
|
22450
22606
|
}[] | undefined;
|
|
22451
22607
|
activityTypes?: {
|
|
22452
22608
|
type: string;
|
|
@@ -22458,6 +22614,7 @@ export declare const orpc: {
|
|
|
22458
22614
|
jobs?: {
|
|
22459
22615
|
name: string;
|
|
22460
22616
|
cron?: string | undefined;
|
|
22617
|
+
onInstall?: boolean | undefined;
|
|
22461
22618
|
retry?: {
|
|
22462
22619
|
attempts: number;
|
|
22463
22620
|
delay: number;
|
|
@@ -31847,6 +32004,347 @@ export declare const contactQueries: {
|
|
|
31847
32004
|
};
|
|
31848
32005
|
}>>>, "input" | "staleTime">>;
|
|
31849
32006
|
};
|
|
32007
|
+
/**
|
|
32008
|
+
* Where erxes-ui's list filter searches customers and companies for `customer` and `company`
|
|
32009
|
+
* fields: `<ListFilter contacts={contactSearchQueries} … />`. A rule's picked contacts load by id.
|
|
32010
|
+
*/
|
|
32011
|
+
export declare const contactSearchQueries: {
|
|
32012
|
+
customers: ({ search, ids }: {
|
|
32013
|
+
search?: string;
|
|
32014
|
+
ids?: string[];
|
|
32015
|
+
}) => NoInfer<{
|
|
32016
|
+
input: {
|
|
32017
|
+
limit: number;
|
|
32018
|
+
search: string | undefined;
|
|
32019
|
+
ids: string | undefined;
|
|
32020
|
+
};
|
|
32021
|
+
staleTime: number;
|
|
32022
|
+
} & Omit<import("@orpc/tanstack-query").QueryOptionsBase<{
|
|
32023
|
+
data: {
|
|
32024
|
+
id: string;
|
|
32025
|
+
state: "customer" | "lead";
|
|
32026
|
+
firstName: string | null;
|
|
32027
|
+
middleName: string | null;
|
|
32028
|
+
lastName: string | null;
|
|
32029
|
+
avatarUrl: string | null;
|
|
32030
|
+
primaryEmail: string | null;
|
|
32031
|
+
emails: string[];
|
|
32032
|
+
primaryPhone: string | null;
|
|
32033
|
+
phones: string[];
|
|
32034
|
+
sex: 0 | 1 | 2 | 9 | null;
|
|
32035
|
+
birthDate: string | null;
|
|
32036
|
+
position: string | null;
|
|
32037
|
+
department: string | null;
|
|
32038
|
+
code: string | null;
|
|
32039
|
+
description: string | null;
|
|
32040
|
+
ownerId: string | null;
|
|
32041
|
+
leadStageId: string | null;
|
|
32042
|
+
leadStageChangedAt: string | null;
|
|
32043
|
+
disqualifyReason: string | null;
|
|
32044
|
+
source: string | null;
|
|
32045
|
+
sourceDetails: Record<string, string>;
|
|
32046
|
+
convertedAt: string | null;
|
|
32047
|
+
lastActivityAt: string;
|
|
32048
|
+
createdAt: string;
|
|
32049
|
+
updatedAt: string;
|
|
32050
|
+
tagIds: string[];
|
|
32051
|
+
customFields: Record<string, string | number | boolean | string[]>;
|
|
32052
|
+
}[];
|
|
32053
|
+
pageInfo: {
|
|
32054
|
+
hasNextPage: boolean;
|
|
32055
|
+
hasPreviousPage: boolean;
|
|
32056
|
+
startCursor: string | null;
|
|
32057
|
+
endCursor: string | null;
|
|
32058
|
+
};
|
|
32059
|
+
totalCount: number;
|
|
32060
|
+
totalCapped?: boolean | undefined;
|
|
32061
|
+
}, import("@orpc/contract").ErrorFromErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
32062
|
+
UNAUTHORIZED: {
|
|
32063
|
+
status: number;
|
|
32064
|
+
};
|
|
32065
|
+
NOT_ALLOWED: {
|
|
32066
|
+
status: number;
|
|
32067
|
+
data: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
32068
|
+
permission: import("zod").ZodString;
|
|
32069
|
+
}, import("zod/v4/core").$strip>>;
|
|
32070
|
+
};
|
|
32071
|
+
PLUGIN_ONLY: {
|
|
32072
|
+
status: number;
|
|
32073
|
+
};
|
|
32074
|
+
MEMBERS_ONLY: {
|
|
32075
|
+
status: number;
|
|
32076
|
+
};
|
|
32077
|
+
ORG_REQUIRED: {
|
|
32078
|
+
status: number;
|
|
32079
|
+
};
|
|
32080
|
+
SCOPE_REQUIRED: {
|
|
32081
|
+
status: number;
|
|
32082
|
+
};
|
|
32083
|
+
SERVICE_TOKEN_REQUIRED: {
|
|
32084
|
+
status: number;
|
|
32085
|
+
};
|
|
32086
|
+
ORGANIZATION_DISABLED: {
|
|
32087
|
+
status: number;
|
|
32088
|
+
data: import("zod").ZodObject<{
|
|
32089
|
+
manageUrl: import("zod").ZodNullable<import("zod").ZodString>;
|
|
32090
|
+
}, import("zod/v4/core").$strip>;
|
|
32091
|
+
};
|
|
32092
|
+
NOT_IN_PLAN: {
|
|
32093
|
+
status: number;
|
|
32094
|
+
data: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
32095
|
+
manageUrl: import("zod").ZodNullable<import("zod").ZodString>;
|
|
32096
|
+
}, import("zod/v4/core").$strip>>;
|
|
32097
|
+
};
|
|
32098
|
+
READ_ONLY: {
|
|
32099
|
+
status: number;
|
|
32100
|
+
};
|
|
32101
|
+
TOO_MANY_REQUESTS: {
|
|
32102
|
+
status: number;
|
|
32103
|
+
};
|
|
32104
|
+
INVALID_INPUT: {
|
|
32105
|
+
status: number;
|
|
32106
|
+
data: import("zod").ZodObject<{
|
|
32107
|
+
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
32108
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
|
|
32109
|
+
message: import("zod").ZodString;
|
|
32110
|
+
}, import("zod/v4/core").$strip>>;
|
|
32111
|
+
}, import("zod/v4/core").$strip>;
|
|
32112
|
+
};
|
|
32113
|
+
NOT_FOUND: {
|
|
32114
|
+
status: number;
|
|
32115
|
+
};
|
|
32116
|
+
TAKEN: {
|
|
32117
|
+
status: number;
|
|
32118
|
+
data: import("zod").ZodObject<{
|
|
32119
|
+
field: import("zod").ZodString;
|
|
32120
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32121
|
+
values: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
32122
|
+
}, import("zod/v4/core").$strip>;
|
|
32123
|
+
};
|
|
32124
|
+
INVALID_CURSOR: {
|
|
32125
|
+
status: number;
|
|
32126
|
+
};
|
|
32127
|
+
INVALID_REFERENCE: {
|
|
32128
|
+
status: number;
|
|
32129
|
+
data: import("zod").ZodObject<{
|
|
32130
|
+
field: import("zod").ZodString;
|
|
32131
|
+
}, import("zod/v4/core").$strip>;
|
|
32132
|
+
};
|
|
32133
|
+
INVALID_FILTER: {
|
|
32134
|
+
status: number;
|
|
32135
|
+
};
|
|
32136
|
+
FILTER_TOO_SLOW: {
|
|
32137
|
+
status: number;
|
|
32138
|
+
};
|
|
32139
|
+
INVALID_ACTOR: {
|
|
32140
|
+
status: number;
|
|
32141
|
+
};
|
|
32142
|
+
INVALID_FIELD: {
|
|
32143
|
+
status: number;
|
|
32144
|
+
data: import("zod").ZodObject<{
|
|
32145
|
+
fieldId: import("zod").ZodString;
|
|
32146
|
+
}, import("zod/v4/core").$strip>;
|
|
32147
|
+
};
|
|
32148
|
+
INVALID_FIELD_VALUE: {
|
|
32149
|
+
status: number;
|
|
32150
|
+
data: import("zod").ZodObject<{
|
|
32151
|
+
fieldId: import("zod").ZodString;
|
|
32152
|
+
}, import("zod/v4/core").$strip>;
|
|
32153
|
+
};
|
|
32154
|
+
INVALID_OWNER: {
|
|
32155
|
+
status: number;
|
|
32156
|
+
};
|
|
32157
|
+
INVALID_TAG: {
|
|
32158
|
+
status: number;
|
|
32159
|
+
};
|
|
32160
|
+
INVALID_TYPE: {
|
|
32161
|
+
status: number;
|
|
32162
|
+
};
|
|
32163
|
+
MASS_DELETE_STOPPED: {
|
|
32164
|
+
status: number;
|
|
32165
|
+
};
|
|
32166
|
+
NOT_A_LEAD: {
|
|
32167
|
+
status: number;
|
|
32168
|
+
};
|
|
32169
|
+
PLUGIN_FIELD: {
|
|
32170
|
+
status: number;
|
|
32171
|
+
data: import("zod").ZodObject<{
|
|
32172
|
+
fieldId: import("zod").ZodString;
|
|
32173
|
+
plugin: import("zod").ZodString;
|
|
32174
|
+
}, import("zod/v4/core").$strip>;
|
|
32175
|
+
};
|
|
32176
|
+
TAG_LIMIT: {
|
|
32177
|
+
status: number;
|
|
32178
|
+
};
|
|
32179
|
+
}>>>, "input" | "staleTime">>;
|
|
32180
|
+
companies: ({ search, ids }: {
|
|
32181
|
+
search?: string;
|
|
32182
|
+
ids?: string[];
|
|
32183
|
+
}) => NoInfer<{
|
|
32184
|
+
input: {
|
|
32185
|
+
limit: number;
|
|
32186
|
+
search: string | undefined;
|
|
32187
|
+
ids: string | undefined;
|
|
32188
|
+
};
|
|
32189
|
+
staleTime: number;
|
|
32190
|
+
} & Omit<import("@orpc/tanstack-query").QueryOptionsBase<{
|
|
32191
|
+
data: {
|
|
32192
|
+
id: string;
|
|
32193
|
+
primaryName: string;
|
|
32194
|
+
state: "customer" | "lead";
|
|
32195
|
+
names: string[];
|
|
32196
|
+
avatarUrl: string | null;
|
|
32197
|
+
primaryEmail: string | null;
|
|
32198
|
+
emails: string[];
|
|
32199
|
+
primaryPhone: string | null;
|
|
32200
|
+
phones: string[];
|
|
32201
|
+
website: string | null;
|
|
32202
|
+
industry: string | null;
|
|
32203
|
+
size: number | null;
|
|
32204
|
+
businessType: string | null;
|
|
32205
|
+
code: string | null;
|
|
32206
|
+
description: string | null;
|
|
32207
|
+
ownerId: string | null;
|
|
32208
|
+
leadStageId: string | null;
|
|
32209
|
+
leadStageChangedAt: string | null;
|
|
32210
|
+
disqualifyReason: string | null;
|
|
32211
|
+
source: string | null;
|
|
32212
|
+
sourceDetails: Record<string, string>;
|
|
32213
|
+
convertedAt: string | null;
|
|
32214
|
+
lastActivityAt: string;
|
|
32215
|
+
createdAt: string;
|
|
32216
|
+
updatedAt: string;
|
|
32217
|
+
tagIds: string[];
|
|
32218
|
+
customFields: Record<string, string | number | boolean | string[]>;
|
|
32219
|
+
}[];
|
|
32220
|
+
pageInfo: {
|
|
32221
|
+
hasNextPage: boolean;
|
|
32222
|
+
hasPreviousPage: boolean;
|
|
32223
|
+
startCursor: string | null;
|
|
32224
|
+
endCursor: string | null;
|
|
32225
|
+
};
|
|
32226
|
+
totalCount: number;
|
|
32227
|
+
totalCapped?: boolean | undefined;
|
|
32228
|
+
}, import("@orpc/contract").ErrorFromErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
32229
|
+
UNAUTHORIZED: {
|
|
32230
|
+
status: number;
|
|
32231
|
+
};
|
|
32232
|
+
NOT_ALLOWED: {
|
|
32233
|
+
status: number;
|
|
32234
|
+
data: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
32235
|
+
permission: import("zod").ZodString;
|
|
32236
|
+
}, import("zod/v4/core").$strip>>;
|
|
32237
|
+
};
|
|
32238
|
+
PLUGIN_ONLY: {
|
|
32239
|
+
status: number;
|
|
32240
|
+
};
|
|
32241
|
+
MEMBERS_ONLY: {
|
|
32242
|
+
status: number;
|
|
32243
|
+
};
|
|
32244
|
+
ORG_REQUIRED: {
|
|
32245
|
+
status: number;
|
|
32246
|
+
};
|
|
32247
|
+
SCOPE_REQUIRED: {
|
|
32248
|
+
status: number;
|
|
32249
|
+
};
|
|
32250
|
+
SERVICE_TOKEN_REQUIRED: {
|
|
32251
|
+
status: number;
|
|
32252
|
+
};
|
|
32253
|
+
ORGANIZATION_DISABLED: {
|
|
32254
|
+
status: number;
|
|
32255
|
+
data: import("zod").ZodObject<{
|
|
32256
|
+
manageUrl: import("zod").ZodNullable<import("zod").ZodString>;
|
|
32257
|
+
}, import("zod/v4/core").$strip>;
|
|
32258
|
+
};
|
|
32259
|
+
NOT_IN_PLAN: {
|
|
32260
|
+
status: number;
|
|
32261
|
+
data: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
32262
|
+
manageUrl: import("zod").ZodNullable<import("zod").ZodString>;
|
|
32263
|
+
}, import("zod/v4/core").$strip>>;
|
|
32264
|
+
};
|
|
32265
|
+
READ_ONLY: {
|
|
32266
|
+
status: number;
|
|
32267
|
+
};
|
|
32268
|
+
TOO_MANY_REQUESTS: {
|
|
32269
|
+
status: number;
|
|
32270
|
+
};
|
|
32271
|
+
INVALID_INPUT: {
|
|
32272
|
+
status: number;
|
|
32273
|
+
data: import("zod").ZodObject<{
|
|
32274
|
+
issues: import("zod").ZodArray<import("zod").ZodObject<{
|
|
32275
|
+
path: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
|
|
32276
|
+
message: import("zod").ZodString;
|
|
32277
|
+
}, import("zod/v4/core").$strip>>;
|
|
32278
|
+
}, import("zod/v4/core").$strip>;
|
|
32279
|
+
};
|
|
32280
|
+
NOT_FOUND: {
|
|
32281
|
+
status: number;
|
|
32282
|
+
};
|
|
32283
|
+
TAKEN: {
|
|
32284
|
+
status: number;
|
|
32285
|
+
data: import("zod").ZodObject<{
|
|
32286
|
+
field: import("zod").ZodString;
|
|
32287
|
+
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32288
|
+
values: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
32289
|
+
}, import("zod/v4/core").$strip>;
|
|
32290
|
+
};
|
|
32291
|
+
INVALID_CURSOR: {
|
|
32292
|
+
status: number;
|
|
32293
|
+
};
|
|
32294
|
+
INVALID_REFERENCE: {
|
|
32295
|
+
status: number;
|
|
32296
|
+
data: import("zod").ZodObject<{
|
|
32297
|
+
field: import("zod").ZodString;
|
|
32298
|
+
}, import("zod/v4/core").$strip>;
|
|
32299
|
+
};
|
|
32300
|
+
INVALID_FILTER: {
|
|
32301
|
+
status: number;
|
|
32302
|
+
};
|
|
32303
|
+
FILTER_TOO_SLOW: {
|
|
32304
|
+
status: number;
|
|
32305
|
+
};
|
|
32306
|
+
INVALID_ACTOR: {
|
|
32307
|
+
status: number;
|
|
32308
|
+
};
|
|
32309
|
+
INVALID_FIELD: {
|
|
32310
|
+
status: number;
|
|
32311
|
+
data: import("zod").ZodObject<{
|
|
32312
|
+
fieldId: import("zod").ZodString;
|
|
32313
|
+
}, import("zod/v4/core").$strip>;
|
|
32314
|
+
};
|
|
32315
|
+
INVALID_FIELD_VALUE: {
|
|
32316
|
+
status: number;
|
|
32317
|
+
data: import("zod").ZodObject<{
|
|
32318
|
+
fieldId: import("zod").ZodString;
|
|
32319
|
+
}, import("zod/v4/core").$strip>;
|
|
32320
|
+
};
|
|
32321
|
+
INVALID_OWNER: {
|
|
32322
|
+
status: number;
|
|
32323
|
+
};
|
|
32324
|
+
INVALID_TAG: {
|
|
32325
|
+
status: number;
|
|
32326
|
+
};
|
|
32327
|
+
INVALID_TYPE: {
|
|
32328
|
+
status: number;
|
|
32329
|
+
};
|
|
32330
|
+
MASS_DELETE_STOPPED: {
|
|
32331
|
+
status: number;
|
|
32332
|
+
};
|
|
32333
|
+
NOT_A_LEAD: {
|
|
32334
|
+
status: number;
|
|
32335
|
+
};
|
|
32336
|
+
PLUGIN_FIELD: {
|
|
32337
|
+
status: number;
|
|
32338
|
+
data: import("zod").ZodObject<{
|
|
32339
|
+
fieldId: import("zod").ZodString;
|
|
32340
|
+
plugin: import("zod").ZodString;
|
|
32341
|
+
}, import("zod/v4/core").$strip>;
|
|
32342
|
+
};
|
|
32343
|
+
TAG_LIMIT: {
|
|
32344
|
+
status: number;
|
|
32345
|
+
};
|
|
32346
|
+
}>>>, "input" | "staleTime">>;
|
|
32347
|
+
};
|
|
31850
32348
|
/** Any error core answers with: one per code in `ERRORS`, with that code's `data`. */
|
|
31851
32349
|
type ApiError = ORPCErrorFromErrorMap<typeof ERRORS>;
|
|
31852
32350
|
/**
|
package/dist/client.js
CHANGED
|
@@ -63,6 +63,28 @@ const contactQueries = {
|
|
|
63
63
|
})
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
|
+
* Where erxes-ui's list filter searches customers and companies for `customer` and `company`
|
|
67
|
+
* fields: `<ListFilter contacts={contactSearchQueries} … />`. A rule's picked contacts load by id.
|
|
68
|
+
*/
|
|
69
|
+
const contactSearchQueries = {
|
|
70
|
+
customers: ({ search, ids }) => orpc.customers.list.queryOptions({
|
|
71
|
+
input: {
|
|
72
|
+
limit: ids ? 100 : 20,
|
|
73
|
+
search,
|
|
74
|
+
ids: ids?.join(",")
|
|
75
|
+
},
|
|
76
|
+
staleTime: 6e4
|
|
77
|
+
}),
|
|
78
|
+
companies: ({ search, ids }) => orpc.companies.list.queryOptions({
|
|
79
|
+
input: {
|
|
80
|
+
limit: ids ? 100 : 20,
|
|
81
|
+
search,
|
|
82
|
+
ids: ids?.join(",")
|
|
83
|
+
},
|
|
84
|
+
staleTime: 6e4
|
|
85
|
+
})
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
66
88
|
* Whether core answered with `code` (`TAKEN`, `NOT_FOUND`, …). It narrows
|
|
67
89
|
* `error.data` to what `ERRORS` declares for the code, so the field a
|
|
68
90
|
* `TAKEN` is about reads as `error.data.field`.
|
|
@@ -74,4 +96,4 @@ const messageOf = (error) => {
|
|
|
74
96
|
if (issue) return `${issue.path.join(".")}: ${issue.message}`;
|
|
75
97
|
return error instanceof Error ? error.message : "Something went wrong. Try again.";
|
|
76
98
|
};
|
|
77
|
-
export { contactQueries, isApiError, memberQueries, messageOf, orpc };
|
|
99
|
+
export { contactQueries, contactSearchQueries, isApiError, memberQueries, messageOf, orpc };
|
|
@@ -17,6 +17,14 @@ var routes_default = {
|
|
|
17
17
|
"path": "/activities/notes"
|
|
18
18
|
}
|
|
19
19
|
} },
|
|
20
|
+
"importNote": { "~orpc": {
|
|
21
|
+
"errorMap": {},
|
|
22
|
+
"meta": {},
|
|
23
|
+
"route": {
|
|
24
|
+
"method": "POST",
|
|
25
|
+
"path": "/activities/notes/import"
|
|
26
|
+
}
|
|
27
|
+
} },
|
|
20
28
|
"react": { "~orpc": {
|
|
21
29
|
"errorMap": {},
|
|
22
30
|
"meta": {},
|
package/dist/db/src/enums.js
CHANGED
|
@@ -349,7 +349,8 @@ const ACTION_FIELD_TYPES = [
|
|
|
349
349
|
"json",
|
|
350
350
|
"custom_field",
|
|
351
351
|
"lead_stage",
|
|
352
|
-
"recipients"
|
|
352
|
+
"recipients",
|
|
353
|
+
"plugin_record"
|
|
353
354
|
];
|
|
354
355
|
const PAYMENT_GATEWAY_KINDS = ["qpay", "test"];
|
|
355
356
|
const PAYMENT_GATEWAY_STATUSES = ["active", "disabled"];
|
package/dist/events.js
CHANGED
|
@@ -3,7 +3,7 @@ import { events } from "./db/src/schema/events.js";
|
|
|
3
3
|
import "./db/src/schema/index.js";
|
|
4
4
|
import { COMMON_ERRORS, ERRORS } from "./errors.js";
|
|
5
5
|
import { CursorQuery, Id, cursorPageOf, isoDate } from "./common.js";
|
|
6
|
-
import { ActivityTarget } from "./
|
|
6
|
+
import { ActivityTarget } from "./timelines.js";
|
|
7
7
|
import { AppLink, DedupeKey, EntityType, EventType } from "./platform.js";
|
|
8
8
|
import { oc } from "@orpc/contract";
|
|
9
9
|
import { z } from "zod";
|