@tellescope/sdk 1.256.2 → 1.256.3
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/cjs/tests/api_tests/metriport_push_form_response.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/metriport_push_form_response.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/metriport_push_form_response.test.js +298 -0
- package/lib/cjs/tests/api_tests/metriport_push_form_response.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/phone_calls_move_enduser.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/phone_calls_move_enduser.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/phone_calls_move_enduser.test.js +274 -0
- package/lib/cjs/tests/api_tests/phone_calls_move_enduser.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/stripe_webhook_triggers.test.d.ts +18 -0
- package/lib/cjs/tests/api_tests/stripe_webhook_triggers.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/stripe_webhook_triggers.test.js +964 -0
- package/lib/cjs/tests/api_tests/stripe_webhook_triggers.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/welle_partner_token.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/welle_partner_token.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/welle_partner_token.test.js +313 -0
- package/lib/cjs/tests/api_tests/welle_partner_token.test.js.map +1 -0
- package/lib/cjs/tests/stripe_webhook_helpers.d.ts +204 -0
- package/lib/cjs/tests/stripe_webhook_helpers.d.ts.map +1 -0
- package/lib/cjs/tests/stripe_webhook_helpers.js +286 -0
- package/lib/cjs/tests/stripe_webhook_helpers.js.map +1 -0
- package/lib/cjs/tests/tests.d.ts.map +1 -1
- package/lib/cjs/tests/tests.js +192 -180
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/cjs/tests/unit_tests/translation.test.d.ts +3 -0
- package/lib/cjs/tests/unit_tests/translation.test.d.ts.map +1 -0
- package/lib/cjs/tests/unit_tests/translation.test.js.map +1 -0
- package/lib/esm/tests/api_tests/metriport_push_form_response.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/metriport_push_form_response.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/metriport_push_form_response.test.js +294 -0
- package/lib/esm/tests/api_tests/metriport_push_form_response.test.js.map +1 -0
- package/lib/esm/tests/api_tests/phone_calls_move_enduser.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/phone_calls_move_enduser.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/phone_calls_move_enduser.test.js +270 -0
- package/lib/esm/tests/api_tests/phone_calls_move_enduser.test.js.map +1 -0
- package/lib/esm/tests/api_tests/stripe_webhook_triggers.test.d.ts +18 -0
- package/lib/esm/tests/api_tests/stripe_webhook_triggers.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/stripe_webhook_triggers.test.js +960 -0
- package/lib/esm/tests/api_tests/stripe_webhook_triggers.test.js.map +1 -0
- package/lib/esm/tests/api_tests/welle_partner_token.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/welle_partner_token.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/welle_partner_token.test.js +309 -0
- package/lib/esm/tests/api_tests/welle_partner_token.test.js.map +1 -0
- package/lib/esm/tests/stripe_webhook_helpers.d.ts +204 -0
- package/lib/esm/tests/stripe_webhook_helpers.d.ts.map +1 -0
- package/lib/esm/tests/stripe_webhook_helpers.js +267 -0
- package/lib/esm/tests/stripe_webhook_helpers.js.map +1 -0
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +192 -180
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/esm/tests/unit_tests/translation.test.d.ts +3 -0
- package/lib/esm/tests/unit_tests/translation.test.d.ts.map +1 -0
- package/lib/esm/tests/unit_tests/translation.test.js +52 -0
- package/lib/esm/tests/unit_tests/translation.test.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/tests/api_tests/metriport_push_form_response.test.ts +226 -0
- package/src/tests/api_tests/stripe_webhook_triggers.test.ts +676 -0
- package/src/tests/api_tests/welle_partner_token.test.ts +249 -0
- package/src/tests/stripe_webhook_helpers.ts +240 -0
- package/src/tests/tests.ts +6 -0
- package/test_generated.pdf +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/unit_tests/translation.test.ts"],"names":[],"mappings":"AA6DA,QAAA,MAAM,OAAO,YAMZ,CAAA;AAMD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { generateTranslationSystemPrompt, translationLanguageCodeForLanguage, } from "@tellescope/utilities";
|
|
2
|
+
var failures = 0;
|
|
3
|
+
var passed = 0;
|
|
4
|
+
var assert = function (name, actual, expected) {
|
|
5
|
+
if (actual === expected) {
|
|
6
|
+
passed++;
|
|
7
|
+
console.log(" \u2713 ".concat(name));
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
failures++;
|
|
11
|
+
console.error(" \u2717 ".concat(name, " \u2014 expected ").concat(JSON.stringify(expected), ", got ").concat(JSON.stringify(actual)));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
// Only the gating is worth pinning: the markup-preservation clauses must not leak into the plain prompt
|
|
15
|
+
// used for inbound message translation, where there is no markup to preserve. The prompt wording itself
|
|
16
|
+
// is not asserted — that would only detect intentional edits.
|
|
17
|
+
var run_prompt_tests = function () {
|
|
18
|
+
console.log("\n[generateTranslationSystemPrompt]");
|
|
19
|
+
var MARKUP_CLAUSE = 'HTML tags';
|
|
20
|
+
assert('plain prompt omits the markup-preservation clauses', generateTranslationSystemPrompt('Spanish').includes(MARKUP_CLAUSE), false);
|
|
21
|
+
assert('draft prompt includes the markup-preservation clauses', generateTranslationSystemPrompt('Spanish', { preserveTemplateSyntax: true }).includes(MARKUP_CLAUSE), true);
|
|
22
|
+
assert('explicitly-false option matches the plain prompt', generateTranslationSystemPrompt('Spanish', { preserveTemplateSyntax: false }), generateTranslationSystemPrompt('Spanish'));
|
|
23
|
+
};
|
|
24
|
+
// Drafts are assumed to be written in English, so English (and anything unrecognized) resolves to the
|
|
25
|
+
// fallback. Real Enduser.language records include bare codes, regional codes, and displayName-only rows.
|
|
26
|
+
var run_language_tests = function () {
|
|
27
|
+
console.log("\n[translationLanguageCodeForLanguage]");
|
|
28
|
+
assert('bare supported code passes through', translationLanguageCodeForLanguage({ iso6391: 'vi' }), 'vi');
|
|
29
|
+
assert('regional code is reduced to its base', translationLanguageCodeForLanguage({ iso6391: 'es-ES' }), 'es');
|
|
30
|
+
assert('uppercase code is normalized', translationLanguageCodeForLanguage({ iso6391: 'PT' }), 'pt');
|
|
31
|
+
assert('displayName is used when iso6391 is empty', translationLanguageCodeForLanguage({ displayName: 'Spanish', iso6391: '' }), 'es');
|
|
32
|
+
assert('displayName match is case insensitive', translationLanguageCodeForLanguage({ displayName: 'korean' }), 'ko');
|
|
33
|
+
assert('iso6391 wins over displayName', translationLanguageCodeForLanguage({ displayName: 'Spanish', iso6391: 'fr' }), 'fr');
|
|
34
|
+
assert('English falls through to the fallback', translationLanguageCodeForLanguage({ iso6391: 'en' }), 'es');
|
|
35
|
+
assert('English displayName falls through to the fallback', translationLanguageCodeForLanguage({ displayName: 'English' }), 'es');
|
|
36
|
+
assert('unsupported code falls through to the fallback', translationLanguageCodeForLanguage({ iso6391: 'sw' }), 'es');
|
|
37
|
+
assert('missing language falls through to the fallback', translationLanguageCodeForLanguage(undefined), 'es');
|
|
38
|
+
assert('explicit fallback is honored', translationLanguageCodeForLanguage(undefined, { fallback: 'fr' }), 'fr');
|
|
39
|
+
};
|
|
40
|
+
var run_all = function () {
|
|
41
|
+
console.log("Running translation unit tests");
|
|
42
|
+
run_prompt_tests();
|
|
43
|
+
run_language_tests();
|
|
44
|
+
console.log("\nResults: ".concat(passed, " passed, ").concat(failures, " failed"));
|
|
45
|
+
if (failures > 0)
|
|
46
|
+
process.exit(1);
|
|
47
|
+
};
|
|
48
|
+
if (require.main === module) {
|
|
49
|
+
run_all();
|
|
50
|
+
}
|
|
51
|
+
export { run_all as translation_unit_tests };
|
|
52
|
+
//# sourceMappingURL=translation.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation.test.js","sourceRoot":"","sources":["../../../../src/tests/unit_tests/translation.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,GACnC,MAAM,uBAAuB,CAAA;AAE9B,IAAI,QAAQ,GAAG,CAAC,CAAA;AAChB,IAAI,MAAM,GAAG,CAAC,CAAA;AAEd,IAAM,MAAM,GAAG,UAAC,IAAY,EAAE,MAAe,EAAE,QAAiB;IAC9D,IAAI,MAAM,KAAK,QAAQ,EAAE;QACvB,MAAM,EAAE,CAAA;QACR,OAAO,CAAC,GAAG,CAAC,mBAAO,IAAI,CAAE,CAAC,CAAA;KAC3B;SAAM;QACL,QAAQ,EAAE,CAAA;QACV,OAAO,CAAC,KAAK,CAAC,mBAAO,IAAI,8BAAe,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,mBAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAE,CAAC,CAAA;KACnG;AACH,CAAC,CAAA;AAED,wGAAwG;AACxG,wGAAwG;AACxG,8DAA8D;AAC9D,IAAM,gBAAgB,GAAG;IACvB,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAA;IAElD,IAAM,aAAa,GAAG,WAAW,CAAA;IAEjC,MAAM,CAAC,oDAAoD,EACzD,+BAA+B,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,CAAA;IAC5E,MAAM,CAAC,uDAAuD,EAC5D,+BAA+B,CAAC,SAAS,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,C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