@egen-civitas/esm-embed-host 0.12.0 → 0.12.2
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 +14 -0
- package/dist/host.js +16 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +2 -0
- package/package.json +3 -3
- package/src/host.ts +1 -1
- package/src/table.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @egen-civitas/esm-embed-host
|
|
2
2
|
|
|
3
|
+
## 0.12.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [772b92a]
|
|
8
|
+
- @egen-civitas/esm-embed-protocol@0.13.0
|
|
9
|
+
|
|
10
|
+
## 0.12.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 6e10d7e: Sécurité : le bouton `action` d'une notification est refusé (`DENIED`) si l'app n'a pas le droit `events.publish` sur son sujet. Auparavant seule la forme du sujet était validée : une app pouvait faire publier au Shell un sujet hors de ses droits.
|
|
15
|
+
- 1e5122b: Correctif : `navigation.exists` renvoyait toujours `true` lorsque `routeExists` est asynchrone (la promesse était convertie en booléen au lieu d'être attendue). Le résultat est maintenant celui de la promesse.
|
|
16
|
+
|
|
3
17
|
## 0.12.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/host.js
CHANGED
|
@@ -393,7 +393,22 @@ import { buildCoreUrl, buildEmbedSrc, coreSubpath, createRateLimiter, stripSensi
|
|
|
393
393
|
}
|
|
394
394
|
} : {}, opts.routeExists ? {
|
|
395
395
|
exists: function exists(path) {
|
|
396
|
-
return
|
|
396
|
+
return _async_to_generator(function() {
|
|
397
|
+
return _ts_generator(this, function(_state) {
|
|
398
|
+
switch(_state.label){
|
|
399
|
+
case 0:
|
|
400
|
+
return [
|
|
401
|
+
4,
|
|
402
|
+
opts.routeExists(path)
|
|
403
|
+
];
|
|
404
|
+
case 1:
|
|
405
|
+
return [
|
|
406
|
+
2,
|
|
407
|
+
!!_state.sent()
|
|
408
|
+
];
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
})();
|
|
397
412
|
}
|
|
398
413
|
} : {}), {
|
|
399
414
|
back: function back() {
|
package/dist/table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAEjB,KAAK,YAAY,EAGjB,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAiB,aAAa,EAAqB,MAAM,gBAAgB,CAAC;AAEtF,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1E,gGAAgG;IAChG,QAAQ,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC7G,2GAA2G;IAC3G,OAAO,CAAC,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,IA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AAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACjI,6FAA6F;IAC7F,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB,6DAA6D;IAC7D,OAAO,EAAE,GAAG,CAAC;CACd;AAED,8HAA8H;AAC9H,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,aAAa,GAAG,GAAG,CAAC,YAAY,CAAC,CAczE;AAID,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,YAAY,GAAG;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,gBAAgB,CAAA;CAAE,CAuP3G"}
|
package/dist/table.js
CHANGED
|
@@ -492,6 +492,8 @@ var list = function list(cfg, key) {
|
|
|
492
492
|
switch(_state.label){
|
|
493
493
|
case 0:
|
|
494
494
|
if (!allow()) throw new EmbedError('RATE_LIMITED', 'Trop de notifications');
|
|
495
|
+
// Le bouton d'un toast publie son sujet : il n'ouvre jamais un droit que l'app n'a pas (`events.publish` du grant approuvé).
|
|
496
|
+
if (n.action && !topicAllowed(list(cfgOf.get('events'), 'publish'), n.action.topic)) throw denied("Action de notification non autoris\xe9e sur : ".concat(n.action.topic));
|
|
495
497
|
return [
|
|
496
498
|
4,
|
|
497
499
|
p.notifications.show(n, ctx)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egen-civitas/esm-embed-host",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Hôte (côté Shell/Core) des applications embarquées : iframe sécurisée, poignée de main v2, grants, fournisseurs de capacités, navigation partagée, compatibilité du pont 1.1.",
|
|
6
6
|
"type": "module",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@egen-civitas/esm-embed-client": "^0.13.
|
|
60
|
+
"@egen-civitas/esm-embed-client": "^0.13.1",
|
|
61
61
|
"@swc/cli": "0.8.1",
|
|
62
62
|
"@swc/core": "1.15.21",
|
|
63
63
|
"@types/node": "^20",
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"vitest": "^4.1.2"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@egen-civitas/esm-embed-protocol": "^0.
|
|
72
|
+
"@egen-civitas/esm-embed-protocol": "^0.13.0"
|
|
73
73
|
}
|
|
74
74
|
}
|
package/src/host.ts
CHANGED
|
@@ -164,7 +164,7 @@ export function createEmbedHost(opts: EmbedHostOptions): EmbedHost {
|
|
|
164
164
|
},
|
|
165
165
|
}
|
|
166
166
|
: {}),
|
|
167
|
-
...(opts.routeExists ? { exists: (path: string) => !!opts.routeExists!(path) } : {}),
|
|
167
|
+
...(opts.routeExists ? { exists: async (path: string) => !!(await opts.routeExists!(path)) } : {}),
|
|
168
168
|
back: () => void win.history.back(),
|
|
169
169
|
canGoBack: () => win.history.length > 1,
|
|
170
170
|
...(opts.intents
|
package/src/table.ts
CHANGED
|
@@ -148,6 +148,8 @@ export function createCapabilityTable(o: TableOptions): { table: HandlerTable; s
|
|
|
148
148
|
table.notifications = {
|
|
149
149
|
show: async (n: any) => {
|
|
150
150
|
if (!allow()) throw new EmbedError('RATE_LIMITED', 'Trop de notifications');
|
|
151
|
+
// Le bouton d'un toast publie son sujet : il n'ouvre jamais un droit que l'app n'a pas (`events.publish` du grant approuvé).
|
|
152
|
+
if (n.action && !topicAllowed(list(cfgOf.get('events'), 'publish'), n.action.topic)) throw denied(`Action de notification non autorisée sur : ${n.action.topic}`);
|
|
151
153
|
const r = await p.notifications!.show(n, ctx);
|
|
152
154
|
const shown: NotificationShown = r !== null && typeof r === 'object' ? r : {};
|
|
153
155
|
const id: string = n.id ?? `n-${++toastSeq}`;
|