jsfe 1.95.3 → 1.96.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.
|
@@ -7,6 +7,10 @@ export function contactPrompt(cargo: any, options: any, callerAllowed: any, part
|
|
|
7
7
|
/** The line a ranked pick at the contact question is answered with, before the question again (owner 2026-11-18). */
|
|
8
8
|
export function rankedContactLine(kind: any, options: any, cargo: any, es?: boolean): string;
|
|
9
9
|
export function contactError(kind: any, options: any, es?: boolean): string;
|
|
10
|
+
/** The other phones and emails one answer holds (owner 2026-11-27): a contact card with several boxes filled, or "email and
|
|
11
|
+
* phone" typed together. Only one is looked up first (account, then phone, then email); when it is not on file these are tried
|
|
12
|
+
* in turn (phone, then email), each at most once, before the caller hears that none was found. */
|
|
13
|
+
export function contactAlternatives(answer: any, kind: any, phone: any, mail: any): any[];
|
|
10
14
|
/** A phone, email or account number the reply ranker extracted from the caller's sentence (owner 2026-11-25), kept only when
|
|
11
15
|
* the caller's own words hold it (its digits in the spoken digits, the email's name in the text) and it is a valid identifier. */
|
|
12
16
|
export function contactGiven(reply: any, spoken: any, text: any, options: any): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AAkDA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,0CAWC;AACD,qHAQC;AASD,qHAAqH;AACrH,6FAKC;AACD,4EAYC;AAED;kIACkI;AAClI;;;;SAUC;
|
|
1
|
+
{"version":3,"file":"identity-flows.d.ts","sourceRoot":"","sources":["../../src/forms/identity-flows.js"],"names":[],"mappings":"AAkDA,+GAA+G;AAC/G,oFAOC;AAQD,wFAAwF;AACxF,iDAGC;AACD,0CAWC;AACD,qHAQC;AASD,qHAAqH;AACrH,6FAKC;AACD,4EAYC;AAED;;kGAEkG;AAClG,0FASC;AAED;kIACkI;AAClI;;;;SAUC;AA8HD,2DAOC;AACD,4DAOC;AACD,gHAAgH;AAChH,8DAGC;AAkKD,8EAGC;AAgCD,4FAA4F;AAC5F;;;;EAOC;AAWD,oGAOC;AAjRD,iCAAgC,wIAAwI,CAAC;AACzK,wCAAuC,CAAC,CAAC;AAoSzC,0BAAsK"}
|
|
@@ -102,8 +102,8 @@ export function contactPrompt(cargo, options, callerAllowed, partial = false, es
|
|
|
102
102
|
const question = callerAllowed ? (es ? `Para usar su identificador de llamadas, por favor ${verb} sí. De lo contrario, por favor ${verb}${cargo.voice ? ' o ingrese' : ''} el teléfono o correo electrónico asociado con su cuenta${alternative}${key}.` : `To use your caller id, please ${verb} yes. Otherwise, please ${verb}${cargo.voice ? ' or enter' : ''} the phone or email associated with your account${alternative}${key}.`) : (es ? `Por favor ${verb}${cargo.voice ? ' o ingrese' : ''} el teléfono o correo electrónico asociado con su cuenta${alternative}${key}.` : `Please ${verb}${cargo.voice ? ' or enter' : ''} the phone or email associated with your account${alternative}${key}.`);
|
|
103
103
|
return (lead ? lead + ' ' : '') + question + (es ? ` Para salir en cualquier momento, puede ${cargo.voice ? 'presionar la tecla de asterisco o decir' : 'escribir'} SALIR.` : ` To exit anytime you can ${cargo.voice ? 'press the asterisk key or ' : ''}${verb} EXIT.`);
|
|
104
104
|
}
|
|
105
|
-
const contactParams = [param('retry_flow', 'Retry destination'), param('cancel_flow', 'Exit destination'), param('cell_number', 'Phone already supplied'), param('email', 'Email already supplied'), param('acct_number', 'Account identifier already supplied'), param('account_pattern', 'Tenant account identifier pattern'), param('account_name', 'English account identifier label'), param('account_name_es', 'Spanish account identifier label'), param('account_shape', 'Tenant keypad identifier shapes', 'array'), param('intro', 'English introduction'), param('intro_es', 'Spanish introduction'), param('caller_on_file', 'yes, no or unknown caller-ID eligibility'), param('retry_call_type', 'Retry destination invocation policy'), param('validate_flow', 'Contact existence validator'), param('merge_partials', 'Allow split account identifiers', 'boolean'), param('parent_form', 'Owning task FORM instance'), param('contact_options', 'Internal options across protocol transitions', 'object'), param('retrying', 'Retry-menu continuation', 'boolean'), param('gce_partial', 'Internal split identifier continuation', 'boolean'), param('gce_rejected', 'Internal rejected contact continuation', 'boolean'), param('gce_missed', 'Internal misread contact continuation', 'boolean')];
|
|
106
|
-
const contactDefaults = { retry_flow: 'authenticate-user', cancel_flow: 'contact-support', cell_number: '', email: '', acct_number: '', account_pattern: '', account_name: '', account_name_es: '', account_shape: [], intro: '', intro_es: '', caller_on_file: '', retry_call_type: 'reboot', validate_flow: '', merge_partials: false, parent_form: '', contact_options: null, retrying: false, gce_partial: false, gce_rejected: false, gce_missed: false, contact_allowed: false, contact_prefill: '', contact_partial: false, contact_text: '', contact_digits: '', contact_mail: '', contact_phone: '', contact_id: null, contact_profiles: [], contact_keypad: null, contact_question: '', contact_question_es: '', contact_check_key: '', contact_error: '', contact_error_es: '', contact_kind: '' };
|
|
105
|
+
const contactParams = [param('retry_flow', 'Retry destination'), param('cancel_flow', 'Exit destination'), param('cell_number', 'Phone already supplied'), param('email', 'Email already supplied'), param('acct_number', 'Account identifier already supplied'), param('account_pattern', 'Tenant account identifier pattern'), param('account_name', 'English account identifier label'), param('account_name_es', 'Spanish account identifier label'), param('account_shape', 'Tenant keypad identifier shapes', 'array'), param('intro', 'English introduction'), param('intro_es', 'Spanish introduction'), param('caller_on_file', 'yes, no or unknown caller-ID eligibility'), param('retry_call_type', 'Retry destination invocation policy'), param('validate_flow', 'Contact existence validator'), param('merge_partials', 'Allow split account identifiers', 'boolean'), param('parent_form', 'Owning task FORM instance'), param('contact_options', 'Internal options across protocol transitions', 'object'), param('retrying', 'Retry-menu continuation', 'boolean'), param('gce_partial', 'Internal split identifier continuation', 'boolean'), param('gce_rejected', 'Internal rejected contact continuation', 'boolean'), param('gce_missed', 'Internal misread contact continuation', 'boolean'), param('gce_alternative', 'Internal: another contact from the same answer, tried after one not on file', 'boolean')];
|
|
106
|
+
const contactDefaults = { retry_flow: 'authenticate-user', cancel_flow: 'contact-support', cell_number: '', email: '', acct_number: '', account_pattern: '', account_name: '', account_name_es: '', account_shape: [], intro: '', intro_es: '', caller_on_file: '', retry_call_type: 'reboot', validate_flow: '', merge_partials: false, parent_form: '', contact_options: null, retrying: false, gce_partial: false, gce_rejected: false, gce_missed: false, gce_alternative: false, contact_next: null, contact_alt_cell: '', contact_alt_mail: '', contact_allowed: false, contact_prefill: '', contact_partial: false, contact_text: '', contact_digits: '', contact_mail: '', contact_phone: '', contact_id: null, contact_profiles: [], contact_keypad: null, contact_question: '', contact_question_es: '', contact_check_key: '', contact_error: '', contact_error_es: '', contact_kind: '' };
|
|
107
107
|
const contactProfiles = [{ name: 'phone', label: 'phone number', label_es: 'número de teléfono', profile: { kind: 'phone' } }, { name: 'email_address', label: 'email address', label_es: 'correo electrónico', profile: { kind: 'email' } }, { name: 'account', label: 'account number', label_es: 'número de cuenta', profile: { kind: 'identifier' } }, { ...raw, form_client: false }];
|
|
108
108
|
const contactReplay = (id, extra = {}) => call(id, 'get-cell-or-email', { contact_options: '{{contact_options}}', cell_number: '', email: '', acct_number: '', ...extra }, 'replace');
|
|
109
109
|
// One answer that is no contact never ends the question (owner 2026-11-11): it is asked again, led by why, and only the
|
|
@@ -134,6 +134,28 @@ export function contactError(kind, options, es = false) {
|
|
|
134
134
|
return options.account_pattern ? (es ? 'Esto no parece ser un número de teléfono o de cuenta válido. Por favor revíselo e intente de nuevo.' : "This doesn't seem to be a valid phone or account number. Please check it and try again.") : (es ? 'Esto no parece ser un número de teléfono válido. Por favor revíselo e intente de nuevo.' : "This doesn't seem to be a valid phone number. Please check it and try again.");
|
|
135
135
|
return es ? 'Lo siento, necesito el teléfono o correo electrónico asociado con su cuenta' + (account ? ', o ' + account : '') + ' para continuar.' : 'Sorry, I do need the phone or email associated with your account' + (account ? ', or ' + account : '') + ' to proceed.';
|
|
136
136
|
}
|
|
137
|
+
/** The other phones and emails one answer holds (owner 2026-11-27): a contact card with several boxes filled, or "email and
|
|
138
|
+
* phone" typed together. Only one is looked up first (account, then phone, then email); when it is not on file these are tried
|
|
139
|
+
* in turn (phone, then email), each at most once, before the caller hears that none was found. */
|
|
140
|
+
export function contactAlternatives(answer, kind, phone, mail) {
|
|
141
|
+
const values = answer && answer.values || {}, text = String(answer && answer.raw || ''), out = [];
|
|
142
|
+
const add = (k, value) => {
|
|
143
|
+
const v = String(value || '').trim();
|
|
144
|
+
if (!v)
|
|
145
|
+
return;
|
|
146
|
+
const key = k === 'email' ? v.toLowerCase() : v.replace(/\D/g, '').slice(-10);
|
|
147
|
+
if ((k === 'phone' && kind === 'phone' && key === String(phone).replace(/\D/g, '').slice(-10)) || (k === 'email' && kind === 'email' && key === String(mail).toLowerCase()))
|
|
148
|
+
return;
|
|
149
|
+
if (!out.some(a => a.kind === k && a.key === key))
|
|
150
|
+
out.push({ kind: k, value: k === 'phone' ? key : v, key });
|
|
151
|
+
};
|
|
152
|
+
const phoneOf = v => { const d = String(v || '').replace(/\D/g, ''); return readPhone(String(v || '')) || (validatePhone(d) ? d : ''); };
|
|
153
|
+
add('phone', phoneOf(values.phone));
|
|
154
|
+
add('phone', readPhone(text));
|
|
155
|
+
add('email', values.email_address ? readEmail(String(values.email_address)) : '');
|
|
156
|
+
add('email', readEmail(text));
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
137
159
|
/** A phone, email or account number the reply ranker extracted from the caller's sentence (owner 2026-11-25), kept only when
|
|
138
160
|
* the caller's own words hold it (its digits in the spoken digits, the email's name in the text) and it is a valid identifier. */
|
|
139
161
|
export function contactGiven(reply, spoken, text, options) {
|
|
@@ -226,12 +248,18 @@ const contact = worker('get-cell-or-email', 'GetCellOrEmail', 'Identify a suppli
|
|
|
226
248
|
set('identity_contact_number', 'acct_number', "contact_kind === 'account' ? String(contact_id.value) : ''"),
|
|
227
249
|
set('identity_contact_cell', 'cell_number', "contact_kind === 'caller' ? String(cargo.callerId) : contact_kind === 'phone' ? contact_phone : ''"), set('identity_contact_mail', 'email', "contact_kind === 'email' ? contact_mail : ''"),
|
|
228
250
|
effect('identity_contact_record', "(cargo.contactKind=acct_number?'account':email?'email':String(cell_number).replace(/\\D/g,'').slice(-10)===String(cargo.callerId || '').replace(/\\D/g,'').slice(-10)?'caller':'phone',cargo.contactValue=String(acct_number || email || cell_number),cargo.contactAlternatives=cargo.serviceAnswer.values,true)"),
|
|
251
|
+
effect('identity_contact_alternatives', "(gce_alternative === true || gce_alternative === 'true' ? true : (cargo.gceAlternatives=['account','phone','email'].includes(contact_kind) ? " + expression(contactAlternatives, 'cargo.serviceAnswer', 'contact_kind', 'contact_phone', 'contact_mail') + " : [],cargo.gceTried=[]),true)"),
|
|
229
252
|
set('identity_contact_check_key', 'contact_check_key', "contact_options.validate_flow && !acct_number && !cargo.callerPreselected ? contact_options.validate_flow+'|'+(email?'email:'+email.toLowerCase():'phone:'+String(cell_number).replace(/\\D/g,'').slice(-10)) : ''"),
|
|
230
253
|
effect('identity_contact_check_reset', "(cargo.contactCheck=contact_check_key && cargo.gceChecks && cargo.gceChecks[contact_check_key] || '',true)"),
|
|
231
254
|
when('identity_contact_validate', 'contact_check_key && !cargo.contactCheck', call('identity_contact_validation', '{{contact_options.validate_flow}}')),
|
|
232
255
|
effect('identity_contact_check_record', "(contact_check_key ? (cargo.gceChecks=cargo.gceChecks || {},cargo.gceChecks[contact_check_key]=String(cargo.contactCheck || '')) : true,cargo.gceRejects=cargo.contactCheck === 'none'?Number(cargo.gceRejects || 0)+1:0,true)"),
|
|
233
|
-
|
|
234
|
-
set('
|
|
256
|
+
effect('identity_contact_tried', "(cargo.contactCheck === 'none' ? cargo.gceTried=(cargo.gceTried || []).concat([cargo.contactKind]) : true,true)"),
|
|
257
|
+
set('identity_contact_next', 'contact_next', "cargo.contactCheck === 'none' && contact_options.validate_flow ? (cargo.gceAlternatives || []).filter(function (a) {return !(cargo.gceChecks || {})[contact_options.validate_flow+'|'+(a.kind === 'email' ? 'email:'+a.key : 'phone:'+a.key)];})[0] || null : null"),
|
|
258
|
+
set('identity_contact_alt_cell', 'contact_alt_cell', "contact_next && contact_next.kind === 'phone' ? contact_next.value : ''"), set('identity_contact_alt_mail', 'contact_alt_mail', "contact_next && contact_next.kind === 'email' ? contact_next.value : ''"),
|
|
259
|
+
when('identity_contact_alternative_uncounted', '!!contact_next', effect('identity_contact_alternative_uncount', '(cargo.gceRejects=Math.max(0,Number(cargo.gceRejects || 0)-1),true)')),
|
|
260
|
+
when('identity_contact_alternative', '!!contact_next', contactReplay('identity_contact_try_alternative', { cell_number: '{{contact_alt_cell}}', email: '{{contact_alt_mail}}', gce_alternative: true, gce_rejected: true })),
|
|
261
|
+
set('identity_contact_rejected_message', 'contact_error', "(cargo.gceTried || []).length > 1 ? 'I could not find an account with that phone number or that email.' : cargo.contactKind === 'email' ? 'I could not find an account with that email.' : cargo.contactKind === 'caller' ? 'I could not find an account with the number you are calling from.' : 'I could not find an account with that phone number.'"),
|
|
262
|
+
set('identity_contact_rejected_message_es', 'contact_error_es', "(cargo.gceTried || []).length > 1 ? 'No encontré una cuenta con ese número de teléfono ni con ese correo.' : cargo.contactKind === 'email' ? 'No encontré una cuenta con ese correo.' : cargo.contactKind === 'caller' ? 'No encontré una cuenta con el número desde el que llama.' : 'No encontré una cuenta con ese número de teléfono.'"),
|
|
235
263
|
when('identity_contact_reject', 'cargo.contactCheck === "none"', call('identity_contact_rejection', 'contact-not-on-file', { contact_options: '{{contact_options}}', error_message: '{{contact_error}}', error_message_es: '{{contact_error_es}}' }, 'replace'))
|
|
236
264
|
]
|
|
237
265
|
});
|
package/dist/runtime-identity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const JSFE_RUNTIME_FINGERPRINT = "sha256:
|
|
1
|
+
export const JSFE_RUNTIME_FINGERPRINT = "sha256:cbfba80c58b7f8835aeae06100d5191d33a9381cdf44c63c000d9e34fc912321";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsfe",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.96.0",
|
|
4
4
|
"description": "TypeScript workflow engine for conversational/automation apps: multi-flow orchestration, interrupt/resume, stack-based control, robust errors, and flexible tool/REST integration.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ron Pinkas",
|