@xapp/stentor-lex-lib 1.86.2 → 1.86.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/translators/TranslateToLexImportExportBot.js +3 -3
- package/lib/translators/TranslateToLexImportExportBot.js.map +1 -1
- package/lib/translators/TranslateToLexImportExportIntent.js +3 -3
- package/lib/translators/TranslateToLexImportExportIntent.js.map +1 -1
- package/lib/translators/TranslateToLexImportExportSlotType.js +3 -3
- package/lib/translators/TranslateToLexImportExportSlotType.js.map +1 -1
- package/lib/translators/deepMerge.d.ts +30 -0
- package/lib/translators/deepMerge.js +46 -0
- package/lib/translators/deepMerge.js.map +1 -0
- package/package.json +9 -10
|
@@ -7,7 +7,7 @@ const stentor_utils_1 = require("stentor-utils");
|
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
const TranslateToLexImportExportIntent_1 = require("./TranslateToLexImportExportIntent");
|
|
9
9
|
const TranslateToLexImportExportSlotType_1 = require("./TranslateToLexImportExportSlotType");
|
|
10
|
-
const
|
|
10
|
+
const deepMerge_1 = require("./deepMerge");
|
|
11
11
|
class TranslateToLexImportExportBot extends patterns_1.Translator {
|
|
12
12
|
constructor(props) {
|
|
13
13
|
super();
|
|
@@ -15,13 +15,13 @@ class TranslateToLexImportExportBot extends patterns_1.Translator {
|
|
|
15
15
|
version: (0, stentor_utils_1.randomString)(4),
|
|
16
16
|
};
|
|
17
17
|
if (props) {
|
|
18
|
-
this.props =
|
|
18
|
+
this.props = (0, deepMerge_1.deepMerge)(this.props, props);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
translate(input, props) {
|
|
22
22
|
var _a;
|
|
23
23
|
if (props) {
|
|
24
|
-
this.props =
|
|
24
|
+
this.props = (0, deepMerge_1.deepMerge)(this.props, props);
|
|
25
25
|
}
|
|
26
26
|
const { app, channel, intents: intentsToTranslate, entities } = input;
|
|
27
27
|
const { version, uri, kendraIndexARN, kendraRole, postfixNameOnIntent, postfixNameOnEntity } = this.props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslateToLexImportExportBot.js","sourceRoot":"","sources":["../../src/translators/TranslateToLexImportExportBot.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,6CAA4C;AAG5C,iDAA6C;AAE7C,oCAAqD;AACrD,yFAG4C;AAC5C,6FAA0F;
|
|
1
|
+
{"version":3,"file":"TranslateToLexImportExportBot.js","sourceRoot":"","sources":["../../src/translators/TranslateToLexImportExportBot.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,6CAA4C;AAG5C,iDAA6C;AAE7C,oCAAqD;AACrD,yFAG4C;AAC5C,6FAA0F;AAE1F,2CAAwC;AAuCxC,MAAa,6BAA8B,SAAQ,qBAGlD;IAKG,YAAY,KAA0C;QAClD,KAAK,EAAE,CAAC;QALJ,UAAK,GAAuC;YAChD,OAAO,EAAE,IAAA,4BAAY,EAAC,CAAC,CAAC;SAC3B,CAAC;QAKE,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,GAAG,IAAA,qBAAS,EAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC;IAED,SAAS,CACL,KAAmH,EACnH,KAA6C;;QAE7C,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,GAAG,IAAA,qBAAS,EAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;QAEtE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1G,sBAAsB;QAEtB,MAAM,aAAa,GAAG,mBAAmB,CAAC,CAAC,CAAC,IAAA,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B,GAAG,OAAO,CAAC,uBAAuB,CAAC;YAC9D,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAC9B,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;YAC9C,GAAG,CAAC,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAC;QAC5E,CAAC;QAED,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AAnFD,sEAmFC"}
|
|
@@ -8,8 +8,8 @@ const stentor_interaction_model_1 = require("stentor-interaction-model");
|
|
|
8
8
|
const stentor_locales_1 = require("stentor-locales");
|
|
9
9
|
const stentor_utils_1 = require("stentor-utils");
|
|
10
10
|
const ValidationError_1 = require("./ValidationError");
|
|
11
|
+
const deepMerge_1 = require("./deepMerge");
|
|
11
12
|
const ConvertName_1 = require("../utils/ConvertName");
|
|
12
|
-
const merge = require("lodash.merge");
|
|
13
13
|
/**
|
|
14
14
|
* Translate an intent to a LEX import/export format intent.
|
|
15
15
|
*/
|
|
@@ -22,12 +22,12 @@ class TranslateToLexImportExportIntent extends patterns_1.Translator {
|
|
|
22
22
|
version: (0, stentor_utils_1.randomString)(4),
|
|
23
23
|
};
|
|
24
24
|
if (props) {
|
|
25
|
-
this.props =
|
|
25
|
+
this.props = (0, deepMerge_1.deepMerge)(this.props, props);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
translate(intent, props) {
|
|
29
29
|
if (props) {
|
|
30
|
-
this.props =
|
|
30
|
+
this.props = (0, deepMerge_1.deepMerge)(this.props, props);
|
|
31
31
|
}
|
|
32
32
|
const { locale, version } = this.props;
|
|
33
33
|
// Flatten to get the localized version
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslateToLexImportExportIntent.js","sourceRoot":"","sources":["../../src/translators/TranslateToLexImportExportIntent.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,6CAA4C;AAC5C,+DAAmG;AACnG,yEAA8F;AAC9F,qDAA2C;AAE3C,iDAAgE;AAEhE,uDAAoD;AAEpD,
|
|
1
|
+
{"version":3,"file":"TranslateToLexImportExportIntent.js","sourceRoot":"","sources":["../../src/translators/TranslateToLexImportExportIntent.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,6CAA4C;AAC5C,+DAAmG;AACnG,yEAA8F;AAC9F,qDAA2C;AAE3C,iDAAgE;AAEhE,uDAAoD;AAEpD,2CAAwC;AACxC,sDAI8B;AA+C9B;;GAEG;AACH,MAAa,gCAAiC,SAAQ,qBAAyC;IAO3F,YAAY,KAA6C;QACrD,KAAK,EAAE,CAAC;QAPJ,UAAK,GAA0C;YACnD,MAAM,EAAE,OAAO;YACf,4CAA4C;YAC5C,OAAO,EAAE,IAAA,4BAAY,EAAC,CAAC,CAAC;SAC3B,CAAC;QAIE,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,GAAG,IAAA,qBAAS,EAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,KAA6C;QACnE,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,GAAG,IAAA,qBAAS,EAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAEvC,uCAAuC;QACvC,MAAM,eAAe,GAAG,IAAA,0BAAQ,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjD,MAAM,kBAAkB,GAAG,IAAI,8CAAkB,CAAC;YAC9C,WAAW,EAAE,yDAA6B,CAAC,SAAS;YACpD,kCAAkC,EAAE,OAAO;SAC9C,CAAC,CAAC;QACH,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,SAAS,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAE/E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,W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,CAAC,IAAI,eAAe,CAC9K,CAAC;gBACN,CAAC;gBAED,SAAS,CAAC,mBAAmB,GAAG;oBAC5B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc;oBACtC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;iBAC9B,CAAC;YACN,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,MAAM,UAAU,GAAG,IAAI,8CAA0B,CAAC;gBAC9C,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;YACH,MAAM,cAAc,GAAW,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACrE,MAAM,OAAO,GAAG,UAAU,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;YACpE,IAAI,OAAO,EAAE,CAAC;gBACV,SAAS,CAAC,qBAAqB,GAAG,OAAO,CAAC;gBAC1C,iEAAiE;gBACjE,gCAAgC;gBAChC,oFAAoF;gBACpF,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;gBACxG,kDAAkD;gBAClD,OAAO,SAAS,CAAC,gBAAgB,CAAC;YACtC,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AA7HD,4EA6HC"}
|
|
@@ -7,7 +7,7 @@ const patterns_1 = require("@xapp/patterns");
|
|
|
7
7
|
const stentor_alexa_lib_1 = require("@xapp/stentor-alexa-lib");
|
|
8
8
|
const stentor_utils_1 = require("stentor-utils");
|
|
9
9
|
const ConvertName_1 = require("../utils/ConvertName");
|
|
10
|
-
const
|
|
10
|
+
const deepMerge_1 = require("./deepMerge");
|
|
11
11
|
class TranslateToLexImportExportSlotType extends patterns_1.Translator {
|
|
12
12
|
constructor(props) {
|
|
13
13
|
super();
|
|
@@ -16,12 +16,12 @@ class TranslateToLexImportExportSlotType extends patterns_1.Translator {
|
|
|
16
16
|
version: (0, stentor_utils_1.randomString)(4)
|
|
17
17
|
};
|
|
18
18
|
if (props) {
|
|
19
|
-
this.props =
|
|
19
|
+
this.props = (0, deepMerge_1.deepMerge)(this.props, props);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
translate(entity, props) {
|
|
23
23
|
if (props) {
|
|
24
|
-
this.props =
|
|
24
|
+
this.props = (0, deepMerge_1.deepMerge)(this.props, props);
|
|
25
25
|
}
|
|
26
26
|
const { version } = this.props;
|
|
27
27
|
const baseName = new stentor_alexa_lib_1.TranslateToAlexaSlotTypeName({ translateFor: "LEX" }).translate(entity.entityId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslateToLexImportExportSlotType.js","sourceRoot":"","sources":["../../src/translators/TranslateToLexImportExportSlotType.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,uDAAoD;AACpD,6CAA4C;AAC5C,+DAAuE;AAEvE,iDAAgE;AAEhE,sDAA4F;
|
|
1
|
+
{"version":3,"file":"TranslateToLexImportExportSlotType.js","sourceRoot":"","sources":["../../src/translators/TranslateToLexImportExportSlotType.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,uDAAoD;AACpD,6CAA4C;AAC5C,+DAAuE;AAEvE,iDAAgE;AAEhE,sDAA4F;AAC5F,2CAAwC;AAQxC,MAAa,kCAAmC,SAAQ,qBAA2C;IAO/F,YAAY,KAA+C;QACvD,KAAK,EAAE,CAAC;QANJ,UAAK,GAA4C;YACrD,4CAA4C;YAC5C,OAAO,EAAE,IAAA,4BAAY,EAAC,CAAC,CAAC;SAC3B,CAAC;QAIE,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,GAAG,IAAA,qBAAS,EAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,KAA+C;QAErE,IA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AAC;YACnD,CAAC,CAAC,CAAC;QACP,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAvDD,gFAuDC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! Copyright (c) 2026, XAPPmedia */
|
|
2
|
+
/**
|
|
3
|
+
* Recursively merges sources into the target, mutating and returning it.
|
|
4
|
+
*
|
|
5
|
+
* Replaces `lodash.merge` for the Lex import/export translators, which all do
|
|
6
|
+
* `this.props = deepMerge(this.props, props)`. The semantics below were
|
|
7
|
+
* measured against lodash.merge@4.6.2 before removal and are load-bearing:
|
|
8
|
+
*
|
|
9
|
+
* - the target is **mutated** and returned, so callers holding a reference to
|
|
10
|
+
* it observe the merge. The import/export translators rely on this when
|
|
11
|
+
* layering props onto `this.props`.
|
|
12
|
+
* - `this.props` is undefined on the first call, so an absent target is
|
|
13
|
+
* tolerated and produces a fresh object rather than throwing.
|
|
14
|
+
* - arrays merge **by index** rather than being replaced, so merging `[9]`
|
|
15
|
+
* over `[1, 2, 3]` yields `[9, 2, 3]`.
|
|
16
|
+
* - a source value of `undefined` does not overwrite; `null` does.
|
|
17
|
+
*
|
|
18
|
+
* One deliberate divergence: lodash guards against circular references and
|
|
19
|
+
* this does not, so a self-referencing object overflows the stack here. These
|
|
20
|
+
* only ever see plain config objects, and failing loudly on a cycle beats
|
|
21
|
+
* silently accepting one.
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
* @param {T} target
|
|
25
|
+
* @param {...unknown[]} sources
|
|
26
|
+
* @returns {T}
|
|
27
|
+
*/
|
|
28
|
+
export declare function deepMerge<T, A>(target: T, a: A): T & A;
|
|
29
|
+
export declare function deepMerge<T, A, B>(target: T, a: A, b: B): T & A & B;
|
|
30
|
+
export declare function deepMerge<T>(target: T, ...sources: unknown[]): T;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*! Copyright (c) 2026, XAPPmedia */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.deepMerge = deepMerge;
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const proto = Object.getPrototypeOf(value);
|
|
10
|
+
return proto === Object.prototype || proto === null;
|
|
11
|
+
}
|
|
12
|
+
function mergeInto(target, source) {
|
|
13
|
+
for (const key of Object.keys(source)) {
|
|
14
|
+
const incoming = source[key];
|
|
15
|
+
// An explicit undefined never clears an existing value.
|
|
16
|
+
if (incoming === undefined) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const existing = target[key];
|
|
20
|
+
if (Array.isArray(incoming)) {
|
|
21
|
+
const base = (Array.isArray(existing) ? existing : []);
|
|
22
|
+
mergeInto(base, incoming);
|
|
23
|
+
target[key] = base;
|
|
24
|
+
}
|
|
25
|
+
else if (isPlainObject(incoming)) {
|
|
26
|
+
// An object merged over an array keeps the array, matching lodash.
|
|
27
|
+
const base = (isPlainObject(existing) || Array.isArray(existing) ? existing : {});
|
|
28
|
+
mergeInto(base, incoming);
|
|
29
|
+
target[key] = base;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
target[key] = incoming;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function deepMerge(target, ...sources) {
|
|
37
|
+
const result = (target === null || target === undefined ? {} : target);
|
|
38
|
+
for (const source of sources) {
|
|
39
|
+
if (source === null || source === undefined) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
mergeInto(result, source);
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=deepMerge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../src/translators/deepMerge.ts"],"names":[],"mappings":";AAAA,oCAAoC;;AAqEpC,8BAY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B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACvB,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QAC3B,CAAC;IACL,CAAC;AACL,CAAC;AA+BD,SAAgB,SAAS,CAAC,MAAe,EAAE,GAAG,OAAkB;IAC5D,MAAM,MAAM,GAAG,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAA4B,CAAC;IAElG,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1C,SAAS;QACb,CAAC;QAED,SAAS,CAAC,MAAM,EAAE,MAAiC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.86.
|
|
7
|
+
"version": "1.86.3",
|
|
8
8
|
"description": "Shared AWS LEX Library for :mega: stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"main": "lib/index",
|
|
@@ -15,24 +15,23 @@
|
|
|
15
15
|
"node": "^20 || ^22 || ^24"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@aws-sdk/client-lex-runtime-v2": "3.
|
|
18
|
+
"@aws-sdk/client-lex-runtime-v2": "3.1105.0",
|
|
19
19
|
"@types/chai": "5.2.3",
|
|
20
20
|
"@types/sinon": "4.3.3",
|
|
21
21
|
"@xapp/config": "0.3.0",
|
|
22
22
|
"chai": "4.5.0",
|
|
23
|
-
"mocha": "11.
|
|
23
|
+
"mocha": "11.8.0",
|
|
24
24
|
"sinon": "21.0.0",
|
|
25
|
-
"stentor-interaction-model": "1.74.
|
|
26
|
-
"stentor-locales": "1.74.
|
|
27
|
-
"stentor-models": "1.
|
|
28
|
-
"stentor-request": "1.74.
|
|
29
|
-
"stentor-utils": "1.
|
|
25
|
+
"stentor-interaction-model": "1.74.4",
|
|
26
|
+
"stentor-locales": "1.74.4",
|
|
27
|
+
"stentor-models": "1.76.0",
|
|
28
|
+
"stentor-request": "1.74.4",
|
|
29
|
+
"stentor-utils": "1.75.0",
|
|
30
30
|
"ts-node": "10.9.2",
|
|
31
31
|
"typescript": "5.9.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@xapp/stentor-alexa-lib": "1.86.
|
|
35
|
-
"lodash.merge": "4.6.2"
|
|
34
|
+
"@xapp/stentor-alexa-lib": "1.86.3"
|
|
36
35
|
},
|
|
37
36
|
"peerDependencies": {
|
|
38
37
|
"stentor-interaction-model": "1.x",
|