stentor-models 1.59.51 → 1.59.54
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/lib/Crm.d.ts +5 -0
- package/lib/Services/CrmService.d.ts +12 -2
- package/lib/Services/CrmService.js +9 -0
- package/lib/Services/CrmService.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/Crm.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ export interface ExternalLead {
|
|
|
34
34
|
* Optional reference ID in the 3rd party CRM or FSM
|
|
35
35
|
*/
|
|
36
36
|
refId?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Optional job type ID in the 3rd party CRM
|
|
39
|
+
* (this maybe looked up already as a side effect of the avalability request)
|
|
40
|
+
*/
|
|
41
|
+
jobTypeId?: string;
|
|
37
42
|
/**
|
|
38
43
|
* Is it abandoned (unfinished)?
|
|
39
44
|
*/
|
|
@@ -18,6 +18,10 @@ export interface CrmServiceAvailabilitySettings {
|
|
|
18
18
|
* Maximum total number of appointments a day that can be scheduled through the scheduler.
|
|
19
19
|
*/
|
|
20
20
|
maxTotalDailyAppointments?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Job types, where we only schedule a few days (3) ahead
|
|
23
|
+
*/
|
|
24
|
+
delayedJobTypes?: string[];
|
|
21
25
|
}
|
|
22
26
|
export interface CrmServiceTimeAvailability {
|
|
23
27
|
/**
|
|
@@ -31,8 +35,6 @@ export interface CrmServiceTimeAvailability {
|
|
|
31
35
|
}
|
|
32
36
|
export interface CrmServiceDateAvailability {
|
|
33
37
|
/**
|
|
34
|
-
* The number of appointments available for the given range.
|
|
35
|
-
*
|
|
36
38
|
* Typically, just the date is used, tz and time are not needed.
|
|
37
39
|
*/
|
|
38
40
|
date: DateTime;
|
|
@@ -103,14 +105,22 @@ export interface CrmService {
|
|
|
103
105
|
* @param options
|
|
104
106
|
*/
|
|
105
107
|
getAvailability(range: DateTimeRange, options?: CrmServiceAvailabilityOptions): Promise<CrmServiceAvailability>;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the job type (id) for the free text job description (AI call usually)
|
|
110
|
+
*
|
|
111
|
+
* @param message
|
|
112
|
+
*/
|
|
113
|
+
getJobType(message: string): Promise<string>;
|
|
106
114
|
}
|
|
107
115
|
export type CrmServiceProps = CrmServiceAvailabilitySettings;
|
|
108
116
|
export declare class AbstractCrmService implements CrmService {
|
|
109
117
|
protected availableDays?: DayOfWeek[];
|
|
110
118
|
protected blockedDays?: DateTime[];
|
|
111
119
|
protected maxTotalDailyAppointments?: number | undefined;
|
|
120
|
+
protected delayedJobTypes?: string[];
|
|
112
121
|
constructor(props: CrmServiceProps);
|
|
113
122
|
send(externalLead: ExternalLead, extras?: Record<string, unknown>): Promise<CrmResponse>;
|
|
114
123
|
getAvailability(range: DateTimeRange, options?: CrmServiceAvailabilityOptions): Promise<CrmServiceAvailability>;
|
|
124
|
+
getJobType(message: string): Promise<string>;
|
|
115
125
|
update?(externalLead: ExternalLead, extras?: Record<string, unknown>): Promise<CrmResponse>;
|
|
116
126
|
}
|
|
@@ -22,6 +22,9 @@ class AbstractCrmService {
|
|
|
22
22
|
if (typeof props.maxTotalDailyAppointments === "number") {
|
|
23
23
|
this.maxTotalDailyAppointments = props.maxTotalDailyAppointments;
|
|
24
24
|
}
|
|
25
|
+
if (typeof props.delayedJobTypes) {
|
|
26
|
+
this.delayedJobTypes = props.delayedJobTypes;
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
29
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
30
|
send(externalLead, extras) {
|
|
@@ -36,6 +39,12 @@ class AbstractCrmService {
|
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42
|
+
getJobType(message) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
throw new Error("Method not implemented.");
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
48
|
update(externalLead, extras) {
|
|
40
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
50
|
throw new Error("Method not implemented.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrmService.js","sourceRoot":"","sources":["../../src/Services/CrmService.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CrmService.js","sourceRoot":"","sources":["../../src/Services/CrmService.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;AA6HpC,MAAa,kBAAkB;IAU3B,YAAmB,KAAsB;QAErC,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACtB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QAC7C,CAAC;QAED,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACzC,CAAC;QAED,IAAI,OAAO,KAAK,CAAC,yBAAyB,KAAK,QAAQ,EAAE,CAAC;YACtD,IAAI,CAAC,yBAAyB,GAAG,KAAK,CAAC,yBAAyB,CAAC;QACrE,CAAC;QAED,IAAI,OAAO,KAAK,CAAC,eAAe,EAAE,CAAC;YAC/B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QACjD,CAAC;IACL,CAAC;IAED,6DAA6D;IAChD,IAAI,CAAC,YAA0B,EAAE,MAAgC;;YAC1E,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;KAAA;IAED,6DAA6D;IAChD,eAAe,CAAC,KAAoB,EAAE,OAAuC;;YACtF,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;KAAA;IAED,6DAA6D;IAChD,UAAU,CAAC,OAAe;;YACnC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;KAAA;IAED,6DAA6D;IAChD,MAAM,CAAE,YAA0B,EAAE,MAAgC;;YAC7E,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;KAAA;CACJ;AAhDD,gDAgDC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type * from "./Request";
|
|
|
32
32
|
export type * from "./RequestHandler";
|
|
33
33
|
export * from "./Response";
|
|
34
34
|
export type * from "./Runtime";
|
|
35
|
-
export
|
|
35
|
+
export * from "./Services";
|
|
36
36
|
export type * from "./Slot";
|
|
37
37
|
export type * from "./SMS";
|
|
38
38
|
export type * from "./Storage";
|
package/lib/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./App"), exports);
|
|
18
18
|
__exportStar(require("./Context"), exports);
|
|
19
19
|
__exportStar(require("./Response"), exports);
|
|
20
|
+
__exportStar(require("./Services"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,wCAAsB;AAGtB,4CAA0B;AA2B1B,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,wCAAsB;AAGtB,4CAA0B;AA2B1B,6CAA2B;AAE3B,6CAA2B"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.59.
|
|
7
|
+
"version": "1.59.54",
|
|
8
8
|
"description": "Models for 📣 stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"typings": "lib/index",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@xapp/patterns": "2.0.2"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "f4363fb4330c7bf5c2ca90a9baa0deb6462f1076"
|
|
37
37
|
}
|