stentor-models 1.51.0 → 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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.51.0",
7
+ "version": "1.51.2",
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": "1.39.67"
35
35
  },
36
- "gitHead": "c5b725070a376dfe5eceaca64a6d79430acd5740"
36
+ "gitHead": "80b9ce22147ec76f6cc1e5a4c82174073b3a1652"
37
37
  }