@drawbridge/drawbridge-utils 0.0.161 → 0.0.162

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.
@@ -77,16 +77,12 @@ var messageWarnings = ({ message }) => {
77
77
  };
78
78
  var notificationWarnings = ({
79
79
  brand,
80
- channel = "email",
81
80
  message,
82
81
  subject
83
- } = {}) => {
84
- if (channel !== "email") return { message: [], subject: [] };
85
- return {
86
- message: messageWarnings({ message }),
87
- subject: subjectWarnings({ brand, subject })
88
- };
89
- };
82
+ } = {}) => ({
83
+ message: messageWarnings({ message }),
84
+ subject: subjectWarnings({ brand, subject })
85
+ });
90
86
  // Annotate the CommonJS export names for ESM import in node:
91
87
  0 && (module.exports = {
92
88
  notificationWarnings
@@ -131,25 +131,32 @@ const messageWarnings = ({ message }) => {
131
131
  // ONE ENTRY POINT, answering per field so each warning renders against the
132
132
  // input it is about rather than as a pile at the bottom of the form.
133
133
  //
134
- // `channel` is accepted and only 'email' is implemented. SMS is a genuinely
135
- // different problem — carriers filter on SHAFT categories, link shorteners and
136
- // opt-out wording, none of which these rules look at — and returning email
137
- // advice for an SMS would be confidently wrong. It returns nothing instead,
138
- // until someone writes the carrier rules properly.
134
+ // NO CHANNEL ARGUMENT, deliberately, and it is worth saying why since one was
135
+ // tried twice.
136
+ //
137
+ // First it gated SMS to silence, on the grounds that carriers filter on things
138
+ // these rules do not look at. That much is true, and it does not follow:
139
+ // shouting, repeated punctuation, currency amounts and scam-shaped phrasing
140
+ // matter at least as much on a phone, and an unbranded text is the exact shape
141
+ // of a smishing attempt. Then a hedge value was added for copy that could go
142
+ // either way, a caller passed it to a build that did not have it, and a whole
143
+ // form went quiet with nothing to show for the caution.
144
+ //
145
+ // Every rule here is one a person would want to hear wherever the words end up.
146
+ // Sorting them by channel bought accuracy on a single warning — the subject
147
+ // display limit, which is really an email idea — and cost the other six.
148
+ //
149
+ // SMS still has no rules of its OWN: SHAFT categories, link shorteners, opt-out
150
+ // wording, and the segment mechanics where one emoji drops the limit from 160
151
+ // characters to 70. Those belong with the SMS connection work rather than here,
152
+ // and their absence is a reason to write them, not to stay quiet meanwhile.
139
153
  const notificationWarnings = ({
140
154
  brand,
141
- channel = 'email',
142
155
  message,
143
156
  subject
144
- } = {}) => {
145
-
146
- if( channel !== 'email' ) return { message : [], subject : [] };
147
-
148
- return {
149
- message : messageWarnings({ message }),
150
- subject : subjectWarnings({ brand, subject })
151
- };
152
-
153
- };
157
+ } = {}) => ({
158
+ message : messageWarnings({ message }),
159
+ subject : subjectWarnings({ brand, subject })
160
+ });
154
161
 
155
162
  export { notificationWarnings };
@@ -131,25 +131,32 @@ const messageWarnings = ({ message }) => {
131
131
  // ONE ENTRY POINT, answering per field so each warning renders against the
132
132
  // input it is about rather than as a pile at the bottom of the form.
133
133
  //
134
- // `channel` is accepted and only 'email' is implemented. SMS is a genuinely
135
- // different problem — carriers filter on SHAFT categories, link shorteners and
136
- // opt-out wording, none of which these rules look at — and returning email
137
- // advice for an SMS would be confidently wrong. It returns nothing instead,
138
- // until someone writes the carrier rules properly.
134
+ // NO CHANNEL ARGUMENT, deliberately, and it is worth saying why since one was
135
+ // tried twice.
136
+ //
137
+ // First it gated SMS to silence, on the grounds that carriers filter on things
138
+ // these rules do not look at. That much is true, and it does not follow:
139
+ // shouting, repeated punctuation, currency amounts and scam-shaped phrasing
140
+ // matter at least as much on a phone, and an unbranded text is the exact shape
141
+ // of a smishing attempt. Then a hedge value was added for copy that could go
142
+ // either way, a caller passed it to a build that did not have it, and a whole
143
+ // form went quiet with nothing to show for the caution.
144
+ //
145
+ // Every rule here is one a person would want to hear wherever the words end up.
146
+ // Sorting them by channel bought accuracy on a single warning — the subject
147
+ // display limit, which is really an email idea — and cost the other six.
148
+ //
149
+ // SMS still has no rules of its OWN: SHAFT categories, link shorteners, opt-out
150
+ // wording, and the segment mechanics where one emoji drops the limit from 160
151
+ // characters to 70. Those belong with the SMS connection work rather than here,
152
+ // and their absence is a reason to write them, not to stay quiet meanwhile.
139
153
  const notificationWarnings = ({
140
154
  brand,
141
- channel = 'email',
142
155
  message,
143
156
  subject
144
- } = {}) => {
145
-
146
- if( channel !== 'email' ) return { message : [], subject : [] };
147
-
148
- return {
149
- message : messageWarnings({ message }),
150
- subject : subjectWarnings({ brand, subject })
151
- };
152
-
153
- };
157
+ } = {}) => ({
158
+ message : messageWarnings({ message }),
159
+ subject : subjectWarnings({ brand, subject })
160
+ });
154
161
 
155
162
  export { notificationWarnings };
@@ -54,16 +54,12 @@ var messageWarnings = ({ message }) => {
54
54
  };
55
55
  var notificationWarnings = ({
56
56
  brand,
57
- channel = "email",
58
57
  message,
59
58
  subject
60
- } = {}) => {
61
- if (channel !== "email") return { message: [], subject: [] };
62
- return {
63
- message: messageWarnings({ message }),
64
- subject: subjectWarnings({ brand, subject })
65
- };
66
- };
59
+ } = {}) => ({
60
+ message: messageWarnings({ message }),
61
+ subject: subjectWarnings({ brand, subject })
62
+ });
67
63
  export {
68
64
  notificationWarnings
69
65
  };
package/package.json CHANGED
@@ -226,5 +226,5 @@
226
226
  "prepublishOnly": ". \"$HOME/.nvm/nvm.sh\" && nvm use && tsup && node --test"
227
227
  },
228
228
  "types": "dist/index.d.ts",
229
- "version": "0.0.161"
229
+ "version": "0.0.162"
230
230
  }