stentor-models 1.50.23 → 1.51.4
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/Context.d.ts +13 -1
- package/lib/Context.js.map +1 -1
- package/lib/Crm.d.ts +31 -0
- package/lib/Crm.js +4 -0
- package/lib/Crm.js.map +1 -0
- package/lib/Services/CrmService.d.ts +9 -0
- package/lib/Services/CrmService.js +4 -0
- package/lib/Services/CrmService.js.map +1 -0
- package/lib/Services/index.d.ts +1 -0
- package/lib/Services/index.js +1 -0
- package/lib/Services/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
package/lib/Context.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { AbstractResponseBuilder } from "./Response";
|
|
|
5
5
|
import { SessionStore, Storage } from "./Storage";
|
|
6
6
|
import { UserDataType } from "./UserData";
|
|
7
7
|
import { UserProfile } from "./UserProfile";
|
|
8
|
+
import { CrmService, SMSService } from "./Services";
|
|
8
9
|
export declare enum UserDataRequestStatus {
|
|
9
10
|
DEFERRED = 0,
|
|
10
11
|
AVAILABLE = 1,
|
|
@@ -16,6 +17,13 @@ export interface UserDataValue {
|
|
|
16
17
|
requestStatus: UserDataRequestStatus;
|
|
17
18
|
}
|
|
18
19
|
export declare type UserData = (userDataType: UserDataType) => Promise<UserDataRequestStatus>;
|
|
20
|
+
/**
|
|
21
|
+
* These we want to make available for custom handlers
|
|
22
|
+
*/
|
|
23
|
+
export interface ContextServices {
|
|
24
|
+
crmService?: CrmService;
|
|
25
|
+
smsService?: SMSService;
|
|
26
|
+
}
|
|
19
27
|
/**
|
|
20
28
|
* Context object that is passed around while formulating the response.
|
|
21
29
|
*
|
|
@@ -41,7 +49,7 @@ export interface Context<S extends Storage = Storage> {
|
|
|
41
49
|
*/
|
|
42
50
|
response: AbstractResponseBuilder;
|
|
43
51
|
/**
|
|
44
|
-
* A method that
|
|
52
|
+
* A method that serves user profile data (email, location, phone number, etc)
|
|
45
53
|
*/
|
|
46
54
|
requestUserData?: UserData;
|
|
47
55
|
/**
|
|
@@ -52,4 +60,8 @@ export interface Context<S extends Storage = Storage> {
|
|
|
52
60
|
* Milliseconds left from the execution (NOTE: infinity if not executing in a lambda)
|
|
53
61
|
*/
|
|
54
62
|
timeLeftInMillis?(): number;
|
|
63
|
+
/**
|
|
64
|
+
* Services available for the handlers
|
|
65
|
+
*/
|
|
66
|
+
services: ContextServices;
|
|
55
67
|
}
|
package/lib/Context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../src/Context.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../src/Context.ts"],"names":[],"mappings":";;;AASA,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,yEAAQ,CAAA;IACR,2EAAS,CAAA;IACT,mFAAa,CAAA;IACb,mEAAK,CAAA;AACT,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC"}
|
package/lib/Crm.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! Copyright (c) 2022, XAPPmedia */
|
|
2
|
+
export interface LeadFormField {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CrmTranscriptAttributes {
|
|
7
|
+
[attribute: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Transcript representation of the session. The input/output is an easily readable, simplified representation
|
|
11
|
+
* of the visitor/bot "chat". This is usually emailed or sent to a CRM system or customer service for a quick overview.
|
|
12
|
+
* That is why input an output are strings.
|
|
13
|
+
*/
|
|
14
|
+
export interface CrmTranscriptExchange {
|
|
15
|
+
input: string;
|
|
16
|
+
output: string;
|
|
17
|
+
attributes?: CrmTranscriptAttributes;
|
|
18
|
+
}
|
|
19
|
+
export interface CrmTranscript {
|
|
20
|
+
items: CrmTranscriptExchange[];
|
|
21
|
+
}
|
|
22
|
+
export interface ExternalLead {
|
|
23
|
+
fields: LeadFormField[];
|
|
24
|
+
source?: string;
|
|
25
|
+
company?: string;
|
|
26
|
+
transcript?: CrmTranscript[];
|
|
27
|
+
}
|
|
28
|
+
export interface CrmResponse {
|
|
29
|
+
status: "Success" | "Failure";
|
|
30
|
+
message?: string;
|
|
31
|
+
}
|
package/lib/Crm.js
ADDED
package/lib/Crm.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Crm.js","sourceRoot":"","sources":["../src/Crm.ts"],"names":[],"mappings":";AAAA,oCAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrmService.js","sourceRoot":"","sources":["../../src/Services/CrmService.ts"],"names":[],"mappings":";AAAA,oCAAoC"}
|
package/lib/Services/index.d.ts
CHANGED
package/lib/Services/index.js
CHANGED
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
/*! Copyright (c) 2019, XAPPmedia */
|
|
14
14
|
__exportStar(require("./AppService"), exports);
|
|
15
15
|
__exportStar(require("./HandlerService"), exports);
|
|
16
|
+
__exportStar(require("./CrmService"), exports);
|
|
16
17
|
__exportStar(require("./KnowledgeBaseService"), exports);
|
|
17
18
|
__exportStar(require("./PIIService"), exports);
|
|
18
19
|
__exportStar(require("./SMSService"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,+CAA6B;AAC7B,mDAAiC;AACjC,yDAAuC;AACvC,+CAA6B;AAC7B,+CAA6B;AAC7B,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,+CAA6B;AAC7B,mDAAiC;AACjC,+CAA6B;AAC7B,yDAAuC;AACvC,+CAA6B;AAC7B,+CAA6B;AAC7B,uDAAqC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -17,6 +17,7 @@ __exportStar(require("./Channel"), exports);
|
|
|
17
17
|
__exportStar(require("./Conditional"), exports);
|
|
18
18
|
__exportStar(require("./Context"), exports);
|
|
19
19
|
__exportStar(require("./Contextual"), exports);
|
|
20
|
+
__exportStar(require("./Crm"), exports);
|
|
20
21
|
__exportStar(require("./DateTime"), exports);
|
|
21
22
|
__exportStar(require("./DelegatingHandler"), exports);
|
|
22
23
|
__exportStar(require("./Device"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,2CAAyB;AACzB,wCAAsB;AACtB,4CAA0B;AAC1B,gDAA8B;AAC9B,4CAA0B;AAC1B,+CAA6B;AAC7B,6CAA2B;AAC3B,sDAAoC;AACpC,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,kDAAgC;AAChC,2CAAyB;AACzB,6CAA2B;AAC3B,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,wCAAsB;AACtB,yCAAuB;AACvB,wCAAsB;AACtB,4CAA0B;AAC1B,mDAAiC;AACjC,6CAA2B;AAC3B,4CAA0B;AAC1B,6CAA2B;AAC3B,yCAAuB;AACvB,wCAAsB;AACtB,4CAA0B;AAC1B,+CAA6B;AAC7B,6CAA2B;AAC3B,gDAA8B;AAC9B,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,2CAAyB;AACzB,wCAAsB;AACtB,4CAA0B;AAC1B,gDAA8B;AAC9B,4CAA0B;AAC1B,+CAA6B;AAC7B,wCAAsB;AACtB,6CAA2B;AAC3B,sDAAoC;AACpC,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,kDAAgC;AAChC,2CAAyB;AACzB,6CAA2B;AAC3B,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,wCAAsB;AACtB,yCAAuB;AACvB,wCAAsB;AACtB,4CAA0B;AAC1B,mDAAiC;AACjC,6CAA2B;AAC3B,4CAA0B;AAC1B,6CAA2B;AAC3B,yCAAuB;AACvB,wCAAsB;AACtB,4CAA0B;AAC1B,+CAA6B;AAC7B,6CAA2B;AAC3B,gDAA8B;AAC9B,kDAAgC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.51.4",
|
|
8
8
|
"description": "Models for 📣 stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"typings": "lib/index",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@microsoft/api-extractor": "7.19.4",
|
|
21
21
|
"@rollup/plugin-typescript": "8.3.0",
|
|
22
22
|
"@xapp/config": "0.2.3",
|
|
23
|
-
"rollup": "2.66.
|
|
23
|
+
"rollup": "2.66.1",
|
|
24
24
|
"tslib": "2.3.1",
|
|
25
25
|
"typescript": "4.5.5"
|
|
26
26
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"clean": "rm -rf ./lib/* && rm -rf ./dist/*"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@xapp/patterns": "1.39.
|
|
34
|
+
"@xapp/patterns": "1.39.67"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "88fffe00e6e2383eb59ffc93f8c394ce23db349d"
|
|
37
37
|
}
|