stentor-models 1.51.0 → 1.52.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/App/App.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /*! Copyright (c) 2019, XAPPmedia */
2
2
  import { ChannelData } from "../Channel";
3
3
  import { ImageSpecification } from "../Display";
4
+ import { KnowledgebaseData } from "../Knowledgebase";
4
5
  import { Locale, Localizable } from "../Locale";
5
6
  import { Location } from "../Location";
6
7
  import { NLUData } from "../NLU";
@@ -180,6 +181,8 @@ export interface App extends Localizable<LocaleSpecificApp> {
180
181
  /**
181
182
  * Channels for the app.
182
183
  *
184
+ * Channels may have their own NLU and or Knowledgebase
185
+ *
183
186
  * Upgrade from platformData as it allows to publish the same
184
187
  * assistant app multiple times to the same channel.
185
188
  *
@@ -190,6 +193,12 @@ export interface App extends Localizable<LocaleSpecificApp> {
190
193
  *
191
194
  */
192
195
  nlu?: NLUData[];
196
+ /**
197
+ * Knowledgebase available to the assistant application.
198
+ *
199
+ * @alpha This feature is currently under development
200
+ */
201
+ knowledgebase?: KnowledgebaseData[];
193
202
  /**
194
203
  * Data streams for the app.
195
204
  *
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"}
@@ -0,0 +1,11 @@
1
+ /*! Copyright (c) 2022, XAPPmedia */
2
+ export interface KnowledgebaseData {
3
+ /**
4
+ * Unique ID of the knowledgebase
5
+ */
6
+ id: string;
7
+ /**
8
+ * The type of knowledgebase
9
+ */
10
+ type: string;
11
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2022, XAPPmedia */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=KnowledgebaseData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KnowledgebaseData.js","sourceRoot":"","sources":["../../src/Knowledgebase/KnowledgebaseData.ts"],"names":[],"mappings":";AAAA,oCAAoC"}
@@ -0,0 +1,2 @@
1
+ /*! Copyright (c) 2022, XAPPmedia */
2
+ export * from "./KnowledgebaseData";
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ /*! Copyright (c) 2022, XAPPmedia */
14
+ __exportStar(require("./KnowledgebaseData"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Knowledgebase/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,sDAAoC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.51.0",
7
+ "version": "1.52.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.66.0",
23
+ "rollup": "2.66.1",
24
24
  "tslib": "2.3.1",
25
25
  "typescript": "4.5.5"
26
26
  },
@@ -33,5 +33,5 @@
33
33
  "dependencies": {
34
34
  "@xapp/patterns": "1.39.67"
35
35
  },
36
- "gitHead": "c5b725070a376dfe5eceaca64a6d79430acd5740"
36
+ "gitHead": "604f697ca4395aa7ac85ef010b4466a15e0fe7b2"
37
37
  }