@voyantjs/crm 0.28.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes/accounts.d.ts +2 -2
- package/dist/routes/activities.d.ts +4 -4
- package/dist/routes/custom-fields.d.ts +4 -4
- package/dist/routes/index.d.ts +20 -20
- package/dist/routes/person-relationships.d.ts +8 -8
- package/dist/routes/pipelines.d.ts +2 -2
- package/dist/schema-accounts.d.ts +2 -2
- package/dist/schema-activities.d.ts +2 -2
- package/dist/service/accounts-organizations.d.ts +1 -1
- package/dist/service/accounts-organizations.d.ts.map +1 -1
- package/dist/service/accounts-organizations.js +19 -2
- package/dist/service/accounts-people.d.ts +1 -1
- package/dist/service/accounts-people.d.ts.map +1 -1
- package/dist/service/accounts-people.js +18 -2
- package/dist/service/accounts.d.ts +2 -2
- package/dist/service/activities.d.ts +4 -4
- package/dist/service/custom-fields.d.ts +4 -4
- package/dist/service/index.d.ts +29 -29
- package/dist/service/person-relationships.d.ts +12 -12
- package/dist/service/pipelines.d.ts +2 -2
- package/dist/validation.d.ts +97 -51
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +30 -6
- package/package.json +6 -6
|
@@ -47,8 +47,8 @@ export declare const accountRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
47
47
|
data: {
|
|
48
48
|
source: string | null;
|
|
49
49
|
relation: "partner" | "supplier" | "other" | "client" | null;
|
|
50
|
-
id: string;
|
|
51
50
|
name: string;
|
|
51
|
+
id: string;
|
|
52
52
|
createdAt: string;
|
|
53
53
|
updatedAt: string;
|
|
54
54
|
status: "active" | "inactive" | "archived";
|
|
@@ -1138,8 +1138,8 @@ export declare const accountRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1138
1138
|
input: {};
|
|
1139
1139
|
output: {
|
|
1140
1140
|
data: {
|
|
1141
|
-
id: string;
|
|
1142
1141
|
name: string;
|
|
1142
|
+
id: string;
|
|
1143
1143
|
createdAt: string;
|
|
1144
1144
|
updatedAt: string;
|
|
1145
1145
|
description: string | null;
|
|
@@ -15,7 +15,7 @@ export declare const activityRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
15
15
|
subject: string;
|
|
16
16
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
17
17
|
ownerId: string | null;
|
|
18
|
-
status: "done" | "
|
|
18
|
+
status: "done" | "cancelled" | "planned";
|
|
19
19
|
dueAt: string | null;
|
|
20
20
|
completedAt: string | null;
|
|
21
21
|
location: string | null;
|
|
@@ -40,7 +40,7 @@ export declare const activityRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
40
40
|
id: string;
|
|
41
41
|
createdAt: string;
|
|
42
42
|
updatedAt: string;
|
|
43
|
-
status: "done" | "
|
|
43
|
+
status: "done" | "cancelled" | "planned";
|
|
44
44
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
45
45
|
description: string | null;
|
|
46
46
|
ownerId: string | null;
|
|
@@ -79,7 +79,7 @@ export declare const activityRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
79
79
|
subject: string;
|
|
80
80
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
81
81
|
ownerId: string | null;
|
|
82
|
-
status: "done" | "
|
|
82
|
+
status: "done" | "cancelled" | "planned";
|
|
83
83
|
dueAt: string | null;
|
|
84
84
|
completedAt: string | null;
|
|
85
85
|
location: string | null;
|
|
@@ -117,7 +117,7 @@ export declare const activityRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
117
117
|
subject: string;
|
|
118
118
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
119
119
|
ownerId: string | null;
|
|
120
|
-
status: "done" | "
|
|
120
|
+
status: "done" | "cancelled" | "planned";
|
|
121
121
|
dueAt: string | null;
|
|
122
122
|
completedAt: string | null;
|
|
123
123
|
location: string | null;
|
|
@@ -15,7 +15,7 @@ export declare const customFieldRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
15
15
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
16
16
|
key: string;
|
|
17
17
|
label: string;
|
|
18
|
-
fieldType: "boolean" | "json" | "
|
|
18
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
19
19
|
isRequired: boolean;
|
|
20
20
|
isSearchable: boolean;
|
|
21
21
|
options: {
|
|
@@ -49,7 +49,7 @@ export declare const customFieldRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
49
49
|
}[] | null;
|
|
50
50
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
51
51
|
label: string;
|
|
52
|
-
fieldType: "boolean" | "json" | "
|
|
52
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
53
53
|
isRequired: boolean;
|
|
54
54
|
isSearchable: boolean;
|
|
55
55
|
} | undefined;
|
|
@@ -83,7 +83,7 @@ export declare const customFieldRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
83
83
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
84
84
|
key: string;
|
|
85
85
|
label: string;
|
|
86
|
-
fieldType: "boolean" | "json" | "
|
|
86
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
87
87
|
isRequired: boolean;
|
|
88
88
|
isSearchable: boolean;
|
|
89
89
|
options: {
|
|
@@ -123,7 +123,7 @@ export declare const customFieldRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
123
123
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
124
124
|
key: string;
|
|
125
125
|
label: string;
|
|
126
|
-
fieldType: "boolean" | "json" | "
|
|
126
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
127
127
|
isRequired: boolean;
|
|
128
128
|
isSearchable: boolean;
|
|
129
129
|
options: {
|
package/dist/routes/index.d.ts
CHANGED
|
@@ -47,8 +47,8 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
47
47
|
data: {
|
|
48
48
|
source: string | null;
|
|
49
49
|
relation: "partner" | "supplier" | "other" | "client" | null;
|
|
50
|
-
id: string;
|
|
51
50
|
name: string;
|
|
51
|
+
id: string;
|
|
52
52
|
createdAt: string;
|
|
53
53
|
updatedAt: string;
|
|
54
54
|
status: "active" | "inactive" | "archived";
|
|
@@ -1138,8 +1138,8 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
1138
1138
|
input: {};
|
|
1139
1139
|
output: {
|
|
1140
1140
|
data: {
|
|
1141
|
-
id: string;
|
|
1142
1141
|
name: string;
|
|
1142
|
+
id: string;
|
|
1143
1143
|
createdAt: string;
|
|
1144
1144
|
updatedAt: string;
|
|
1145
1145
|
description: string | null;
|
|
@@ -1809,8 +1809,8 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
1809
1809
|
id: string;
|
|
1810
1810
|
fromPersonId: string;
|
|
1811
1811
|
toPersonId: string;
|
|
1812
|
-
kind: "partner" | "
|
|
1813
|
-
inverseKind: "partner" | "
|
|
1812
|
+
kind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
1813
|
+
inverseKind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
|
|
1814
1814
|
startDate: string | null;
|
|
1815
1815
|
endDate: string | null;
|
|
1816
1816
|
isPrimary: boolean;
|
|
@@ -1856,11 +1856,11 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
1856
1856
|
startDate: string | null;
|
|
1857
1857
|
endDate: string | null;
|
|
1858
1858
|
notes: string | null;
|
|
1859
|
-
kind: "partner" | "
|
|
1859
|
+
kind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
1860
1860
|
isPrimary: boolean;
|
|
1861
1861
|
fromPersonId: string;
|
|
1862
1862
|
toPersonId: string;
|
|
1863
|
-
inverseKind: "partner" | "
|
|
1863
|
+
inverseKind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
|
|
1864
1864
|
};
|
|
1865
1865
|
};
|
|
1866
1866
|
outputFormat: "json";
|
|
@@ -1891,8 +1891,8 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
1891
1891
|
id: string;
|
|
1892
1892
|
fromPersonId: string;
|
|
1893
1893
|
toPersonId: string;
|
|
1894
|
-
kind: "partner" | "
|
|
1895
|
-
inverseKind: "partner" | "
|
|
1894
|
+
kind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
1895
|
+
inverseKind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
|
|
1896
1896
|
startDate: string | null;
|
|
1897
1897
|
endDate: string | null;
|
|
1898
1898
|
isPrimary: boolean;
|
|
@@ -1932,8 +1932,8 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
1932
1932
|
id: string;
|
|
1933
1933
|
fromPersonId: string;
|
|
1934
1934
|
toPersonId: string;
|
|
1935
|
-
kind: "partner" | "
|
|
1936
|
-
inverseKind: "partner" | "
|
|
1935
|
+
kind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
1936
|
+
inverseKind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
|
|
1937
1937
|
startDate: string | null;
|
|
1938
1938
|
endDate: string | null;
|
|
1939
1939
|
isPrimary: boolean;
|
|
@@ -2274,8 +2274,8 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
2274
2274
|
input: {};
|
|
2275
2275
|
output: {
|
|
2276
2276
|
data: {
|
|
2277
|
-
id: string;
|
|
2278
2277
|
name: string;
|
|
2278
|
+
id: string;
|
|
2279
2279
|
createdAt: string;
|
|
2280
2280
|
updatedAt: string;
|
|
2281
2281
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
@@ -2412,8 +2412,8 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
2412
2412
|
input: {};
|
|
2413
2413
|
output: {
|
|
2414
2414
|
data: {
|
|
2415
|
-
id: string;
|
|
2416
2415
|
name: string;
|
|
2416
|
+
id: string;
|
|
2417
2417
|
createdAt: string;
|
|
2418
2418
|
updatedAt: string;
|
|
2419
2419
|
sortOrder: number;
|
|
@@ -3188,7 +3188,7 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
3188
3188
|
subject: string;
|
|
3189
3189
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
3190
3190
|
ownerId: string | null;
|
|
3191
|
-
status: "done" | "
|
|
3191
|
+
status: "done" | "cancelled" | "planned";
|
|
3192
3192
|
dueAt: string | null;
|
|
3193
3193
|
completedAt: string | null;
|
|
3194
3194
|
location: string | null;
|
|
@@ -3213,7 +3213,7 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
3213
3213
|
id: string;
|
|
3214
3214
|
createdAt: string;
|
|
3215
3215
|
updatedAt: string;
|
|
3216
|
-
status: "done" | "
|
|
3216
|
+
status: "done" | "cancelled" | "planned";
|
|
3217
3217
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
3218
3218
|
description: string | null;
|
|
3219
3219
|
ownerId: string | null;
|
|
@@ -3252,7 +3252,7 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
3252
3252
|
subject: string;
|
|
3253
3253
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
3254
3254
|
ownerId: string | null;
|
|
3255
|
-
status: "done" | "
|
|
3255
|
+
status: "done" | "cancelled" | "planned";
|
|
3256
3256
|
dueAt: string | null;
|
|
3257
3257
|
completedAt: string | null;
|
|
3258
3258
|
location: string | null;
|
|
@@ -3290,7 +3290,7 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
3290
3290
|
subject: string;
|
|
3291
3291
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
3292
3292
|
ownerId: string | null;
|
|
3293
|
-
status: "done" | "
|
|
3293
|
+
status: "done" | "cancelled" | "planned";
|
|
3294
3294
|
dueAt: string | null;
|
|
3295
3295
|
completedAt: string | null;
|
|
3296
3296
|
location: string | null;
|
|
@@ -3477,7 +3477,7 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
3477
3477
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
3478
3478
|
key: string;
|
|
3479
3479
|
label: string;
|
|
3480
|
-
fieldType: "boolean" | "json" | "
|
|
3480
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
3481
3481
|
isRequired: boolean;
|
|
3482
3482
|
isSearchable: boolean;
|
|
3483
3483
|
options: {
|
|
@@ -3511,7 +3511,7 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
3511
3511
|
}[] | null;
|
|
3512
3512
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
3513
3513
|
label: string;
|
|
3514
|
-
fieldType: "boolean" | "json" | "
|
|
3514
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
3515
3515
|
isRequired: boolean;
|
|
3516
3516
|
isSearchable: boolean;
|
|
3517
3517
|
} | undefined;
|
|
@@ -3545,7 +3545,7 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
3545
3545
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
3546
3546
|
key: string;
|
|
3547
3547
|
label: string;
|
|
3548
|
-
fieldType: "boolean" | "json" | "
|
|
3548
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
3549
3549
|
isRequired: boolean;
|
|
3550
3550
|
isSearchable: boolean;
|
|
3551
3551
|
options: {
|
|
@@ -3585,7 +3585,7 @@ export declare const crmRoutes: import("hono/hono-base").HonoBase<Env, import("h
|
|
|
3585
3585
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
3586
3586
|
key: string;
|
|
3587
3587
|
label: string;
|
|
3588
|
-
fieldType: "boolean" | "json" | "
|
|
3588
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
3589
3589
|
isRequired: boolean;
|
|
3590
3590
|
isSearchable: boolean;
|
|
3591
3591
|
options: {
|
|
@@ -18,8 +18,8 @@ export declare const personRelationshipRoutes: import("hono/hono-base").HonoBase
|
|
|
18
18
|
id: string;
|
|
19
19
|
fromPersonId: string;
|
|
20
20
|
toPersonId: string;
|
|
21
|
-
kind: "partner" | "
|
|
22
|
-
inverseKind: "partner" | "
|
|
21
|
+
kind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
22
|
+
inverseKind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
|
|
23
23
|
startDate: string | null;
|
|
24
24
|
endDate: string | null;
|
|
25
25
|
isPrimary: boolean;
|
|
@@ -65,11 +65,11 @@ export declare const personRelationshipRoutes: import("hono/hono-base").HonoBase
|
|
|
65
65
|
startDate: string | null;
|
|
66
66
|
endDate: string | null;
|
|
67
67
|
notes: string | null;
|
|
68
|
-
kind: "partner" | "
|
|
68
|
+
kind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
69
69
|
isPrimary: boolean;
|
|
70
70
|
fromPersonId: string;
|
|
71
71
|
toPersonId: string;
|
|
72
|
-
inverseKind: "partner" | "
|
|
72
|
+
inverseKind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
outputFormat: "json";
|
|
@@ -100,8 +100,8 @@ export declare const personRelationshipRoutes: import("hono/hono-base").HonoBase
|
|
|
100
100
|
id: string;
|
|
101
101
|
fromPersonId: string;
|
|
102
102
|
toPersonId: string;
|
|
103
|
-
kind: "partner" | "
|
|
104
|
-
inverseKind: "partner" | "
|
|
103
|
+
kind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
104
|
+
inverseKind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
|
|
105
105
|
startDate: string | null;
|
|
106
106
|
endDate: string | null;
|
|
107
107
|
isPrimary: boolean;
|
|
@@ -141,8 +141,8 @@ export declare const personRelationshipRoutes: import("hono/hono-base").HonoBase
|
|
|
141
141
|
id: string;
|
|
142
142
|
fromPersonId: string;
|
|
143
143
|
toPersonId: string;
|
|
144
|
-
kind: "partner" | "
|
|
145
|
-
inverseKind: "partner" | "
|
|
144
|
+
kind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
145
|
+
inverseKind: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion" | null;
|
|
146
146
|
startDate: string | null;
|
|
147
147
|
endDate: string | null;
|
|
148
148
|
isPrimary: boolean;
|
|
@@ -33,8 +33,8 @@ export declare const pipelineRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
33
33
|
input: {};
|
|
34
34
|
output: {
|
|
35
35
|
data: {
|
|
36
|
-
id: string;
|
|
37
36
|
name: string;
|
|
37
|
+
id: string;
|
|
38
38
|
createdAt: string;
|
|
39
39
|
updatedAt: string;
|
|
40
40
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
@@ -171,8 +171,8 @@ export declare const pipelineRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
171
171
|
input: {};
|
|
172
172
|
output: {
|
|
173
173
|
data: {
|
|
174
|
-
id: string;
|
|
175
174
|
name: string;
|
|
175
|
+
id: string;
|
|
176
176
|
createdAt: string;
|
|
177
177
|
updatedAt: string;
|
|
178
178
|
sortOrder: number;
|
|
@@ -1305,7 +1305,7 @@ export declare const personRelationships: import("drizzle-orm/pg-core").PgTableW
|
|
|
1305
1305
|
tableName: "person_relationships";
|
|
1306
1306
|
dataType: "string";
|
|
1307
1307
|
columnType: "PgEnumColumn";
|
|
1308
|
-
data: "partner" | "
|
|
1308
|
+
data: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
1309
1309
|
driverParam: string;
|
|
1310
1310
|
notNull: true;
|
|
1311
1311
|
hasDefault: false;
|
|
@@ -1322,7 +1322,7 @@ export declare const personRelationships: import("drizzle-orm/pg-core").PgTableW
|
|
|
1322
1322
|
tableName: "person_relationships";
|
|
1323
1323
|
dataType: "string";
|
|
1324
1324
|
columnType: "PgEnumColumn";
|
|
1325
|
-
data: "partner" | "
|
|
1325
|
+
data: "partner" | "parent" | "child" | "other" | "spouse" | "sibling" | "guardian" | "ward" | "emergency_contact" | "friend" | "travel_companion";
|
|
1326
1326
|
driverParam: string;
|
|
1327
1327
|
notNull: false;
|
|
1328
1328
|
hasDefault: false;
|
|
@@ -75,7 +75,7 @@ export declare const activities: import("drizzle-orm/pg-core").PgTableWithColumn
|
|
|
75
75
|
tableName: "activities";
|
|
76
76
|
dataType: "string";
|
|
77
77
|
columnType: "PgEnumColumn";
|
|
78
|
-
data: "done" | "
|
|
78
|
+
data: "done" | "cancelled" | "planned";
|
|
79
79
|
driverParam: string;
|
|
80
80
|
notNull: true;
|
|
81
81
|
hasDefault: true;
|
|
@@ -470,7 +470,7 @@ export declare const customFieldDefinitions: import("drizzle-orm/pg-core").PgTab
|
|
|
470
470
|
tableName: "custom_field_definitions";
|
|
471
471
|
dataType: "string";
|
|
472
472
|
columnType: "PgEnumColumn";
|
|
473
|
-
data: "boolean" | "json" | "
|
|
473
|
+
data: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
474
474
|
driverParam: string;
|
|
475
475
|
notNull: true;
|
|
476
476
|
hasDefault: false;
|
|
@@ -51,8 +51,8 @@ export declare const organizationAccountsService: {
|
|
|
51
51
|
createOrganization(db: PostgresJsDatabase, data: CreateOrganizationInput): Promise<{
|
|
52
52
|
source: string | null;
|
|
53
53
|
relation: "partner" | "supplier" | "other" | "client" | null;
|
|
54
|
-
id: string;
|
|
55
54
|
name: string;
|
|
55
|
+
id: string;
|
|
56
56
|
createdAt: Date;
|
|
57
57
|
updatedAt: Date;
|
|
58
58
|
status: "active" | "inactive" | "archived";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts-organizations.d.ts","sourceRoot":"","sources":["../../src/service/accounts-organizations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAG7B,eAAO,MAAM,2BAA2B;0BACV,kBAAkB,SAAS,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"accounts-organizations.d.ts","sourceRoot":"","sources":["../../src/service/accounts-organizations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAG7B,eAAO,MAAM,2BAA2B;0BACV,kBAAkB,SAAS,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;4BAmD9C,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;2BAK/B,kBAAkB,QAAQ,uBAAuB;;;;;;;;;;;;;;;;;;;;;2BAKjD,kBAAkB,MAAM,MAAM,QAAQ,uBAAuB;;;;;;;;;;;;;;;;;;;;;2BAS7D,kBAAkB,MAAM,MAAM;;;CAO5D,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { and, desc, eq, ilike, or, sql } from "drizzle-orm";
|
|
1
|
+
import { and, asc, desc, eq, ilike, or, sql } from "drizzle-orm";
|
|
2
2
|
import { organizations } from "../schema.js";
|
|
3
3
|
import { paginate } from "./helpers.js";
|
|
4
4
|
export const organizationAccountsService = {
|
|
@@ -15,13 +15,30 @@ export const organizationAccountsService = {
|
|
|
15
15
|
conditions.push(or(ilike(organizations.name, term), ilike(organizations.legalName, term), ilike(organizations.website, term)));
|
|
16
16
|
}
|
|
17
17
|
const where = conditions.length ? and(...conditions) : undefined;
|
|
18
|
+
const sortColumn = (() => {
|
|
19
|
+
switch (query.sortBy) {
|
|
20
|
+
case "name":
|
|
21
|
+
return organizations.name;
|
|
22
|
+
case "industry":
|
|
23
|
+
return organizations.industry;
|
|
24
|
+
case "relation":
|
|
25
|
+
return organizations.relation;
|
|
26
|
+
case "status":
|
|
27
|
+
return organizations.status;
|
|
28
|
+
case "createdAt":
|
|
29
|
+
return organizations.createdAt;
|
|
30
|
+
default:
|
|
31
|
+
return organizations.updatedAt;
|
|
32
|
+
}
|
|
33
|
+
})();
|
|
34
|
+
const sortFn = query.sortDir === "asc" ? asc : desc;
|
|
18
35
|
return paginate(db
|
|
19
36
|
.select()
|
|
20
37
|
.from(organizations)
|
|
21
38
|
.where(where)
|
|
22
39
|
.limit(query.limit)
|
|
23
40
|
.offset(query.offset)
|
|
24
|
-
.orderBy(desc(organizations.updatedAt)), db.select({ count: sql `count(*)::int` }).from(organizations).where(where), query.limit, query.offset);
|
|
41
|
+
.orderBy(sortFn(sortColumn), desc(organizations.updatedAt)), db.select({ count: sql `count(*)::int` }).from(organizations).where(where), query.limit, query.offset);
|
|
25
42
|
},
|
|
26
43
|
async getOrganizationById(db, id) {
|
|
27
44
|
const [row] = await db.select().from(organizations).where(eq(organizations.id, id)).limit(1);
|
|
@@ -1288,8 +1288,8 @@ export declare const peopleAccountsService: {
|
|
|
1288
1288
|
}, {}, {}>;
|
|
1289
1289
|
}>, "orderBy">;
|
|
1290
1290
|
createSegment(db: PostgresJsDatabase, data: CreateSegmentInput): Promise<{
|
|
1291
|
-
id: string;
|
|
1292
1291
|
name: string;
|
|
1292
|
+
id: string;
|
|
1293
1293
|
createdAt: Date;
|
|
1294
1294
|
updatedAt: Date;
|
|
1295
1295
|
description: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts-people.d.ts","sourceRoot":"","sources":["../../src/service/accounts-people.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAWjE,OAAO,KAAK,EACV,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EAC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2
|
+
import { and, asc, desc, eq, gte, ilike, lte, or, sql } from "drizzle-orm";
|
|
3
3
|
import { communicationLog, organizationNotes, organizations, people, personNotes, personPaymentMethods, segments, } from "../schema.js";
|
|
4
4
|
import { deletePersonIdentity, hydratePeople, organizationEntityType, personBaseFields, personEntityType, syncPersonIdentity, } from "./accounts-shared.js";
|
|
5
5
|
import { paginate } from "./helpers.js";
|
|
@@ -19,13 +19,29 @@ export const peopleAccountsService = {
|
|
|
19
19
|
conditions.push(or(ilike(people.firstName, term), ilike(people.lastName, term), ilike(people.jobTitle, term)));
|
|
20
20
|
}
|
|
21
21
|
const where = conditions.length ? and(...conditions) : undefined;
|
|
22
|
+
const sortColumns = (() => {
|
|
23
|
+
switch (query.sortBy) {
|
|
24
|
+
case "name":
|
|
25
|
+
return [people.firstName, people.lastName];
|
|
26
|
+
case "relation":
|
|
27
|
+
return [people.relation];
|
|
28
|
+
case "status":
|
|
29
|
+
return [people.status];
|
|
30
|
+
case "createdAt":
|
|
31
|
+
return [people.createdAt];
|
|
32
|
+
default:
|
|
33
|
+
return [people.updatedAt];
|
|
34
|
+
}
|
|
35
|
+
})();
|
|
36
|
+
const sortFn = query.sortDir === "asc" ? asc : desc;
|
|
37
|
+
const orderBy = [...sortColumns.map((col) => sortFn(col)), desc(people.updatedAt)];
|
|
22
38
|
const result = await paginate(db
|
|
23
39
|
.select()
|
|
24
40
|
.from(people)
|
|
25
41
|
.where(where)
|
|
26
42
|
.limit(query.limit)
|
|
27
43
|
.offset(query.offset)
|
|
28
|
-
.orderBy(
|
|
44
|
+
.orderBy(...orderBy), db.select({ count: sql `count(*)::int` }).from(people).where(where), query.limit, query.offset);
|
|
29
45
|
return {
|
|
30
46
|
...result,
|
|
31
47
|
data: await hydratePeople(db, result.data),
|
|
@@ -1285,8 +1285,8 @@ export declare const accountsService: {
|
|
|
1285
1285
|
}, {}, {}>;
|
|
1286
1286
|
}>, "orderBy">;
|
|
1287
1287
|
createSegment(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./accounts-shared.js").CreateSegmentInput): Promise<{
|
|
1288
|
-
id: string;
|
|
1289
1288
|
name: string;
|
|
1289
|
+
id: string;
|
|
1290
1290
|
createdAt: Date;
|
|
1291
1291
|
updatedAt: Date;
|
|
1292
1292
|
description: string | null;
|
|
@@ -1358,8 +1358,8 @@ export declare const accountsService: {
|
|
|
1358
1358
|
createOrganization(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./accounts-shared.js").CreateOrganizationInput): Promise<{
|
|
1359
1359
|
source: string | null;
|
|
1360
1360
|
relation: "partner" | "supplier" | "other" | "client" | null;
|
|
1361
|
-
id: string;
|
|
1362
1361
|
name: string;
|
|
1362
|
+
id: string;
|
|
1363
1363
|
createdAt: Date;
|
|
1364
1364
|
updatedAt: Date;
|
|
1365
1365
|
status: "active" | "inactive" | "archived";
|
|
@@ -13,7 +13,7 @@ export declare const activitiesService: {
|
|
|
13
13
|
subject: string;
|
|
14
14
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
15
15
|
ownerId: string | null;
|
|
16
|
-
status: "done" | "
|
|
16
|
+
status: "done" | "cancelled" | "planned";
|
|
17
17
|
dueAt: Date | null;
|
|
18
18
|
completedAt: Date | null;
|
|
19
19
|
location: string | null;
|
|
@@ -30,7 +30,7 @@ export declare const activitiesService: {
|
|
|
30
30
|
subject: string;
|
|
31
31
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
32
32
|
ownerId: string | null;
|
|
33
|
-
status: "done" | "
|
|
33
|
+
status: "done" | "cancelled" | "planned";
|
|
34
34
|
dueAt: Date | null;
|
|
35
35
|
completedAt: Date | null;
|
|
36
36
|
location: string | null;
|
|
@@ -42,7 +42,7 @@ export declare const activitiesService: {
|
|
|
42
42
|
id: string;
|
|
43
43
|
createdAt: Date;
|
|
44
44
|
updatedAt: Date;
|
|
45
|
-
status: "done" | "
|
|
45
|
+
status: "done" | "cancelled" | "planned";
|
|
46
46
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
47
47
|
description: string | null;
|
|
48
48
|
ownerId: string | null;
|
|
@@ -56,7 +56,7 @@ export declare const activitiesService: {
|
|
|
56
56
|
subject: string;
|
|
57
57
|
type: "email" | "meeting" | "call" | "task" | "follow_up" | "note";
|
|
58
58
|
ownerId: string | null;
|
|
59
|
-
status: "done" | "
|
|
59
|
+
status: "done" | "cancelled" | "planned";
|
|
60
60
|
dueAt: Date | null;
|
|
61
61
|
completedAt: Date | null;
|
|
62
62
|
location: string | null;
|
|
@@ -13,7 +13,7 @@ export declare const customFieldsService: {
|
|
|
13
13
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
14
14
|
key: string;
|
|
15
15
|
label: string;
|
|
16
|
-
fieldType: "boolean" | "json" | "
|
|
16
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
17
17
|
isRequired: boolean;
|
|
18
18
|
isSearchable: boolean;
|
|
19
19
|
options: {
|
|
@@ -32,7 +32,7 @@ export declare const customFieldsService: {
|
|
|
32
32
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
33
33
|
key: string;
|
|
34
34
|
label: string;
|
|
35
|
-
fieldType: "boolean" | "json" | "
|
|
35
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
36
36
|
isRequired: boolean;
|
|
37
37
|
isSearchable: boolean;
|
|
38
38
|
options: {
|
|
@@ -53,7 +53,7 @@ export declare const customFieldsService: {
|
|
|
53
53
|
}[] | null;
|
|
54
54
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
55
55
|
label: string;
|
|
56
|
-
fieldType: "boolean" | "json" | "
|
|
56
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
57
57
|
isRequired: boolean;
|
|
58
58
|
isSearchable: boolean;
|
|
59
59
|
} | undefined>;
|
|
@@ -62,7 +62,7 @@ export declare const customFieldsService: {
|
|
|
62
62
|
entityType: "organization" | "person" | "opportunity" | "quote" | "activity";
|
|
63
63
|
key: string;
|
|
64
64
|
label: string;
|
|
65
|
-
fieldType: "boolean" | "json" | "
|
|
65
|
+
fieldType: "boolean" | "json" | "text" | "date" | "set" | "enum" | "phone" | "varchar" | "double" | "monetary" | "address";
|
|
66
66
|
isRequired: boolean;
|
|
67
67
|
isSearchable: boolean;
|
|
68
68
|
options: {
|