@botonic/plugin-pre-handoff 2.23.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.
- package/CHANGELOG.md +195 -0
- package/README.md +11 -0
- package/package.json +20 -0
- package/src/index.d.ts +11 -0
- package/src/index.js +30 -0
- package/src/index.js.map +1 -0
- package/src/utils.d.ts +1 -0
- package/src/utils.js +24 -0
- package/src/utils.js.map +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
## 2.23.0 (2026-03-23)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 2.22.1 (2026-03-19)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
9
|
+
## 2.22.0 (2026-03-16)
|
|
10
|
+
|
|
11
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
12
|
+
|
|
13
|
+
## 2.21.0 (2026-03-16)
|
|
14
|
+
|
|
15
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
16
|
+
|
|
17
|
+
## 2.20.0 (2026-03-13)
|
|
18
|
+
|
|
19
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
20
|
+
|
|
21
|
+
## 2.19.0 (2026-03-12)
|
|
22
|
+
|
|
23
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
24
|
+
|
|
25
|
+
## 2.18.0 (2026-03-04)
|
|
26
|
+
|
|
27
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
28
|
+
|
|
29
|
+
## 2.17.0 (2026-03-02)
|
|
30
|
+
|
|
31
|
+
### 🚀 Features
|
|
32
|
+
|
|
33
|
+
- botonic working with v2 input format ([#660](https://github.com/metis-ai/hubtype-product/pull/660))
|
|
34
|
+
|
|
35
|
+
### ❤️ Thank You
|
|
36
|
+
|
|
37
|
+
- Marc Rabat @vanbasten17
|
|
38
|
+
|
|
39
|
+
## 2.16.0 (2026-02-23)
|
|
40
|
+
|
|
41
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
42
|
+
|
|
43
|
+
## 2.15.0 (2026-02-13)
|
|
44
|
+
|
|
45
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
46
|
+
|
|
47
|
+
## 2.14.0 (2026-02-05)
|
|
48
|
+
|
|
49
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
50
|
+
|
|
51
|
+
## 2.13.4 (2026-02-02)
|
|
52
|
+
|
|
53
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
54
|
+
|
|
55
|
+
## 2.13.3 (2026-01-30)
|
|
56
|
+
|
|
57
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
58
|
+
|
|
59
|
+
## 2.13.2 (2026-01-30)
|
|
60
|
+
|
|
61
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
62
|
+
|
|
63
|
+
## 2.13.1 (2026-01-30)
|
|
64
|
+
|
|
65
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
66
|
+
|
|
67
|
+
## 2.13.0 (2026-01-29)
|
|
68
|
+
|
|
69
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
70
|
+
|
|
71
|
+
## 2.12.0 (2026-01-28)
|
|
72
|
+
|
|
73
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
74
|
+
|
|
75
|
+
## 2.11.5 (2026-01-28)
|
|
76
|
+
|
|
77
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
78
|
+
|
|
79
|
+
## 2.11.4 (2026-01-28)
|
|
80
|
+
|
|
81
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
82
|
+
|
|
83
|
+
## 2.11.3 (2026-01-28)
|
|
84
|
+
|
|
85
|
+
### 🩹 Fixes
|
|
86
|
+
|
|
87
|
+
- update entrypoints to use .js and .d.ts extensions for module and types ([#552](https://github.com/metis-ai/hubtype-product/pull/552))
|
|
88
|
+
|
|
89
|
+
### ❤️ Thank You
|
|
90
|
+
|
|
91
|
+
- David Hidalgo @Davidhidalgo
|
|
92
|
+
|
|
93
|
+
## 2.11.2 (2026-01-21)
|
|
94
|
+
|
|
95
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
96
|
+
|
|
97
|
+
## 2.11.1 (2026-01-21)
|
|
98
|
+
|
|
99
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
100
|
+
|
|
101
|
+
## 2.11.0 (2026-01-21)
|
|
102
|
+
|
|
103
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
104
|
+
|
|
105
|
+
## 2.10.1 (2026-01-19)
|
|
106
|
+
|
|
107
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
108
|
+
|
|
109
|
+
## 2.10.0 (2026-01-18)
|
|
110
|
+
|
|
111
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
112
|
+
|
|
113
|
+
## 2.9.1 (2026-01-17)
|
|
114
|
+
|
|
115
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
116
|
+
|
|
117
|
+
## 2.9.0 (2026-01-17)
|
|
118
|
+
|
|
119
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
120
|
+
|
|
121
|
+
## 2.8.1 (2026-01-16)
|
|
122
|
+
|
|
123
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
124
|
+
|
|
125
|
+
## 2.8.0 (2026-01-16)
|
|
126
|
+
|
|
127
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
128
|
+
|
|
129
|
+
## 2.7.1 (2026-01-16)
|
|
130
|
+
|
|
131
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
132
|
+
|
|
133
|
+
## 2.7.0 (2026-01-15)
|
|
134
|
+
|
|
135
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
136
|
+
|
|
137
|
+
## 2.6.0 (2025-12-09)
|
|
138
|
+
|
|
139
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
140
|
+
|
|
141
|
+
## 2.5.0 (2025-12-09)
|
|
142
|
+
|
|
143
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
144
|
+
|
|
145
|
+
## 2.4.1 (2025-12-08)
|
|
146
|
+
|
|
147
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
148
|
+
|
|
149
|
+
## 2.4.0 (2025-12-05)
|
|
150
|
+
|
|
151
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
152
|
+
|
|
153
|
+
## 2.3.3 (2025-12-04)
|
|
154
|
+
|
|
155
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
156
|
+
|
|
157
|
+
## 2.3.2 (2025-12-04)
|
|
158
|
+
|
|
159
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
160
|
+
|
|
161
|
+
## 2.3.1 (2025-12-04)
|
|
162
|
+
|
|
163
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
164
|
+
|
|
165
|
+
## 2.3.0 (2025-12-04)
|
|
166
|
+
|
|
167
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
168
|
+
|
|
169
|
+
## 2.2.1 (2025-12-04)
|
|
170
|
+
|
|
171
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
|
172
|
+
|
|
173
|
+
## 2.2.0 (2025-12-04)
|
|
174
|
+
|
|
175
|
+
### 🚀 Features
|
|
176
|
+
|
|
177
|
+
- fine tuning botonic release #BLT-2010 ([#428](https://github.com/metis-ai/hubtype-product/pull/428))
|
|
178
|
+
|
|
179
|
+
### ❤️ Thank You
|
|
180
|
+
|
|
181
|
+
- David Hidalgo @Davidhidalgo
|
|
182
|
+
|
|
183
|
+
## 2.1.0 (2025-12-02)
|
|
184
|
+
|
|
185
|
+
### 🚀 Features
|
|
186
|
+
|
|
187
|
+
- fine tuning botonic release #BLT-2010 ([#428](https://github.com/metis-ai/hubtype-product/pull/428))
|
|
188
|
+
|
|
189
|
+
### ❤️ Thank You
|
|
190
|
+
|
|
191
|
+
- David Hidalgo @Davidhidalgo
|
|
192
|
+
|
|
193
|
+
## 2.0.1-alpha.0 (2025-11-27)
|
|
194
|
+
|
|
195
|
+
This was a version bump only for @botonic/plugin-pre-handoff to align it with other projects, there were no code changes.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# plugin-pre-handoff
|
|
2
|
+
|
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
|
4
|
+
|
|
5
|
+
## Building
|
|
6
|
+
|
|
7
|
+
Run `nx build plugin-pre-handoff` to build the library.
|
|
8
|
+
|
|
9
|
+
## Running unit tests
|
|
10
|
+
|
|
11
|
+
Run `nx test plugin-pre-handoff` to execute the unit tests via [Vitest](https://vitest.dev/).
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@botonic/plugin-pre-handoff",
|
|
3
|
+
"version": "2.23.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"module": "./src/index.js",
|
|
6
|
+
"types": "./src/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"tslib": "^2.3.0",
|
|
9
|
+
"@botonic/shared": "2.23.0"
|
|
10
|
+
},
|
|
11
|
+
"references": [
|
|
12
|
+
{
|
|
13
|
+
"path": "../core/tsconfig.lib.json"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"main": "./src/index.js"
|
|
20
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BotContext, HandoffOptions, Plugin, ResolvedPlugins } from '@botonic/shared';
|
|
2
|
+
export type GetNewParamsFunction<TBotPlugins extends ResolvedPlugins> = (botContext: BotContext<TBotPlugins>) => Promise<HandoffOptions> | HandoffOptions;
|
|
3
|
+
export type BotonicPluginPreHandoffOptions<TBotPlugins extends ResolvedPlugins> = {
|
|
4
|
+
getNewParams?: GetNewParamsFunction<TBotPlugins>;
|
|
5
|
+
};
|
|
6
|
+
export declare class BotonicPluginPreHandoff<TBotPlugins extends ResolvedPlugins> implements Plugin {
|
|
7
|
+
private getNewParams?;
|
|
8
|
+
constructor(options: BotonicPluginPreHandoffOptions<TBotPlugins>);
|
|
9
|
+
post(botContext: BotContext<TBotPlugins>): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export * from './utils';
|
package/src/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { BotonicAction, } from '@botonic/shared';
|
|
3
|
+
import { deepMerge } from './utils';
|
|
4
|
+
export class BotonicPluginPreHandoff {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.getNewParams = options.getNewParams;
|
|
7
|
+
}
|
|
8
|
+
post(botContext) {
|
|
9
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
var _a;
|
|
11
|
+
if (isHandoff(botContext)) {
|
|
12
|
+
const params = yield ((_a = this.getNewParams) === null || _a === void 0 ? void 0 : _a.call(this, botContext));
|
|
13
|
+
addHandoffParams(botContext, params);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function isHandoff(botContext) {
|
|
19
|
+
const botonicAction = botContext.session.botonicAction;
|
|
20
|
+
return !!botonicAction && botonicAction.startsWith(BotonicAction.CreateCase);
|
|
21
|
+
}
|
|
22
|
+
function addHandoffParams(botContext, newParams) {
|
|
23
|
+
const botonicAction = botContext.session.botonicAction;
|
|
24
|
+
const handoffParams = JSON.parse(botonicAction.split(`${BotonicAction.CreateCase}:`)[1]);
|
|
25
|
+
const botonicActionParams = deepMerge(handoffParams, newParams);
|
|
26
|
+
botContext.session.botonicAction = `${BotonicAction.CreateCase}:${JSON.stringify(botonicActionParams)}`;
|
|
27
|
+
}
|
|
28
|
+
// Re-export utils
|
|
29
|
+
export * from './utils';
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/botonic/plugin-pre-handoff/src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,aAAa,GAId,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAYnC,MAAM,OAAO,uBAAuB;IAKlC,YAAY,OAAoD;QAC9D,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAA;IAC1C,CAAC;IAEK,IAAI,CAAC,UAAmC;;;YAC5C,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,YAAY,qDAAG,UAAU,CAAC,CAAA,CAAA;gBACpD,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;YACtC,CAAC;QACH,CAAC;KAAA;CACF;AAED,SAAS,SAAS,CAAC,UAAsB;IACvC,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,aAAa,CAAA;IACtD,OAAO,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;AAC9E,CAAC;AAED,SAAS,gBAAgB,CACvB,UAAsB,EACtB,SAA0B;IAE1B,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,aAAuB,CAAA;IAEhE,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAC9B,aAAa,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CACvD,CAAA;IAED,MAAM,mBAAmB,GAAG,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;IAE/D,UAAU,CAAC,OAAO,CAAC,aAAa,GAAG,GAAG,aAAa,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,CAC9E,mBAAmB,CACpB,EAAE,CAAA;AACL,CAAC;AAED,kBAAkB;AAClB,cAAc,SAAS,CAAA"}
|
package/src/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deepMerge(target: any, source: any): any;
|
package/src/utils.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function isObject(item) {
|
|
2
|
+
return item && typeof item === 'object' && !Array.isArray(item);
|
|
3
|
+
}
|
|
4
|
+
export function deepMerge(target, source) {
|
|
5
|
+
if (Array.isArray(target) && Array.isArray(source)) {
|
|
6
|
+
return [...target, ...source];
|
|
7
|
+
}
|
|
8
|
+
else if (isObject(target) && isObject(source)) {
|
|
9
|
+
const result = Object.assign({}, target);
|
|
10
|
+
for (const key in source) {
|
|
11
|
+
if (key in target) {
|
|
12
|
+
result[key] = deepMerge(target[key], source[key]);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
result[key] = source[key];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return source;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=utils.js.map
|
package/src/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../libs/botonic/plugin-pre-handoff/src/utils.ts"],"names":[],"mappings":"AAAA,SAAS,QAAQ,CAAC,IAAS;IACzB,OAAO,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AACjE,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAW,EAAE,MAAW;IAChD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA;IAC/B,CAAC;SAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,MAAM,qBAAa,MAAM,CAAE,CAAA;QACjC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YACzB,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;gBAClB,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;YACnD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAA;IACf,CAAC;AACH,CAAC"}
|