@orangewall/customer-notifications-util 0.0.3 → 0.1.0

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.
@@ -65,13 +65,15 @@ function validateMessage(message) {
65
65
  if (!message.type) {
66
66
  throw new Error(`type is required!`);
67
67
  }
68
- if (!((_b = message.template) === null || _b === void 0 ? void 0 : _b.name)) {
69
- throw new Error(`template.name is required!`);
70
- }
71
- if (!((_c = message.template) === null || _c === void 0 ? void 0 : _c.channelType)) {
72
- throw new Error(`template.channelType is required!`);
73
- }
74
- if (!((_d = message.template) === null || _d === void 0 ? void 0 : _d.version)) {
75
- throw new Error(`template.version is required!`);
68
+ if (!message.body) {
69
+ if (!((_b = message.template) === null || _b === void 0 ? void 0 : _b.name)) {
70
+ throw new Error(`template.name is required!`);
71
+ }
72
+ if (!((_c = message.template) === null || _c === void 0 ? void 0 : _c.channelType)) {
73
+ throw new Error(`template.channelType is required!`);
74
+ }
75
+ if (!((_d = message.template) === null || _d === void 0 ? void 0 : _d.version)) {
76
+ throw new Error(`template.version is required!`);
77
+ }
76
78
  }
77
79
  }
@@ -4,6 +4,7 @@ export type Message = {
4
4
  type: String;
5
5
  template: Template;
6
6
  substitutions?: String;
7
+ body?: String;
7
8
  };
8
9
  export type Recipient = {
9
10
  employeeId?: String;
@@ -1 +1 @@
1
- {"version":3,"file":"message.model.d.mts","sourceRoot":"","sources":["../../../../src/models/message.model.mts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA"}
1
+ {"version":3,"file":"message.model.d.mts","sourceRoot":"","sources":["../../../../src/models/message.model.mts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA"}
@@ -46,13 +46,15 @@ function validateMessage(message) {
46
46
  if (!message.type) {
47
47
  throw new Error(`type is required!`);
48
48
  }
49
- if (!message.template?.name) {
50
- throw new Error(`template.name is required!`);
51
- }
52
- if (!message.template?.channelType) {
53
- throw new Error(`template.channelType is required!`);
54
- }
55
- if (!message.template?.version) {
56
- throw new Error(`template.version is required!`);
49
+ if (!message.body) {
50
+ if (!message.template?.name) {
51
+ throw new Error(`template.name is required!`);
52
+ }
53
+ if (!message.template?.channelType) {
54
+ throw new Error(`template.channelType is required!`);
55
+ }
56
+ if (!message.template?.version) {
57
+ throw new Error(`template.version is required!`);
58
+ }
57
59
  }
58
60
  }
@@ -4,6 +4,7 @@ export type Message = {
4
4
  type: String;
5
5
  template: Template;
6
6
  substitutions?: String;
7
+ body?: String;
7
8
  };
8
9
  export type Recipient = {
9
10
  employeeId?: String;
@@ -1 +1 @@
1
- {"version":3,"file":"message.model.d.mts","sourceRoot":"","sources":["../../../../src/models/message.model.mts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA"}
1
+ {"version":3,"file":"message.model.d.mts","sourceRoot":"","sources":["../../../../src/models/message.model.mts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangewall/customer-notifications-util",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "library to send customer notifications ",
5
5
  "exports": {
6
6
  ".": {