@empathyco/x-components 3.0.0-alpha.84 → 3.0.0-alpha.85
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 +12 -0
- package/core/index.js.map +1 -1
- package/design-system/full-theme.css +107 -108
- package/docs/API-reference/api/x-components.md +0 -2
- package/js/index.js +0 -1
- package/js/index.js.map +1 -1
- package/js/x-modules/tagging/store/actions/track.action.js +1 -2
- package/js/x-modules/tagging/store/actions/track.action.js.map +1 -1
- package/js/x-modules/tagging/wiring.js +1 -1
- package/js/x-modules/tagging/wiring.js.map +1 -1
- package/package.json +5 -6
- package/report/x-components.api.json +0 -310
- package/report/x-components.api.md +0 -19
- package/tagging/index.js +0 -1
- package/types/x-modules/tagging/service/index.d.ts +0 -1
- package/types/x-modules/tagging/service/index.d.ts.map +1 -1
- package/types/x-modules/tagging/service/types.d.ts +0 -20
- package/types/x-modules/tagging/service/types.d.ts.map +1 -1
- package/types/x-modules/tagging/wiring.d.ts.map +1 -1
- package/docs/API-reference/api/x-components.defaultsessionservice._constructor_.md +0 -21
- package/docs/API-reference/api/x-components.defaultsessionservice.clearsessionid.md +0 -17
- package/docs/API-reference/api/x-components.defaultsessionservice.getsessionid.md +0 -19
- package/docs/API-reference/api/x-components.defaultsessionservice.instance.md +0 -13
- package/docs/API-reference/api/x-components.defaultsessionservice.md +0 -37
- package/docs/API-reference/api/x-components.defaultsessionservice.session_id_key.md +0 -13
- package/docs/API-reference/api/x-components.defaultsessionservice.storageservice.md +0 -11
- package/docs/API-reference/api/x-components.defaultsessionservice.ttlms.md +0 -11
- package/docs/API-reference/api/x-components.sessionservice.clearsessionid.md +0 -17
- package/docs/API-reference/api/x-components.sessionservice.getsessionid.md +0 -23
- package/docs/API-reference/api/x-components.sessionservice.md +0 -21
- package/js/x-modules/tagging/service/session.service.js +0 -48
- package/js/x-modules/tagging/service/session.service.js.map +0 -1
- package/types/x-modules/tagging/service/session.service.d.ts +0 -37
- package/types/x-modules/tagging/service/session.service.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.0-alpha.85](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.84...@empathyco/x-components@3.0.0-alpha.85) (2022-04-14)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- extract SessionService to x-utils package
|
|
11
|
+
([5268808](https://github.com/empathyco/x/commit/52688087e577dfd7ce9b0669b21ada75ae67053c))
|
|
12
|
+
|
|
13
|
+
# Change Log
|
|
14
|
+
|
|
15
|
+
All notable changes to this project will be documented in this file. See
|
|
16
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
17
|
+
|
|
6
18
|
## [3.0.0-alpha.84](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.83...@empathyco/x-components@3.0.0-alpha.84) (2022-04-07)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @empathyco/x-components
|
package/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4306,6 +4306,49 @@
|
|
|
4306
4306
|
--x-string-text-decoration-small: line-through;
|
|
4307
4307
|
}
|
|
4308
4308
|
|
|
4309
|
+
.x-background--lead {
|
|
4310
|
+
background-color: var(--x-color-base-lead) !important;
|
|
4311
|
+
}
|
|
4312
|
+
|
|
4313
|
+
.x-background--auxiliary {
|
|
4314
|
+
background-color: var(--x-color-base-auxiliary) !important;
|
|
4315
|
+
}
|
|
4316
|
+
|
|
4317
|
+
.x-background--neutral-10 {
|
|
4318
|
+
background-color: var(--x-color-base-neutral-10) !important;
|
|
4319
|
+
}
|
|
4320
|
+
|
|
4321
|
+
.x-background--neutral-35 {
|
|
4322
|
+
background-color: var(--x-color-base-neutral-35) !important;
|
|
4323
|
+
}
|
|
4324
|
+
|
|
4325
|
+
.x-background--neutral-70 {
|
|
4326
|
+
background-color: var(--x-color-base-neutral-70) !important;
|
|
4327
|
+
}
|
|
4328
|
+
|
|
4329
|
+
.x-background--neutral-95 {
|
|
4330
|
+
background-color: var(--x-color-base-neutral-95) !important;
|
|
4331
|
+
}
|
|
4332
|
+
|
|
4333
|
+
.x-background--neutral-100 {
|
|
4334
|
+
background-color: var(--x-color-base-neutral-100) !important;
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
.x-background--accent {
|
|
4338
|
+
background-color: var(--x-color-base-accent) !important;
|
|
4339
|
+
}
|
|
4340
|
+
|
|
4341
|
+
.x-background--enable {
|
|
4342
|
+
background-color: var(--x-color-base-enable) !important;
|
|
4343
|
+
}
|
|
4344
|
+
|
|
4345
|
+
.x-background--disable {
|
|
4346
|
+
background-color: var(--x-color-base-disable) !important;
|
|
4347
|
+
}
|
|
4348
|
+
|
|
4349
|
+
.x-background--transparent {
|
|
4350
|
+
background-color: var(--x-color-base-transparent) !important;
|
|
4351
|
+
}
|
|
4309
4352
|
.x-border-color--lead {
|
|
4310
4353
|
border-color: var(--x-color-base-lead) !important;
|
|
4311
4354
|
}
|
|
@@ -6191,70 +6234,6 @@
|
|
|
6191
6234
|
.x-border-width--left-10 {
|
|
6192
6235
|
border-style: solid !important;
|
|
6193
6236
|
}
|
|
6194
|
-
.x-shadow--none {
|
|
6195
|
-
box-shadow: none !important;
|
|
6196
|
-
}
|
|
6197
|
-
|
|
6198
|
-
.x-shadow--01 {
|
|
6199
|
-
box-shadow: var(--x-string-box-shadow-01) !important;
|
|
6200
|
-
}
|
|
6201
|
-
.x-shadow--bottom-01 {
|
|
6202
|
-
box-shadow: var(--x-string-box-shadow-bottom-01) !important;
|
|
6203
|
-
}
|
|
6204
|
-
.x-shadow--02 {
|
|
6205
|
-
box-shadow: var(--x-string-box-shadow-02) !important;
|
|
6206
|
-
}
|
|
6207
|
-
.x-shadow--bottom-02 {
|
|
6208
|
-
box-shadow: var(--x-string-box-shadow-bottom-02) !important;
|
|
6209
|
-
}
|
|
6210
|
-
.x-shadow--03 {
|
|
6211
|
-
box-shadow: var(--x-string-box-shadow-03) !important;
|
|
6212
|
-
}
|
|
6213
|
-
.x-shadow--bottom-03 {
|
|
6214
|
-
box-shadow: var(--x-string-box-shadow-bottom-03) !important;
|
|
6215
|
-
}
|
|
6216
|
-
.x-shadow--04 {
|
|
6217
|
-
box-shadow: var(--x-string-box-shadow-04) !important;
|
|
6218
|
-
}
|
|
6219
|
-
.x-shadow--bottom-04 {
|
|
6220
|
-
box-shadow: var(--x-string-box-shadow-bottom-04) !important;
|
|
6221
|
-
}
|
|
6222
|
-
.x-shadow--05 {
|
|
6223
|
-
box-shadow: var(--x-string-box-shadow-05) !important;
|
|
6224
|
-
}
|
|
6225
|
-
.x-shadow--bottom-05 {
|
|
6226
|
-
box-shadow: var(--x-string-box-shadow-bottom-05) !important;
|
|
6227
|
-
}
|
|
6228
|
-
.x-shadow--06 {
|
|
6229
|
-
box-shadow: var(--x-string-box-shadow-06) !important;
|
|
6230
|
-
}
|
|
6231
|
-
.x-shadow--bottom-06 {
|
|
6232
|
-
box-shadow: var(--x-string-box-shadow-bottom-06) !important;
|
|
6233
|
-
}
|
|
6234
|
-
.x-shadow--07 {
|
|
6235
|
-
box-shadow: var(--x-string-box-shadow-07) !important;
|
|
6236
|
-
}
|
|
6237
|
-
.x-shadow--bottom-07 {
|
|
6238
|
-
box-shadow: var(--x-string-box-shadow-bottom-07) !important;
|
|
6239
|
-
}
|
|
6240
|
-
.x-shadow--08 {
|
|
6241
|
-
box-shadow: var(--x-string-box-shadow-08) !important;
|
|
6242
|
-
}
|
|
6243
|
-
.x-shadow--bottom-08 {
|
|
6244
|
-
box-shadow: var(--x-string-box-shadow-bottom-08) !important;
|
|
6245
|
-
}
|
|
6246
|
-
.x-shadow--09 {
|
|
6247
|
-
box-shadow: var(--x-string-box-shadow-09) !important;
|
|
6248
|
-
}
|
|
6249
|
-
.x-shadow--bottom-09 {
|
|
6250
|
-
box-shadow: var(--x-string-box-shadow-bottom-09) !important;
|
|
6251
|
-
}
|
|
6252
|
-
.x-shadow--10 {
|
|
6253
|
-
box-shadow: var(--x-string-box-shadow-10) !important;
|
|
6254
|
-
}
|
|
6255
|
-
.x-shadow--bottom-10 {
|
|
6256
|
-
box-shadow: var(--x-string-box-shadow-bottom-10) !important;
|
|
6257
|
-
}
|
|
6258
6237
|
/* Material Elevations extracted from:
|
|
6259
6238
|
https://gist.github.com/serglo/f9f0be9a66fd6755a0bda85f9c64e85f
|
|
6260
6239
|
*/
|
|
@@ -6421,6 +6400,70 @@
|
|
|
6421
6400
|
.x-font-color--transparent {
|
|
6422
6401
|
color: var(--x-color-base-transparent) !important;
|
|
6423
6402
|
}
|
|
6403
|
+
.x-shadow--none {
|
|
6404
|
+
box-shadow: none !important;
|
|
6405
|
+
}
|
|
6406
|
+
|
|
6407
|
+
.x-shadow--01 {
|
|
6408
|
+
box-shadow: var(--x-string-box-shadow-01) !important;
|
|
6409
|
+
}
|
|
6410
|
+
.x-shadow--bottom-01 {
|
|
6411
|
+
box-shadow: var(--x-string-box-shadow-bottom-01) !important;
|
|
6412
|
+
}
|
|
6413
|
+
.x-shadow--02 {
|
|
6414
|
+
box-shadow: var(--x-string-box-shadow-02) !important;
|
|
6415
|
+
}
|
|
6416
|
+
.x-shadow--bottom-02 {
|
|
6417
|
+
box-shadow: var(--x-string-box-shadow-bottom-02) !important;
|
|
6418
|
+
}
|
|
6419
|
+
.x-shadow--03 {
|
|
6420
|
+
box-shadow: var(--x-string-box-shadow-03) !important;
|
|
6421
|
+
}
|
|
6422
|
+
.x-shadow--bottom-03 {
|
|
6423
|
+
box-shadow: var(--x-string-box-shadow-bottom-03) !important;
|
|
6424
|
+
}
|
|
6425
|
+
.x-shadow--04 {
|
|
6426
|
+
box-shadow: var(--x-string-box-shadow-04) !important;
|
|
6427
|
+
}
|
|
6428
|
+
.x-shadow--bottom-04 {
|
|
6429
|
+
box-shadow: var(--x-string-box-shadow-bottom-04) !important;
|
|
6430
|
+
}
|
|
6431
|
+
.x-shadow--05 {
|
|
6432
|
+
box-shadow: var(--x-string-box-shadow-05) !important;
|
|
6433
|
+
}
|
|
6434
|
+
.x-shadow--bottom-05 {
|
|
6435
|
+
box-shadow: var(--x-string-box-shadow-bottom-05) !important;
|
|
6436
|
+
}
|
|
6437
|
+
.x-shadow--06 {
|
|
6438
|
+
box-shadow: var(--x-string-box-shadow-06) !important;
|
|
6439
|
+
}
|
|
6440
|
+
.x-shadow--bottom-06 {
|
|
6441
|
+
box-shadow: var(--x-string-box-shadow-bottom-06) !important;
|
|
6442
|
+
}
|
|
6443
|
+
.x-shadow--07 {
|
|
6444
|
+
box-shadow: var(--x-string-box-shadow-07) !important;
|
|
6445
|
+
}
|
|
6446
|
+
.x-shadow--bottom-07 {
|
|
6447
|
+
box-shadow: var(--x-string-box-shadow-bottom-07) !important;
|
|
6448
|
+
}
|
|
6449
|
+
.x-shadow--08 {
|
|
6450
|
+
box-shadow: var(--x-string-box-shadow-08) !important;
|
|
6451
|
+
}
|
|
6452
|
+
.x-shadow--bottom-08 {
|
|
6453
|
+
box-shadow: var(--x-string-box-shadow-bottom-08) !important;
|
|
6454
|
+
}
|
|
6455
|
+
.x-shadow--09 {
|
|
6456
|
+
box-shadow: var(--x-string-box-shadow-09) !important;
|
|
6457
|
+
}
|
|
6458
|
+
.x-shadow--bottom-09 {
|
|
6459
|
+
box-shadow: var(--x-string-box-shadow-bottom-09) !important;
|
|
6460
|
+
}
|
|
6461
|
+
.x-shadow--10 {
|
|
6462
|
+
box-shadow: var(--x-string-box-shadow-10) !important;
|
|
6463
|
+
}
|
|
6464
|
+
.x-shadow--bottom-10 {
|
|
6465
|
+
box-shadow: var(--x-string-box-shadow-bottom-10) !important;
|
|
6466
|
+
}
|
|
6424
6467
|
.x-font-size--01 {
|
|
6425
6468
|
font-size: var(--x-size-base-01) !important;
|
|
6426
6469
|
line-height: 1.5;
|
|
@@ -7523,47 +7566,3 @@
|
|
|
7523
7566
|
.x-normal-case {
|
|
7524
7567
|
text-transform: none;
|
|
7525
7568
|
}
|
|
7526
|
-
|
|
7527
|
-
.x-background--lead {
|
|
7528
|
-
background-color: var(--x-color-base-lead) !important;
|
|
7529
|
-
}
|
|
7530
|
-
|
|
7531
|
-
.x-background--auxiliary {
|
|
7532
|
-
background-color: var(--x-color-base-auxiliary) !important;
|
|
7533
|
-
}
|
|
7534
|
-
|
|
7535
|
-
.x-background--neutral-10 {
|
|
7536
|
-
background-color: var(--x-color-base-neutral-10) !important;
|
|
7537
|
-
}
|
|
7538
|
-
|
|
7539
|
-
.x-background--neutral-35 {
|
|
7540
|
-
background-color: var(--x-color-base-neutral-35) !important;
|
|
7541
|
-
}
|
|
7542
|
-
|
|
7543
|
-
.x-background--neutral-70 {
|
|
7544
|
-
background-color: var(--x-color-base-neutral-70) !important;
|
|
7545
|
-
}
|
|
7546
|
-
|
|
7547
|
-
.x-background--neutral-95 {
|
|
7548
|
-
background-color: var(--x-color-base-neutral-95) !important;
|
|
7549
|
-
}
|
|
7550
|
-
|
|
7551
|
-
.x-background--neutral-100 {
|
|
7552
|
-
background-color: var(--x-color-base-neutral-100) !important;
|
|
7553
|
-
}
|
|
7554
|
-
|
|
7555
|
-
.x-background--accent {
|
|
7556
|
-
background-color: var(--x-color-base-accent) !important;
|
|
7557
|
-
}
|
|
7558
|
-
|
|
7559
|
-
.x-background--enable {
|
|
7560
|
-
background-color: var(--x-color-base-enable) !important;
|
|
7561
|
-
}
|
|
7562
|
-
|
|
7563
|
-
.x-background--disable {
|
|
7564
|
-
background-color: var(--x-color-base-disable) !important;
|
|
7565
|
-
}
|
|
7566
|
-
|
|
7567
|
-
.x-background--transparent {
|
|
7568
|
-
background-color: var(--x-color-base-transparent) !important;
|
|
7569
|
-
}
|
|
@@ -58,7 +58,6 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
58
58
|
| [CrossFade](./x-components.crossfade.md) | Renders a transition wrapping the element passed in the default slo. The transition fades between the two toggled elements at the same time. |
|
|
59
59
|
| [DefaultFacetsService](./x-components.defaultfacetsservice.md) | Default implementation for the [FacetsService](./x-components.facetsservice.md)<!-- -->. |
|
|
60
60
|
| [DefaultPDPAddToCartService](./x-components.defaultpdpaddtocartservice.md) | Default implementation for the [PDPAddToCartService](./x-components.pdpaddtocartservice.md)<!-- -->. |
|
|
61
|
-
| [DefaultSessionService](./x-components.defaultsessionservice.md) | Default implementation for the [SessionService](./x-components.sessionservice.md)<!-- -->. |
|
|
62
61
|
| [DeviceDetector](./x-components.devicedetector.md) | This component helps detecting or setting a device, that can be used later to create different layouts optimized for different devices. This detected device is available under the [XComponentAliasAPI.device](./x-components.xcomponentaliasapi.device.md) property. |
|
|
63
62
|
| [DirectionalFocusNavigationService](./x-components.directionalfocusnavigationservice.md) | Implementation of [SpatialNavigation](./x-components.spatialnavigation.md) using directional focus. |
|
|
64
63
|
| [EditableNumberRangeFilter](./x-components.editablenumberrangefilter.md) | Renders an editable number range filter. It has two input fields to handle min and max values, emitting the needed events when clicked.<!-- -->It provides a default slot, with some utils bind, to customize the whole component; and two named slots <code>apply-content</code> and <code>clear-content</code> to override each button content.<!-- -->If <code>instant</code> prop is true, the needed events are emitted immediately; else, apply button is rendered to confirm to do it. False by default.<!-- -->If <code>clear</code> prop is true, clear button, which sets to null component min and max values, is rendered. True by default. |
|
|
@@ -302,7 +301,6 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
302
301
|
| [SearchMutations](./x-components.searchmutations.md) | Search store mutations. |
|
|
303
302
|
| [SearchState](./x-components.searchstate.md) | Search store state. |
|
|
304
303
|
| [SearchXEvents](./x-components.searchxevents.md) | Dictionary of the events of Search XModule, where each key is the event name, and the value is the event payload type or <code>void</code> if it has no payload. |
|
|
305
|
-
| [SessionService](./x-components.sessionservice.md) | Service to manage the session id. |
|
|
306
304
|
| [SnippetConfig](./x-components.snippetconfig.md) | Interface with the possible parameters to receive through the snippet integration. |
|
|
307
305
|
| [SpatialNavigation](./x-components.spatialnavigation.md) | Interface for SpatialNavigation services based on [CSSWK specification](https://www.w3.org/TR/css-nav-1/)<!-- -->. |
|
|
308
306
|
| [StateSelector](./x-components.stateselector.md) | Composition type of [SimpleStateSelector](./x-components.simplestateselector.md) which allows to indicate if the state selector should be executed in first instance (first assignment of values). Selector is the [SimpleStateSelector](./x-components.simplestateselector.md) and immediate flags if the selector should be executed when it is initialized for first time. |
|
package/js/index.js
CHANGED
|
@@ -324,7 +324,6 @@ export { searchBoxWiring } from './x-modules/search-box/wiring.js';
|
|
|
324
324
|
export { searchBoxXModule } from './x-modules/search-box/x-module.js';
|
|
325
325
|
export { default as Tagging } from './x-modules/tagging/components/tagging.vue.js';
|
|
326
326
|
export { DefaultPDPAddToCartService } from './x-modules/tagging/service/pdp-add-to-cart.service.js';
|
|
327
|
-
export { DefaultSessionService } from './x-modules/tagging/service/session.service.js';
|
|
328
327
|
export { track } from './x-modules/tagging/store/actions/track.action.js';
|
|
329
328
|
export { taggingEmitters } from './x-modules/tagging/store/emitters.js';
|
|
330
329
|
export { taggingXStoreModule } from './x-modules/tagging/store/module.js';
|
package/js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { DefaultSessionService } from '@empathyco/x-utils';
|
|
1
2
|
import { XPlugin } from '../../../../plugins/x-plugin.js';
|
|
2
|
-
import '../../service/pdp-add-to-cart.service.js';
|
|
3
|
-
import { DefaultSessionService } from '../../service/session.service.js';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Default implementation for the {@link TaggingActions.track}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.action.js","sources":["../../../../../../src/x-modules/tagging/store/actions/track.action.ts"],"sourcesContent":["import { TaggingInfo } from '@empathyco/x-types';\nimport {
|
|
1
|
+
{"version":3,"file":"track.action.js","sources":["../../../../../../src/x-modules/tagging/store/actions/track.action.ts"],"sourcesContent":["import { TaggingInfo } from '@empathyco/x-types';\nimport { DefaultSessionService } from '@empathyco/x-utils';\nimport { XPlugin } from '../../../../plugins/x-plugin';\nimport { TaggingXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link TaggingActions.track}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param taggingInfo - The information of the event to track.\n *\n * @public\n */\nexport const track: TaggingXStoreModule['actions']['track'] = ({ state }, taggingInfo) => {\n const { consent } = state;\n const taggingInfos = Array.isArray(taggingInfo) ? taggingInfo : [taggingInfo];\n const sessionId = getSessionId(consent);\n // TODO EX-5061 - Remove this validation when the adapter ignores undefined values.\n const session = sessionId && { session: sessionId };\n\n taggingInfos.forEach(({ url, params }: TaggingInfo) => {\n XPlugin.adapter.track({\n url,\n params: {\n ...params,\n ...session\n }\n });\n });\n};\n\n/**\n * Returns the session id if the consent is true.\n *\n * @param consent - User consent to retrieve the session id.\n *\n * @returns The user session id or undefined.\n *\n * @internal\n */\nfunction getSessionId(consent: boolean | null): string | undefined {\n return consent ? DefaultSessionService.instance.getSessionId() : undefined;\n}\n"],"names":[],"mappings":";;;AAKA;;;;;;;;;MASa,KAAK,GAA4C,CAAC,EAAE,KAAK,EAAE,EAAE,WAAW;IACnF,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,GAAG,CAAC,WAAW,CAAC,CAAC;IAC9E,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;;IAExC,MAAM,OAAO,GAAG,SAAS,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAEpD,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAe;QAChD,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;YACpB,GAAG;YACH,MAAM,EAAE;gBACN,GAAG,MAAM;gBACT,GAAG,OAAO;aACX;SACF,CAAC,CAAC;KACJ,CAAC,CAAC;AACL,EAAE;AAEF;;;;;;;;;AASA,SAAS,YAAY,CAAC,OAAuB;IAC3C,OAAO,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC;AAC7E;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { DefaultSessionService } from '@empathyco/x-utils';
|
|
1
2
|
import { namespacedWireCommit, namespacedWireDispatch } from '../../wiring/namespaced-wires.factory.js';
|
|
2
3
|
import { namespacedDebounce } from '../../wiring/namespaced-wires.operators.js';
|
|
3
4
|
import { wireServiceWithoutPayload, wireService } from '../../wiring/wires.factory.js';
|
|
4
5
|
import { filter, mapWire } from '../../wiring/wires.operators.js';
|
|
5
6
|
import { createWiring } from '../../wiring/wiring.utils.js';
|
|
6
|
-
import { DefaultSessionService } from './service/session.service.js';
|
|
7
7
|
import { DefaultPDPAddToCartService } from './service/pdp-add-to-cart.service.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/tagging/wiring.ts"],"sourcesContent":["import { Result, TaggingInfo } from '@empathyco/x-types';\nimport {\n namespacedWireCommit,\n namespacedWireDispatch\n} from '../../wiring/namespaced-wires.factory';\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators';\nimport { wireService, wireServiceWithoutPayload } from '../../wiring/wires.factory';\nimport { filter, mapWire } from '../../wiring/wires.operators';\nimport { Wire } from '../../wiring/wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\nimport {
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/tagging/wiring.ts"],"sourcesContent":["import { Result, TaggingInfo } from '@empathyco/x-types';\nimport { DefaultSessionService } from '@empathyco/x-utils';\nimport {\n namespacedWireCommit,\n namespacedWireDispatch\n} from '../../wiring/namespaced-wires.factory';\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators';\nimport { wireService, wireServiceWithoutPayload } from '../../wiring/wires.factory';\nimport { filter, mapWire } from '../../wiring/wires.operators';\nimport { Wire } from '../../wiring/wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\nimport { DefaultPDPAddToCartService } from './service/pdp-add-to-cart.service';\n\n/**\n * `tagging` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'tagging';\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName);\n\n/**\n * WireCommit for {@link TaggingXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName);\n\n/**\n * WireDispatch for {@link TaggingXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * Wires without payload factory for {@link DefaultSessionService}.\n */\nconst wireSessionServiceWithoutPayload = wireServiceWithoutPayload(DefaultSessionService.instance);\n\n/**\n * Wires factory for {@link DefaultPDPAddToCartService}.\n */\nconst wirePDPAddToCartService = wireService(DefaultPDPAddToCartService.instance);\n\n/**\n * Stores the given result on the local storage.\n *\n * @public\n */\nconst storeClickedResultWire = wirePDPAddToCartService('storeResultClicked');\n\n/**\n * Moves the result information from the local storage to session storage.\n *\n * @public\n */\nconst moveClickedResultToSessionWire = mapWire(\n wirePDPAddToCartService('moveToSessionStorage'),\n (payload: string) => {\n return payload === 'url' ? undefined : payload;\n }\n);\n\n/**\n * Triggers the add to cart tracking.\n *\n * @public\n */\nconst trackAddToCartFromSessionStorage = wirePDPAddToCartService('trackAddToCart');\n\n/**\n * Clears the session id.\n *\n * @public\n */\nconst clearSessionWire = filter(\n wireSessionServiceWithoutPayload('clearSessionId'),\n ({ eventPayload: consent }) => !consent\n);\n\n/**\n * Sets the tagging state `consent`.\n *\n * @public\n */\nexport const setConsent = wireCommit('setConsent');\n\n/**\n * Sets the tagging config state.\n *\n * @public\n */\nexport const setTaggingConfig = wireCommit('setTaggingConfig');\n\n/**\n * Tracks the tagging of the query.\n *\n * @public\n */\nexport const trackQueryWire = wireDispatch('track');\n\n/**\n * Sets the tagging state of the query tagging info using a debounce which ends if the user\n * accepts a query.\n *\n * @public\n */\nexport const setQueryTaggingInfo = moduleDebounce(\n wireCommit('setQueryTaggingInfo'),\n ({ state }) => state.config.queryTaggingDebounceMs,\n {\n cancelOn: 'UserClearedQuery',\n forceOn: [\n 'UserClickedAResult',\n 'UserClickedAPromoted',\n 'UserClickedABanner',\n 'UserClickedARedirection',\n 'UserReachedResultsListEnd'\n ]\n }\n);\n\n/**\n * Tracks the tagging of the result.\n *\n * @public\n */\nexport const trackResultClickedWire = createTrackResultWire('click');\n\n/**\n * Performs a track of a result added to the cart.\n *\n * @public\n */\nexport const trackAddToCartWire = createTrackResultWire('add2cart');\n\n/**\n * Factory helper to create a wire for the track of a result.\n *\n * @param property - Key of the tagging object to track.\n * @returns A new wire for the given property of the result tagging.\n *\n * @internal\n */\nfunction createTrackResultWire(property: keyof Result['tagging']): Wire<Result> {\n return filter(\n wireDispatch('track', ({ eventPayload: { tagging }, metadata: { location } }) => {\n const taggingInfo: TaggingInfo = tagging[property];\n taggingInfo.params.location = location as string;\n return taggingInfo;\n }),\n ({ eventPayload: { tagging } }) => !!tagging?.[property]\n );\n}\n\n/**\n * Wiring configuration for the {@link TaggingXModule | tagging module}.\n *\n * @internal\n */\nexport const taggingWiring = createWiring({\n ConsentProvided: {\n setConsent\n },\n ConsentChanged: {\n clearSessionWire\n },\n PDPIsLoaded: {\n moveClickedResultToSessionWire\n },\n ResultURLTrackingEnabled: {\n moveClickedResultToSessionWire\n },\n SearchTaggingChanged: {\n setQueryTaggingInfo\n },\n SearchTaggingReceived: {\n trackQueryWire\n },\n TaggingConfigProvided: {\n setTaggingConfig\n },\n UserClickedAResult: {\n trackResultClickedWire,\n storeClickedResultWire\n },\n UserClickedResultAddToCart: {\n trackAddToCartWire\n },\n UserClickedPDPAddToCart: {\n trackAddToCartFromSessionStorage\n }\n});\n"],"names":[],"mappings":";;;;;;;;AAaA;;;;;AAKA,MAAM,UAAU,GAAG,SAAS,CAAC;AAE7B;;;AAGA,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAEtD;;;;;AAKA,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAEpD;;;;;AAKA,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;;AAGA,MAAM,gCAAgC,GAAG,yBAAyB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AAEnG;;;AAGA,MAAM,uBAAuB,GAAG,WAAW,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;AAEjF;;;;;AAKA,MAAM,sBAAsB,GAAG,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;AAE7E;;;;;AAKA,MAAM,8BAA8B,GAAG,OAAO,CAC5C,uBAAuB,CAAC,sBAAsB,CAAC,EAC/C,CAAC,OAAe;IACd,OAAO,OAAO,KAAK,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AACjD,CAAC,CACF,CAAC;AAEF;;;;;AAKA,MAAM,gCAAgC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;AAEnF;;;;;AAKA,MAAM,gBAAgB,GAAG,MAAM,CAC7B,gCAAgC,CAAC,gBAAgB,CAAC,EAClD,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CACxC,CAAC;AAEF;;;;;MAKa,UAAU,GAAG,UAAU,CAAC,YAAY,EAAE;AAEnD;;;;;MAKa,gBAAgB,GAAG,UAAU,CAAC,kBAAkB,EAAE;AAE/D;;;;;MAKa,cAAc,GAAG,YAAY,CAAC,OAAO,EAAE;AAEpD;;;;;;MAMa,mBAAmB,GAAG,cAAc,CAC/C,UAAU,CAAC,qBAAqB,CAAC,EACjC,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,sBAAsB,EAClD;IACE,QAAQ,EAAE,kBAAkB;IAC5B,OAAO,EAAE;QACP,oBAAoB;QACpB,sBAAsB;QACtB,oBAAoB;QACpB,yBAAyB;QACzB,2BAA2B;KAC5B;CACF,EACD;AAEF;;;;;MAKa,sBAAsB,GAAG,qBAAqB,CAAC,OAAO,EAAE;AAErE;;;;;MAKa,kBAAkB,GAAG,qBAAqB,CAAC,UAAU,EAAE;AAEpE;;;;;;;;AAQA,SAAS,qBAAqB,CAAC,QAAiC;IAC9D,OAAO,MAAM,CACX,YAAY,CAAC,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,EAAE;QAC1E,MAAM,WAAW,GAAgB,OAAO,CAAC,QAAQ,CAAC,CAAC;QACnD,WAAW,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAkB,CAAC;QACjD,OAAO,WAAW,CAAC;KACpB,CAAC,EACF,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,OAAO,GAAG,QAAQ,CAAC,CACzD,CAAC;AACJ,CAAC;AAED;;;;;MAKa,aAAa,GAAG,YAAY,CAAC;IACxC,eAAe,EAAE;QACf,UAAU;KACX;IACD,cAAc,EAAE;QACd,gBAAgB;KACjB;IACD,WAAW,EAAE;QACX,8BAA8B;KAC/B;IACD,wBAAwB,EAAE;QACxB,8BAA8B;KAC/B;IACD,oBAAoB,EAAE;QACpB,mBAAmB;KACpB;IACD,qBAAqB,EAAE;QACrB,cAAc;KACf;IACD,qBAAqB,EAAE;QACrB,gBAAgB;KACjB;IACD,kBAAkB,EAAE;QAClB,sBAAsB;QACtB,sBAAsB;KACvB;IACD,0BAA0B,EAAE;QAC1B,kBAAkB;KACnB;IACD,uBAAuB,EAAE;QACvB,gCAAgC;KACjC;CACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.85",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -59,14 +59,13 @@
|
|
|
59
59
|
"cypress:open:component": "cypress open-ct"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@empathyco/x-adapter": "^7.0.0-alpha.
|
|
63
|
-
"@empathyco/x-deep-merge": "^1.3.0-alpha.
|
|
62
|
+
"@empathyco/x-adapter": "^7.0.0-alpha.24",
|
|
63
|
+
"@empathyco/x-deep-merge": "^1.3.0-alpha.12",
|
|
64
64
|
"@empathyco/x-logger": "^1.2.0-alpha.3",
|
|
65
65
|
"@empathyco/x-storage-service": "^2.0.0-alpha.2",
|
|
66
66
|
"@empathyco/x-types": "^10.0.0-alpha.20",
|
|
67
|
-
"@empathyco/x-utils": "^0.1.0-alpha.
|
|
67
|
+
"@empathyco/x-utils": "^0.1.0-alpha.11",
|
|
68
68
|
"@types/resize-observer-browser": "~0.1.5",
|
|
69
|
-
"nanoid": "~3.1.31",
|
|
70
69
|
"reflect-metadata": "~0.1.13",
|
|
71
70
|
"rxjs": "~7.4.0",
|
|
72
71
|
"tslib": "~2.3.0",
|
|
@@ -126,5 +125,5 @@
|
|
|
126
125
|
"access": "public",
|
|
127
126
|
"directory": "dist"
|
|
128
127
|
},
|
|
129
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "90698f80d05f4a7f60a759f740385fac76b66477"
|
|
130
129
|
}
|
|
@@ -10387,244 +10387,6 @@
|
|
|
10387
10387
|
}
|
|
10388
10388
|
]
|
|
10389
10389
|
},
|
|
10390
|
-
{
|
|
10391
|
-
"kind": "Class",
|
|
10392
|
-
"canonicalReference": "@empathyco/x-components!DefaultSessionService:class",
|
|
10393
|
-
"docComment": "/**\n * Default implementation for the {@link SessionService}.\n *\n * @public\n */\n",
|
|
10394
|
-
"excerptTokens": [
|
|
10395
|
-
{
|
|
10396
|
-
"kind": "Content",
|
|
10397
|
-
"text": "export declare class DefaultSessionService implements "
|
|
10398
|
-
},
|
|
10399
|
-
{
|
|
10400
|
-
"kind": "Reference",
|
|
10401
|
-
"text": "SessionService",
|
|
10402
|
-
"canonicalReference": "@empathyco/x-components!SessionService:interface"
|
|
10403
|
-
},
|
|
10404
|
-
{
|
|
10405
|
-
"kind": "Content",
|
|
10406
|
-
"text": " "
|
|
10407
|
-
}
|
|
10408
|
-
],
|
|
10409
|
-
"releaseTag": "Public",
|
|
10410
|
-
"name": "DefaultSessionService",
|
|
10411
|
-
"members": [
|
|
10412
|
-
{
|
|
10413
|
-
"kind": "Constructor",
|
|
10414
|
-
"canonicalReference": "@empathyco/x-components!DefaultSessionService:constructor(1)",
|
|
10415
|
-
"docComment": "/**\n * Constructs a new instance of the `DefaultSessionService` class\n */\n",
|
|
10416
|
-
"excerptTokens": [
|
|
10417
|
-
{
|
|
10418
|
-
"kind": "Content",
|
|
10419
|
-
"text": "constructor(storageService?: "
|
|
10420
|
-
},
|
|
10421
|
-
{
|
|
10422
|
-
"kind": "Reference",
|
|
10423
|
-
"text": "StorageService",
|
|
10424
|
-
"canonicalReference": "@empathyco/x-storage-service!StorageService:interface"
|
|
10425
|
-
},
|
|
10426
|
-
{
|
|
10427
|
-
"kind": "Content",
|
|
10428
|
-
"text": ", ttlMs?: "
|
|
10429
|
-
},
|
|
10430
|
-
{
|
|
10431
|
-
"kind": "Content",
|
|
10432
|
-
"text": "number"
|
|
10433
|
-
},
|
|
10434
|
-
{
|
|
10435
|
-
"kind": "Content",
|
|
10436
|
-
"text": ");"
|
|
10437
|
-
}
|
|
10438
|
-
],
|
|
10439
|
-
"releaseTag": "Public",
|
|
10440
|
-
"overloadIndex": 1,
|
|
10441
|
-
"parameters": [
|
|
10442
|
-
{
|
|
10443
|
-
"parameterName": "storageService",
|
|
10444
|
-
"parameterTypeTokenRange": {
|
|
10445
|
-
"startIndex": 1,
|
|
10446
|
-
"endIndex": 2
|
|
10447
|
-
},
|
|
10448
|
-
"isOptional": true
|
|
10449
|
-
},
|
|
10450
|
-
{
|
|
10451
|
-
"parameterName": "ttlMs",
|
|
10452
|
-
"parameterTypeTokenRange": {
|
|
10453
|
-
"startIndex": 3,
|
|
10454
|
-
"endIndex": 4
|
|
10455
|
-
},
|
|
10456
|
-
"isOptional": true
|
|
10457
|
-
}
|
|
10458
|
-
]
|
|
10459
|
-
},
|
|
10460
|
-
{
|
|
10461
|
-
"kind": "Method",
|
|
10462
|
-
"canonicalReference": "@empathyco/x-components!DefaultSessionService#clearSessionId:member(1)",
|
|
10463
|
-
"docComment": "/**\n * Removes the session if from the storage.\n *\n * @public\n */\n",
|
|
10464
|
-
"excerptTokens": [
|
|
10465
|
-
{
|
|
10466
|
-
"kind": "Content",
|
|
10467
|
-
"text": "clearSessionId(): "
|
|
10468
|
-
},
|
|
10469
|
-
{
|
|
10470
|
-
"kind": "Content",
|
|
10471
|
-
"text": "void"
|
|
10472
|
-
},
|
|
10473
|
-
{
|
|
10474
|
-
"kind": "Content",
|
|
10475
|
-
"text": ";"
|
|
10476
|
-
}
|
|
10477
|
-
],
|
|
10478
|
-
"isOptional": false,
|
|
10479
|
-
"isStatic": false,
|
|
10480
|
-
"returnTypeTokenRange": {
|
|
10481
|
-
"startIndex": 1,
|
|
10482
|
-
"endIndex": 2
|
|
10483
|
-
},
|
|
10484
|
-
"releaseTag": "Public",
|
|
10485
|
-
"overloadIndex": 1,
|
|
10486
|
-
"parameters": [],
|
|
10487
|
-
"name": "clearSessionId"
|
|
10488
|
-
},
|
|
10489
|
-
{
|
|
10490
|
-
"kind": "Method",
|
|
10491
|
-
"canonicalReference": "@empathyco/x-components!DefaultSessionService#getSessionId:member(1)",
|
|
10492
|
-
"docComment": "/**\n * Returns the session id of the storage.\n *\n * @returns The current session id.\n *\n * @public\n */\n",
|
|
10493
|
-
"excerptTokens": [
|
|
10494
|
-
{
|
|
10495
|
-
"kind": "Content",
|
|
10496
|
-
"text": "getSessionId(): "
|
|
10497
|
-
},
|
|
10498
|
-
{
|
|
10499
|
-
"kind": "Content",
|
|
10500
|
-
"text": "string"
|
|
10501
|
-
},
|
|
10502
|
-
{
|
|
10503
|
-
"kind": "Content",
|
|
10504
|
-
"text": ";"
|
|
10505
|
-
}
|
|
10506
|
-
],
|
|
10507
|
-
"isOptional": false,
|
|
10508
|
-
"isStatic": false,
|
|
10509
|
-
"returnTypeTokenRange": {
|
|
10510
|
-
"startIndex": 1,
|
|
10511
|
-
"endIndex": 2
|
|
10512
|
-
},
|
|
10513
|
-
"releaseTag": "Public",
|
|
10514
|
-
"overloadIndex": 1,
|
|
10515
|
-
"parameters": [],
|
|
10516
|
-
"name": "getSessionId"
|
|
10517
|
-
},
|
|
10518
|
-
{
|
|
10519
|
-
"kind": "Property",
|
|
10520
|
-
"canonicalReference": "@empathyco/x-components!DefaultSessionService.instance:member",
|
|
10521
|
-
"docComment": "/**\n * Global instance of the {@link SessionService}.\n */\n",
|
|
10522
|
-
"excerptTokens": [
|
|
10523
|
-
{
|
|
10524
|
-
"kind": "Content",
|
|
10525
|
-
"text": "static instance: "
|
|
10526
|
-
},
|
|
10527
|
-
{
|
|
10528
|
-
"kind": "Reference",
|
|
10529
|
-
"text": "SessionService",
|
|
10530
|
-
"canonicalReference": "@empathyco/x-components!SessionService:interface"
|
|
10531
|
-
},
|
|
10532
|
-
{
|
|
10533
|
-
"kind": "Content",
|
|
10534
|
-
"text": ";"
|
|
10535
|
-
}
|
|
10536
|
-
],
|
|
10537
|
-
"isOptional": false,
|
|
10538
|
-
"releaseTag": "Public",
|
|
10539
|
-
"name": "instance",
|
|
10540
|
-
"propertyTypeTokenRange": {
|
|
10541
|
-
"startIndex": 1,
|
|
10542
|
-
"endIndex": 2
|
|
10543
|
-
},
|
|
10544
|
-
"isStatic": true
|
|
10545
|
-
},
|
|
10546
|
-
{
|
|
10547
|
-
"kind": "Property",
|
|
10548
|
-
"canonicalReference": "@empathyco/x-components!DefaultSessionService.SESSION_ID_KEY:member",
|
|
10549
|
-
"docComment": "/**\n * Session id key to use as key in the storage.\n *\n * @public\n */\n",
|
|
10550
|
-
"excerptTokens": [
|
|
10551
|
-
{
|
|
10552
|
-
"kind": "Content",
|
|
10553
|
-
"text": "static readonly SESSION_ID_KEY = \"session-id\";"
|
|
10554
|
-
}
|
|
10555
|
-
],
|
|
10556
|
-
"isOptional": false,
|
|
10557
|
-
"releaseTag": "Public",
|
|
10558
|
-
"name": "SESSION_ID_KEY",
|
|
10559
|
-
"propertyTypeTokenRange": {
|
|
10560
|
-
"startIndex": 0,
|
|
10561
|
-
"endIndex": 0
|
|
10562
|
-
},
|
|
10563
|
-
"isStatic": true
|
|
10564
|
-
},
|
|
10565
|
-
{
|
|
10566
|
-
"kind": "Property",
|
|
10567
|
-
"canonicalReference": "@empathyco/x-components!DefaultSessionService#storageService:member",
|
|
10568
|
-
"docComment": "",
|
|
10569
|
-
"excerptTokens": [
|
|
10570
|
-
{
|
|
10571
|
-
"kind": "Content",
|
|
10572
|
-
"text": "protected storageService: "
|
|
10573
|
-
},
|
|
10574
|
-
{
|
|
10575
|
-
"kind": "Reference",
|
|
10576
|
-
"text": "StorageService",
|
|
10577
|
-
"canonicalReference": "@empathyco/x-storage-service!StorageService:interface"
|
|
10578
|
-
},
|
|
10579
|
-
{
|
|
10580
|
-
"kind": "Content",
|
|
10581
|
-
"text": ";"
|
|
10582
|
-
}
|
|
10583
|
-
],
|
|
10584
|
-
"isOptional": false,
|
|
10585
|
-
"releaseTag": "Public",
|
|
10586
|
-
"name": "storageService",
|
|
10587
|
-
"propertyTypeTokenRange": {
|
|
10588
|
-
"startIndex": 1,
|
|
10589
|
-
"endIndex": 2
|
|
10590
|
-
},
|
|
10591
|
-
"isStatic": false
|
|
10592
|
-
},
|
|
10593
|
-
{
|
|
10594
|
-
"kind": "Property",
|
|
10595
|
-
"canonicalReference": "@empathyco/x-components!DefaultSessionService#ttlMs:member",
|
|
10596
|
-
"docComment": "",
|
|
10597
|
-
"excerptTokens": [
|
|
10598
|
-
{
|
|
10599
|
-
"kind": "Content",
|
|
10600
|
-
"text": "protected ttlMs: "
|
|
10601
|
-
},
|
|
10602
|
-
{
|
|
10603
|
-
"kind": "Content",
|
|
10604
|
-
"text": "number"
|
|
10605
|
-
},
|
|
10606
|
-
{
|
|
10607
|
-
"kind": "Content",
|
|
10608
|
-
"text": ";"
|
|
10609
|
-
}
|
|
10610
|
-
],
|
|
10611
|
-
"isOptional": false,
|
|
10612
|
-
"releaseTag": "Public",
|
|
10613
|
-
"name": "ttlMs",
|
|
10614
|
-
"propertyTypeTokenRange": {
|
|
10615
|
-
"startIndex": 1,
|
|
10616
|
-
"endIndex": 2
|
|
10617
|
-
},
|
|
10618
|
-
"isStatic": false
|
|
10619
|
-
}
|
|
10620
|
-
],
|
|
10621
|
-
"implementsTokenRanges": [
|
|
10622
|
-
{
|
|
10623
|
-
"startIndex": 1,
|
|
10624
|
-
"endIndex": 3
|
|
10625
|
-
}
|
|
10626
|
-
]
|
|
10627
|
-
},
|
|
10628
10390
|
{
|
|
10629
10391
|
"kind": "Interface",
|
|
10630
10392
|
"canonicalReference": "@empathyco/x-components!DeviceActions:interface",
|
|
@@ -39669,78 +39431,6 @@
|
|
|
39669
39431
|
"endIndex": 3
|
|
39670
39432
|
}
|
|
39671
39433
|
},
|
|
39672
|
-
{
|
|
39673
|
-
"kind": "Interface",
|
|
39674
|
-
"canonicalReference": "@empathyco/x-components!SessionService:interface",
|
|
39675
|
-
"docComment": "/**\n * Service to manage the session id.\n *\n * @public\n */\n",
|
|
39676
|
-
"excerptTokens": [
|
|
39677
|
-
{
|
|
39678
|
-
"kind": "Content",
|
|
39679
|
-
"text": "export interface SessionService "
|
|
39680
|
-
}
|
|
39681
|
-
],
|
|
39682
|
-
"releaseTag": "Public",
|
|
39683
|
-
"name": "SessionService",
|
|
39684
|
-
"members": [
|
|
39685
|
-
{
|
|
39686
|
-
"kind": "MethodSignature",
|
|
39687
|
-
"canonicalReference": "@empathyco/x-components!SessionService#clearSessionId:member(1)",
|
|
39688
|
-
"docComment": "/**\n * Remove the session id.\n */\n",
|
|
39689
|
-
"excerptTokens": [
|
|
39690
|
-
{
|
|
39691
|
-
"kind": "Content",
|
|
39692
|
-
"text": "clearSessionId(): "
|
|
39693
|
-
},
|
|
39694
|
-
{
|
|
39695
|
-
"kind": "Content",
|
|
39696
|
-
"text": "void"
|
|
39697
|
-
},
|
|
39698
|
-
{
|
|
39699
|
-
"kind": "Content",
|
|
39700
|
-
"text": ";"
|
|
39701
|
-
}
|
|
39702
|
-
],
|
|
39703
|
-
"isOptional": false,
|
|
39704
|
-
"returnTypeTokenRange": {
|
|
39705
|
-
"startIndex": 1,
|
|
39706
|
-
"endIndex": 2
|
|
39707
|
-
},
|
|
39708
|
-
"releaseTag": "Public",
|
|
39709
|
-
"overloadIndex": 1,
|
|
39710
|
-
"parameters": [],
|
|
39711
|
-
"name": "clearSessionId"
|
|
39712
|
-
},
|
|
39713
|
-
{
|
|
39714
|
-
"kind": "MethodSignature",
|
|
39715
|
-
"canonicalReference": "@empathyco/x-components!SessionService#getSessionId:member(1)",
|
|
39716
|
-
"docComment": "/**\n * Gets the current session id from the storage.\n *\n * @remarks\n *\n * If a session id is outdated or does not exist, a new one is created.\n *\n * @returns The session id.\n */\n",
|
|
39717
|
-
"excerptTokens": [
|
|
39718
|
-
{
|
|
39719
|
-
"kind": "Content",
|
|
39720
|
-
"text": "getSessionId(): "
|
|
39721
|
-
},
|
|
39722
|
-
{
|
|
39723
|
-
"kind": "Content",
|
|
39724
|
-
"text": "string"
|
|
39725
|
-
},
|
|
39726
|
-
{
|
|
39727
|
-
"kind": "Content",
|
|
39728
|
-
"text": ";"
|
|
39729
|
-
}
|
|
39730
|
-
],
|
|
39731
|
-
"isOptional": false,
|
|
39732
|
-
"returnTypeTokenRange": {
|
|
39733
|
-
"startIndex": 1,
|
|
39734
|
-
"endIndex": 2
|
|
39735
|
-
},
|
|
39736
|
-
"releaseTag": "Public",
|
|
39737
|
-
"overloadIndex": 1,
|
|
39738
|
-
"parameters": [],
|
|
39739
|
-
"name": "getSessionId"
|
|
39740
|
-
}
|
|
39741
|
-
],
|
|
39742
|
-
"extendsTokenRanges": []
|
|
39743
|
-
},
|
|
39744
39434
|
{
|
|
39745
39435
|
"kind": "Variable",
|
|
39746
39436
|
"canonicalReference": "@empathyco/x-components!setConsent:var",
|
|
@@ -983,19 +983,6 @@ export class DefaultPDPAddToCartService implements PDPAddToCartService {
|
|
|
983
983
|
trackAddToCart(id?: string): void;
|
|
984
984
|
}
|
|
985
985
|
|
|
986
|
-
// @public
|
|
987
|
-
export class DefaultSessionService implements SessionService {
|
|
988
|
-
constructor(storageService?: StorageService, ttlMs?: number);
|
|
989
|
-
clearSessionId(): void;
|
|
990
|
-
getSessionId(): string;
|
|
991
|
-
static instance: SessionService;
|
|
992
|
-
static readonly SESSION_ID_KEY = "session-id";
|
|
993
|
-
// (undocumented)
|
|
994
|
-
protected storageService: StorageService;
|
|
995
|
-
// (undocumented)
|
|
996
|
-
protected ttlMs: number;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
986
|
// @public
|
|
1000
987
|
export interface DeviceActions {
|
|
1001
988
|
}
|
|
@@ -3724,12 +3711,6 @@ export class SelectedFiltersList extends FacetsMixin {
|
|
|
3724
3711
|
// @public
|
|
3725
3712
|
export const sessionHistoryQueries: HistoryQueriesXStoreModule['getters']['sessionHistoryQueries'];
|
|
3726
3713
|
|
|
3727
|
-
// @public
|
|
3728
|
-
export interface SessionService {
|
|
3729
|
-
clearSessionId(): void;
|
|
3730
|
-
getSessionId(): string;
|
|
3731
|
-
}
|
|
3732
|
-
|
|
3733
3714
|
// @public
|
|
3734
3715
|
export const setConsent: Wire<boolean>;
|
|
3735
3716
|
|
package/tagging/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { default as Tagging } from '../js/x-modules/tagging/components/tagging.vue.js';
|
|
2
2
|
export { DefaultPDPAddToCartService } from '../js/x-modules/tagging/service/pdp-add-to-cart.service.js';
|
|
3
|
-
export { DefaultSessionService } from '../js/x-modules/tagging/service/session.service.js';
|
|
4
3
|
export { track } from '../js/x-modules/tagging/store/actions/track.action.js';
|
|
5
4
|
export { taggingEmitters } from '../js/x-modules/tagging/store/emitters.js';
|
|
6
5
|
export { taggingXStoreModule } from '../js/x-modules/tagging/store/module.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/tagging/service/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/tagging/service/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
import { Result } from '@empathyco/x-types';
|
|
2
|
-
/**
|
|
3
|
-
* Service to manage the session id.
|
|
4
|
-
*
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export interface SessionService {
|
|
8
|
-
/**
|
|
9
|
-
* Gets the current session id from the storage.
|
|
10
|
-
*
|
|
11
|
-
* @remarks If a session id is outdated or does not exist,
|
|
12
|
-
* a new one is created.
|
|
13
|
-
*
|
|
14
|
-
* @returns The session id.
|
|
15
|
-
*/
|
|
16
|
-
getSessionId(): string;
|
|
17
|
-
/**
|
|
18
|
-
* Remove the session id.
|
|
19
|
-
*/
|
|
20
|
-
clearSessionId(): void;
|
|
21
|
-
}
|
|
22
2
|
/**
|
|
23
3
|
* Service to handle the workflow for tracking add to cart from PDP.
|
|
24
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/tagging/service/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/tagging/service/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/tagging/wiring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/tagging/wiring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AASzD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AA4EjD;;;;GAIG;AACH,eAAO,MAAM,UAAU,eAA2B,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,8CAAiC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,mCAAwB,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,mBAa/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,cAAiC,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,cAAoC,CAAC;AAqBpE;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCxB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultSessionService](./x-components.defaultsessionservice.md) > [(constructor)](./x-components.defaultsessionservice._constructor_.md)
|
|
4
|
-
|
|
5
|
-
## DefaultSessionService.(constructor)
|
|
6
|
-
|
|
7
|
-
Constructs a new instance of the `DefaultSessionService` class
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
constructor(storageService?: StorageService, ttlMs?: number);
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
| Parameter | Type | Description |
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| storageService | StorageService | |
|
|
20
|
-
| ttlMs | number | |
|
|
21
|
-
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultSessionService](./x-components.defaultsessionservice.md) > [clearSessionId](./x-components.defaultsessionservice.clearsessionid.md)
|
|
4
|
-
|
|
5
|
-
## DefaultSessionService.clearSessionId() method
|
|
6
|
-
|
|
7
|
-
Removes the session if from the storage.
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
clearSessionId(): void;
|
|
13
|
-
```
|
|
14
|
-
<b>Returns:</b>
|
|
15
|
-
|
|
16
|
-
void
|
|
17
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultSessionService](./x-components.defaultsessionservice.md) > [getSessionId](./x-components.defaultsessionservice.getsessionid.md)
|
|
4
|
-
|
|
5
|
-
## DefaultSessionService.getSessionId() method
|
|
6
|
-
|
|
7
|
-
Returns the session id of the storage.
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
getSessionId(): string;
|
|
13
|
-
```
|
|
14
|
-
<b>Returns:</b>
|
|
15
|
-
|
|
16
|
-
string
|
|
17
|
-
|
|
18
|
-
The current session id.
|
|
19
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultSessionService](./x-components.defaultsessionservice.md) > [instance](./x-components.defaultsessionservice.instance.md)
|
|
4
|
-
|
|
5
|
-
## DefaultSessionService.instance property
|
|
6
|
-
|
|
7
|
-
Global instance of the [SessionService](./x-components.sessionservice.md)<!-- -->.
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
static instance: SessionService;
|
|
13
|
-
```
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultSessionService](./x-components.defaultsessionservice.md)
|
|
4
|
-
|
|
5
|
-
## DefaultSessionService class
|
|
6
|
-
|
|
7
|
-
Default implementation for the [SessionService](./x-components.sessionservice.md)<!-- -->.
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare class DefaultSessionService implements SessionService
|
|
13
|
-
```
|
|
14
|
-
<b>Implements:</b> [SessionService](./x-components.sessionservice.md)
|
|
15
|
-
|
|
16
|
-
## Constructors
|
|
17
|
-
|
|
18
|
-
| Constructor | Modifiers | Description |
|
|
19
|
-
| --- | --- | --- |
|
|
20
|
-
| [(constructor)(storageService, ttlMs)](./x-components.defaultsessionservice._constructor_.md) | | Constructs a new instance of the <code>DefaultSessionService</code> class |
|
|
21
|
-
|
|
22
|
-
## Properties
|
|
23
|
-
|
|
24
|
-
| Property | Modifiers | Type | Description |
|
|
25
|
-
| --- | --- | --- | --- |
|
|
26
|
-
| [instance](./x-components.defaultsessionservice.instance.md) | <code>static</code> | [SessionService](./x-components.sessionservice.md) | Global instance of the [SessionService](./x-components.sessionservice.md)<!-- -->. |
|
|
27
|
-
| [SESSION\_ID\_KEY](./x-components.defaultsessionservice.session_id_key.md) | <code>static</code> | (not declared) | Session id key to use as key in the storage. |
|
|
28
|
-
| [storageService](./x-components.defaultsessionservice.storageservice.md) | | StorageService | |
|
|
29
|
-
| [ttlMs](./x-components.defaultsessionservice.ttlms.md) | | number | |
|
|
30
|
-
|
|
31
|
-
## Methods
|
|
32
|
-
|
|
33
|
-
| Method | Modifiers | Description |
|
|
34
|
-
| --- | --- | --- |
|
|
35
|
-
| [clearSessionId()](./x-components.defaultsessionservice.clearsessionid.md) | | Removes the session if from the storage. |
|
|
36
|
-
| [getSessionId()](./x-components.defaultsessionservice.getsessionid.md) | | Returns the session id of the storage. |
|
|
37
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultSessionService](./x-components.defaultsessionservice.md) > [SESSION\_ID\_KEY](./x-components.defaultsessionservice.session_id_key.md)
|
|
4
|
-
|
|
5
|
-
## DefaultSessionService.SESSION\_ID\_KEY property
|
|
6
|
-
|
|
7
|
-
Session id key to use as key in the storage.
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
static readonly SESSION_ID_KEY = "session-id";
|
|
13
|
-
```
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultSessionService](./x-components.defaultsessionservice.md) > [storageService](./x-components.defaultsessionservice.storageservice.md)
|
|
4
|
-
|
|
5
|
-
## DefaultSessionService.storageService property
|
|
6
|
-
|
|
7
|
-
<b>Signature:</b>
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
protected storageService: StorageService;
|
|
11
|
-
```
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [DefaultSessionService](./x-components.defaultsessionservice.md) > [ttlMs](./x-components.defaultsessionservice.ttlms.md)
|
|
4
|
-
|
|
5
|
-
## DefaultSessionService.ttlMs property
|
|
6
|
-
|
|
7
|
-
<b>Signature:</b>
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
protected ttlMs: number;
|
|
11
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [SessionService](./x-components.sessionservice.md) > [clearSessionId](./x-components.sessionservice.clearsessionid.md)
|
|
4
|
-
|
|
5
|
-
## SessionService.clearSessionId() method
|
|
6
|
-
|
|
7
|
-
Remove the session id.
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
clearSessionId(): void;
|
|
13
|
-
```
|
|
14
|
-
<b>Returns:</b>
|
|
15
|
-
|
|
16
|
-
void
|
|
17
|
-
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [SessionService](./x-components.sessionservice.md) > [getSessionId](./x-components.sessionservice.getsessionid.md)
|
|
4
|
-
|
|
5
|
-
## SessionService.getSessionId() method
|
|
6
|
-
|
|
7
|
-
Gets the current session id from the storage.
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
getSessionId(): string;
|
|
13
|
-
```
|
|
14
|
-
<b>Returns:</b>
|
|
15
|
-
|
|
16
|
-
string
|
|
17
|
-
|
|
18
|
-
The session id.
|
|
19
|
-
|
|
20
|
-
## Remarks
|
|
21
|
-
|
|
22
|
-
If a session id is outdated or does not exist, a new one is created.
|
|
23
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [SessionService](./x-components.sessionservice.md)
|
|
4
|
-
|
|
5
|
-
## SessionService interface
|
|
6
|
-
|
|
7
|
-
Service to manage the session id.
|
|
8
|
-
|
|
9
|
-
<b>Signature:</b>
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export interface SessionService
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Methods
|
|
16
|
-
|
|
17
|
-
| Method | Description |
|
|
18
|
-
| --- | --- |
|
|
19
|
-
| [clearSessionId()](./x-components.sessionservice.clearsessionid.md) | Remove the session id. |
|
|
20
|
-
| [getSessionId()](./x-components.sessionservice.getsessionid.md) | Gets the current session id from the storage. |
|
|
21
|
-
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { nanoid } from 'nanoid';
|
|
2
|
-
import { BrowserStorageService } from '@empathyco/x-storage-service';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Default implementation for the {@link SessionService}.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
class DefaultSessionService {
|
|
10
|
-
constructor(storageService = new BrowserStorageService(localStorage, 'x'), ttlMs = 1800000 // 30m * 60s * 1000 = 1800_000ms
|
|
11
|
-
) {
|
|
12
|
-
this.storageService = storageService;
|
|
13
|
-
this.ttlMs = ttlMs;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Returns the session id of the storage.
|
|
17
|
-
*
|
|
18
|
-
* @returns The current session id.
|
|
19
|
-
*
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
getSessionId() {
|
|
23
|
-
const sessionId = this.storageService.getItem(DefaultSessionService.SESSION_ID_KEY) ?? nanoid();
|
|
24
|
-
this.storageService.setItem(DefaultSessionService.SESSION_ID_KEY, sessionId, Date.now() + this.ttlMs);
|
|
25
|
-
return sessionId;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Removes the session if from the storage.
|
|
29
|
-
*
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
clearSessionId() {
|
|
33
|
-
this.storageService.removeItem(DefaultSessionService.SESSION_ID_KEY);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Session id key to use as key in the storage.
|
|
38
|
-
*
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
DefaultSessionService.SESSION_ID_KEY = 'session-id';
|
|
42
|
-
/**
|
|
43
|
-
* Global instance of the {@link SessionService}.
|
|
44
|
-
*/
|
|
45
|
-
DefaultSessionService.instance = new DefaultSessionService();
|
|
46
|
-
|
|
47
|
-
export { DefaultSessionService };
|
|
48
|
-
//# sourceMappingURL=session.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.service.js","sources":["../../../../../src/x-modules/tagging/service/session.service.ts"],"sourcesContent":["import { nanoid } from 'nanoid';\nimport { BrowserStorageService, StorageService } from '@empathyco/x-storage-service';\nimport { SessionService } from './types';\n\n/**\n * Default implementation for the {@link SessionService}.\n *\n * @public\n */\nexport class DefaultSessionService implements SessionService {\n /**\n * Session id key to use as key in the storage.\n *\n * @public\n */\n public static readonly SESSION_ID_KEY = 'session-id';\n\n /**\n * Global instance of the {@link SessionService}.\n */\n public static instance: SessionService = new DefaultSessionService();\n\n public constructor(\n protected storageService: StorageService = new BrowserStorageService(localStorage, 'x'),\n protected ttlMs = 1800000 // 30m * 60s * 1000 = 1800_000ms\n ) {}\n\n /**\n * Returns the session id of the storage.\n *\n * @returns The current session id.\n *\n * @public\n */\n getSessionId(): string {\n const sessionId = this.storageService.getItem(DefaultSessionService.SESSION_ID_KEY) ?? nanoid();\n this.storageService.setItem(\n DefaultSessionService.SESSION_ID_KEY,\n sessionId,\n Date.now() + this.ttlMs\n );\n return sessionId;\n }\n\n /**\n * Removes the session if from the storage.\n *\n * @public\n */\n clearSessionId(): void {\n this.storageService.removeItem(DefaultSessionService.SESSION_ID_KEY);\n }\n}\n"],"names":[],"mappings":";;;AAIA;;;;;MAKa,qBAAqB;IAahC,YACY,iBAAiC,IAAI,qBAAqB,CAAC,YAAY,EAAE,GAAG,CAAC,EAC7E,QAAQ,OAAO;;QADf,mBAAc,GAAd,cAAc,CAA+D;QAC7E,UAAK,GAAL,KAAK,CAAU;KACvB;;;;;;;;IASJ,YAAY;QACV,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,qBAAqB,CAAC,cAAc,CAAC,IAAI,MAAM,EAAE,CAAC;QAChG,IAAI,CAAC,cAAc,CAAC,OAAO,CACzB,qBAAqB,CAAC,cAAc,EACpC,SAAS,EACT,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CACxB,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;;;;;;IAOD,cAAc;QACZ,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAC;KACtE;;AAzCD;;;;;AAKuB,oCAAc,GAAG,YAAY,CAAC;AAErD;;;AAGc,8BAAQ,GAAmB,IAAI,qBAAqB,EAAE;;;;"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { StorageService } from '@empathyco/x-storage-service';
|
|
2
|
-
import { SessionService } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Default implementation for the {@link SessionService}.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export declare class DefaultSessionService implements SessionService {
|
|
9
|
-
protected storageService: StorageService;
|
|
10
|
-
protected ttlMs: number;
|
|
11
|
-
/**
|
|
12
|
-
* Session id key to use as key in the storage.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
static readonly SESSION_ID_KEY = "session-id";
|
|
17
|
-
/**
|
|
18
|
-
* Global instance of the {@link SessionService}.
|
|
19
|
-
*/
|
|
20
|
-
static instance: SessionService;
|
|
21
|
-
constructor(storageService?: StorageService, ttlMs?: number);
|
|
22
|
-
/**
|
|
23
|
-
* Returns the session id of the storage.
|
|
24
|
-
*
|
|
25
|
-
* @returns The current session id.
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
getSessionId(): string;
|
|
30
|
-
/**
|
|
31
|
-
* Removes the session if from the storage.
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
35
|
-
clearSessionId(): void;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=session.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.service.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/tagging/service/session.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,cAAc;IAcxD,SAAS,CAAC,cAAc,EAAE,cAAc;IACxC,SAAS,CAAC,KAAK;IAdjB;;;;OAIG;IACH,gBAAuB,cAAc,gBAAgB;IAErD;;OAEG;IACH,OAAc,QAAQ,EAAE,cAAc,CAA+B;gBAGzD,cAAc,GAAE,cAA6D,EAC7E,KAAK,SAAU;IAG3B;;;;;;OAMG;IACH,YAAY,IAAI,MAAM;IAUtB;;;;OAIG;IACH,cAAc,IAAI,IAAI;CAGvB"}
|