stentor-models 1.50.21 → 1.51.2

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 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 servers user profile data (email, location, phone number, etc)
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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sourceRoot":"","sources":["../src/Context.ts"],"names":[],"mappings":";;;AAQA,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"}
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
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2022, XAPPmedia */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=Crm.js.map
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,9 @@
1
+ /*! Copyright (c) 2022, XAPPmedia */
2
+ import { CrmResponse, ExternalLead } from "../Crm";
3
+ export interface CrmService {
4
+ /**
5
+ *
6
+ * @param externalLead
7
+ */
8
+ send(externalLead: ExternalLead): Promise<CrmResponse>;
9
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2022, XAPPmedia */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=CrmService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CrmService.js","sourceRoot":"","sources":["../../src/Services/CrmService.ts"],"names":[],"mappings":";AAAA,oCAAoC"}
@@ -1,6 +1,7 @@
1
1
  /*! Copyright (c) 2019, XAPPmedia */
2
2
  export * from "./AppService";
3
3
  export * from "./HandlerService";
4
+ export * from "./CrmService";
4
5
  export * from "./KnowledgeBaseService";
5
6
  export * from "./PIIService";
6
7
  export * from "./SMSService";
@@ -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
@@ -5,6 +5,7 @@ export * from "./Channel";
5
5
  export * from "./Conditional";
6
6
  export * from "./Context";
7
7
  export * from "./Contextual";
8
+ export * from "./Crm";
8
9
  export * from "./DateTime";
9
10
  export * from "./DelegatingHandler";
10
11
  export * from "./Device";
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.50.21",
7
+ "version": "1.51.2",
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.64.0",
23
+ "rollup": "2.66.0",
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.50"
34
+ "@xapp/patterns": "1.39.67"
35
35
  },
36
- "gitHead": "5f66f22042b6411b376d421e60c8dd5d76871da1"
36
+ "gitHead": "80b9ce22147ec76f6cc1e5a4c82174073b3a1652"
37
37
  }