@get-bb/plugin-sdk 0.5.30 → 0.6.5
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/README.md +8 -4
- package/bundled-types/bb-plugin-sdk-app.d.ts +264 -384
- package/bundled-types/bb-plugin-sdk-environment-provider.d.ts +0 -84
- package/bundled-types/bb-plugin-sdk-internal-composer-handle.d.ts +457 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +21 -88
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +32 -10
- package/bundled-types/bb-plugin-sdk-testing.d.ts +8 -87
- package/bundled-types/bb-plugin-sdk.d.ts +298 -391
- package/dist/app.js +2 -0
- package/dist/internal/composer-customization-validation.js +37 -27
- package/dist/internal/composer-handle.js +531 -0
- package/dist/internal/plugin-app-collector.js +37 -27
- package/dist/testing/app.js +780 -132
- package/dist/testing/index.js +7 -4
- package/package.json +7 -1
|
@@ -95,6 +95,30 @@ function parseContributionArray(kind, value, onRejected, parse) {
|
|
|
95
95
|
}
|
|
96
96
|
return parsed;
|
|
97
97
|
}
|
|
98
|
+
function parseMenuItem(entryKind, value) {
|
|
99
|
+
const entry = value;
|
|
100
|
+
const id = requireSlotId(entryKind, entry?.id);
|
|
101
|
+
const icon = requireOptionalString(entryKind, "icon", entry?.icon);
|
|
102
|
+
const description = requireOptionalString(
|
|
103
|
+
entryKind,
|
|
104
|
+
"description",
|
|
105
|
+
entry?.description
|
|
106
|
+
);
|
|
107
|
+
const disabled = entry?.disabled;
|
|
108
|
+
if (disabled !== void 0 && typeof disabled !== "boolean" && typeof disabled !== "function") {
|
|
109
|
+
throw new Error(
|
|
110
|
+
`${entryKind}: "disabled" must be a boolean or function when set`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
id,
|
|
115
|
+
label: requireNonEmptyString(entryKind, "label", entry?.label),
|
|
116
|
+
...icon !== void 0 ? { icon } : {},
|
|
117
|
+
...description !== void 0 ? { description } : {},
|
|
118
|
+
...disabled !== void 0 ? { disabled } : {},
|
|
119
|
+
run: requireFunction(entryKind, "run", entry?.run)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
98
122
|
function parseRegions(kind, registration, onRejected) {
|
|
99
123
|
const actions = parseContributionArray(`${kind}.actions`, registration.actions, onRejected, (entryKind, value) => {
|
|
100
124
|
const entry = value;
|
|
@@ -122,32 +146,13 @@ function parseRegions(kind, registration, onRejected) {
|
|
|
122
146
|
`${kind}.plusMenu`,
|
|
123
147
|
registration.plusMenu,
|
|
124
148
|
onRejected,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
entry?.description
|
|
133
|
-
);
|
|
134
|
-
const disabled = entry?.disabled;
|
|
135
|
-
if (disabled !== void 0 && typeof disabled !== "boolean" && typeof disabled !== "function") {
|
|
136
|
-
throw new Error(
|
|
137
|
-
`${entryKind}: "disabled" must be a boolean or function when set`
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
return {
|
|
141
|
-
id,
|
|
142
|
-
label: requireNonEmptyString(entryKind, "label", entry?.label),
|
|
143
|
-
...icon !== void 0 ? { icon } : {},
|
|
144
|
-
...description !== void 0 ? { description } : {},
|
|
145
|
-
...disabled !== void 0 ? {
|
|
146
|
-
disabled
|
|
147
|
-
} : {},
|
|
148
|
-
run: requireFunction(entryKind, "run", entry?.run)
|
|
149
|
-
};
|
|
150
|
-
}
|
|
149
|
+
parseMenuItem
|
|
150
|
+
);
|
|
151
|
+
const sendMenu = parseContributionArray(
|
|
152
|
+
`${kind}.sendMenu`,
|
|
153
|
+
registration.sendMenu,
|
|
154
|
+
onRejected,
|
|
155
|
+
parseMenuItem
|
|
151
156
|
);
|
|
152
157
|
let richText;
|
|
153
158
|
if (registration.richText !== void 0) {
|
|
@@ -190,6 +195,7 @@ function parseRegions(kind, registration, onRejected) {
|
|
|
190
195
|
...actions !== void 0 ? { actions } : {},
|
|
191
196
|
...banners !== void 0 ? { banners } : {},
|
|
192
197
|
...plusMenu !== void 0 ? { plusMenu } : {},
|
|
198
|
+
...sendMenu !== void 0 ? { sendMenu } : {},
|
|
193
199
|
...richText !== void 0 ? { richText } : {}
|
|
194
200
|
};
|
|
195
201
|
}
|
|
@@ -214,7 +220,11 @@ function collectComposerCustomization(registration, seenIds, onRejected) {
|
|
|
214
220
|
requireUniqueId(kind, seenIds, id);
|
|
215
221
|
return {
|
|
216
222
|
id,
|
|
217
|
-
...scopes !== void 0 ? {
|
|
223
|
+
...scopes !== void 0 ? {
|
|
224
|
+
scopes: scopes.filter(
|
|
225
|
+
(scope) => scope !== "side-chat"
|
|
226
|
+
)
|
|
227
|
+
} : {},
|
|
218
228
|
...parseRegions(`${kind}(${id})`, raw ?? {}, onRejected)
|
|
219
229
|
};
|
|
220
230
|
} catch (error) {
|