@sunbird-cb/utils 1.0.5 → 1.0.6
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/bundles/sunbird-cb-utils.umd.js +32 -27
- package/bundles/sunbird-cb-utils.umd.js.map +1 -1
- package/bundles/sunbird-cb-utils.umd.min.js +1 -1
- package/bundles/sunbird-cb-utils.umd.min.js.map +1 -1
- package/esm2015/lib/services/event.model.js +13 -7
- package/esm2015/lib/services/event.service.js +9 -8
- package/esm2015/lib/services/telemetry.service.js +13 -15
- package/esm5/lib/services/event.model.js +13 -7
- package/esm5/lib/services/event.service.js +9 -8
- package/esm5/lib/services/telemetry.service.js +13 -15
- package/fesm2015/sunbird-cb-utils.js +32 -27
- package/fesm2015/sunbird-cb-utils.js.map +1 -1
- package/fesm5/sunbird-cb-utils.js +32 -27
- package/fesm5/sunbird-cb-utils.js.map +1 -1
- package/lib/services/event.model.d.ts +11 -7
- package/lib/services/event.service.d.ts +2 -2
- package/lib/services/telemetry.service.d.ts +2 -2
- package/package.json +1 -1
- package/sunbird-cb-utils.metadata.json +1 -1
|
@@ -4038,6 +4038,14 @@
|
|
|
4038
4038
|
ITelemetryContext.prototype.module;
|
|
4039
4039
|
ITelemetryContext.prototype.pageIdExt;
|
|
4040
4040
|
}
|
|
4041
|
+
function ITelemetryEdata() { }
|
|
4042
|
+
WsEvents.ITelemetryEdata = ITelemetryEdata;
|
|
4043
|
+
if (false) {
|
|
4044
|
+
ITelemetryEdata.prototype.type;
|
|
4045
|
+
ITelemetryEdata.prototype.subType;
|
|
4046
|
+
ITelemetryEdata.prototype.id;
|
|
4047
|
+
ITelemetryEdata.prototype.pageid;
|
|
4048
|
+
}
|
|
4041
4049
|
function ITelemetryTabData() { }
|
|
4042
4050
|
WsEvents.ITelemetryTabData = ITelemetryTabData;
|
|
4043
4051
|
if (false) {
|
|
@@ -4070,24 +4078,21 @@
|
|
|
4070
4078
|
function IWsEventTelemetryInteract() { }
|
|
4071
4079
|
WsEvents.IWsEventTelemetryInteract = IWsEventTelemetryInteract;
|
|
4072
4080
|
if (false) {
|
|
4073
|
-
IWsEventTelemetryInteract.prototype.
|
|
4074
|
-
IWsEventTelemetryInteract.prototype.subType;
|
|
4081
|
+
IWsEventTelemetryInteract.prototype.edata;
|
|
4075
4082
|
IWsEventTelemetryInteract.prototype.object;
|
|
4076
4083
|
IWsEventTelemetryInteract.prototype.context;
|
|
4077
4084
|
}
|
|
4078
4085
|
function IWsEventTelemetryFeedback() { }
|
|
4079
4086
|
WsEvents.IWsEventTelemetryFeedback = IWsEventTelemetryFeedback;
|
|
4080
4087
|
if (false) {
|
|
4081
|
-
IWsEventTelemetryFeedback.prototype.
|
|
4082
|
-
IWsEventTelemetryFeedback.prototype.subType;
|
|
4088
|
+
IWsEventTelemetryFeedback.prototype.edata;
|
|
4083
4089
|
IWsEventTelemetryFeedback.prototype.object;
|
|
4084
4090
|
IWsEventTelemetryFeedback.prototype.context;
|
|
4085
4091
|
}
|
|
4086
4092
|
function IWsEventTelemetryImpression() { }
|
|
4087
4093
|
WsEvents.IWsEventTelemetryImpression = IWsEventTelemetryImpression;
|
|
4088
4094
|
if (false) {
|
|
4089
|
-
IWsEventTelemetryImpression.prototype.
|
|
4090
|
-
IWsEventTelemetryImpression.prototype.subType;
|
|
4095
|
+
IWsEventTelemetryImpression.prototype.edata;
|
|
4091
4096
|
IWsEventTelemetryImpression.prototype.object;
|
|
4092
4097
|
IWsEventTelemetryImpression.prototype.context;
|
|
4093
4098
|
}
|
|
@@ -4169,6 +4174,7 @@
|
|
|
4169
4174
|
EnumInteractSubTypes["COURSE_TAB"] = "course-tab";
|
|
4170
4175
|
EnumInteractSubTypes["CAREER_TAB"] = "career-tab";
|
|
4171
4176
|
EnumInteractSubTypes["PROFILE_EDIT_TAB"] = "profile-edit-tab";
|
|
4177
|
+
EnumInteractSubTypes["SIDE_MENU"] = "side-menu";
|
|
4172
4178
|
})(EnumInteractSubTypes = WsEvents.EnumInteractSubTypes || (WsEvents.EnumInteractSubTypes = {}));
|
|
4173
4179
|
})(exports.WsEvents || (exports.WsEvents = {}));
|
|
4174
4180
|
|
|
@@ -4181,13 +4187,12 @@
|
|
|
4181
4187
|
EventService.prototype.dispatchEvent = function (event) {
|
|
4182
4188
|
this.eventsSubject.next(event);
|
|
4183
4189
|
};
|
|
4184
|
-
EventService.prototype.raiseInteractTelemetry = function (
|
|
4190
|
+
EventService.prototype.raiseInteractTelemetry = function (edata, object, context) {
|
|
4185
4191
|
this.dispatchEvent({
|
|
4186
4192
|
eventType: exports.WsEvents.WsEventType.Telemetry,
|
|
4187
4193
|
eventLogLevel: exports.WsEvents.WsEventLogLevel.Info,
|
|
4188
4194
|
data: {
|
|
4189
|
-
|
|
4190
|
-
subType: subType,
|
|
4195
|
+
edata: edata,
|
|
4191
4196
|
object: object,
|
|
4192
4197
|
context: this.getContext(context),
|
|
4193
4198
|
eventSubType: exports.WsEvents.EnumTelemetrySubType.Interact,
|
|
@@ -4196,13 +4201,12 @@
|
|
|
4196
4201
|
to: 'Telemetry',
|
|
4197
4202
|
});
|
|
4198
4203
|
};
|
|
4199
|
-
EventService.prototype.raiseFeedbackTelemetry = function (
|
|
4204
|
+
EventService.prototype.raiseFeedbackTelemetry = function (edata, object, from) {
|
|
4200
4205
|
this.dispatchEvent({
|
|
4201
4206
|
eventType: exports.WsEvents.WsEventType.Telemetry,
|
|
4202
4207
|
eventLogLevel: exports.WsEvents.WsEventLogLevel.Info,
|
|
4203
4208
|
data: {
|
|
4204
|
-
|
|
4205
|
-
subType: subType,
|
|
4209
|
+
edata: edata,
|
|
4206
4210
|
object: object,
|
|
4207
4211
|
eventSubType: exports.WsEvents.EnumTelemetrySubType.Feedback,
|
|
4208
4212
|
},
|
|
@@ -4242,7 +4246,10 @@
|
|
|
4242
4246
|
return finalContext;
|
|
4243
4247
|
};
|
|
4244
4248
|
EventService.prototype.handleTabTelemetry = function (subType, data) {
|
|
4245
|
-
this.raiseInteractTelemetry(
|
|
4249
|
+
this.raiseInteractTelemetry({
|
|
4250
|
+
subType: subType,
|
|
4251
|
+
type: exports.WsEvents.EnumInteractTypes.CLICK,
|
|
4252
|
+
}, {
|
|
4246
4253
|
id: "" + ___default.camelCase(data.label),
|
|
4247
4254
|
context: {
|
|
4248
4255
|
position: data.index,
|
|
@@ -4483,7 +4490,7 @@
|
|
|
4483
4490
|
}
|
|
4484
4491
|
|
|
4485
4492
|
var TelemetryService = (function () {
|
|
4486
|
-
function TelemetryService(
|
|
4493
|
+
function TelemetryService(configSvc, eventsSvc, logger, environment) {
|
|
4487
4494
|
this.configSvc = configSvc;
|
|
4488
4495
|
this.eventsSvc = eventsSvc;
|
|
4489
4496
|
this.logger = logger;
|
|
@@ -4494,10 +4501,10 @@
|
|
|
4494
4501
|
this.externalApps = {
|
|
4495
4502
|
RBCP: 'rbcp-web-ui',
|
|
4496
4503
|
};
|
|
4497
|
-
this.environment = environment;
|
|
4498
4504
|
var instanceConfig = this.configSvc.instanceConfig;
|
|
4499
4505
|
if (instanceConfig) {
|
|
4500
4506
|
this.telemetryConfig = instanceConfig.telemetryConfig;
|
|
4507
|
+
this.environment = environment;
|
|
4501
4508
|
this.telemetryConfig = __assign({}, this.telemetryConfig, { pdata: __assign({}, this.telemetryConfig.pdata, { id: environment.name + "." + this.telemetryConfig.pdata.id }), uid: this.configSvc.userProfile && this.configSvc.userProfile.userId, channel: this.rootOrgId || this.telemetryConfig.channel, sid: this.getTelemetrySessionId });
|
|
4502
4509
|
this.pData = this.telemetryConfig.pdata;
|
|
4503
4510
|
this.addPlayerListener();
|
|
@@ -4727,15 +4734,13 @@
|
|
|
4727
4734
|
}
|
|
4728
4735
|
}
|
|
4729
4736
|
else {
|
|
4730
|
-
var interactid = void 0;
|
|
4731
|
-
if (event.data.type === 'goal') {
|
|
4732
|
-
interactid = page.pageUrlParts[4];
|
|
4733
|
-
}
|
|
4734
4737
|
try {
|
|
4735
4738
|
$t.interact({
|
|
4736
|
-
type: event.data.type,
|
|
4737
|
-
subtype: event.data.subType,
|
|
4738
|
-
id: (event.data.
|
|
4739
|
+
type: event.data.edata.type,
|
|
4740
|
+
subtype: event.data.edata.subType,
|
|
4741
|
+
id: (event.data.edata && event.data.edata.id) ?
|
|
4742
|
+
event.data.edata.id
|
|
4743
|
+
: '',
|
|
4739
4744
|
pageid: event.data.context && event.data.context.pageId || page.pageid,
|
|
4740
4745
|
}, {
|
|
4741
4746
|
context: __assign({ pdata: __assign({}, _this.pData, { id: _this.pData.id }) }, (event.data.context && event.data.context.module ? { env: event.data.context.module } : null)),
|
|
@@ -4771,7 +4776,7 @@
|
|
|
4771
4776
|
},
|
|
4772
4777
|
object: {
|
|
4773
4778
|
id: event.data.object.contentId || event.data.object.id || '',
|
|
4774
|
-
type: event.data.type || '',
|
|
4779
|
+
type: event.data.edata.type || '',
|
|
4775
4780
|
ver: "" + (event.data.object.version || '1') + '',
|
|
4776
4781
|
rollup: {},
|
|
4777
4782
|
},
|
|
@@ -4898,20 +4903,20 @@
|
|
|
4898
4903
|
},] }
|
|
4899
4904
|
];
|
|
4900
4905
|
TelemetryService.ctorParameters = function () { return [
|
|
4901
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: ['environment',] }] },
|
|
4902
4906
|
{ type: ConfigurationsService },
|
|
4903
4907
|
{ type: EventService },
|
|
4904
|
-
{ type: LoggerService }
|
|
4908
|
+
{ type: LoggerService },
|
|
4909
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: ['environment',] }] }
|
|
4905
4910
|
]; };
|
|
4906
|
-
/** @nocollapse */ TelemetryService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function TelemetryService_Factory() { return new TelemetryService(core.ɵɵinject(
|
|
4911
|
+
/** @nocollapse */ TelemetryService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function TelemetryService_Factory() { return new TelemetryService(core.ɵɵinject(ConfigurationsService), core.ɵɵinject(EventService), core.ɵɵinject(LoggerService), core.ɵɵinject("environment")); }, token: TelemetryService, providedIn: "root" });
|
|
4907
4912
|
return TelemetryService;
|
|
4908
4913
|
}());
|
|
4909
4914
|
if (false) {
|
|
4910
4915
|
TelemetryService.prototype.previousUrl;
|
|
4911
4916
|
TelemetryService.prototype.telemetryConfig;
|
|
4912
4917
|
TelemetryService.prototype.pData;
|
|
4913
|
-
TelemetryService.prototype.environment;
|
|
4914
4918
|
TelemetryService.prototype.contextCdata;
|
|
4919
|
+
TelemetryService.prototype.environment;
|
|
4915
4920
|
TelemetryService.prototype.externalApps;
|
|
4916
4921
|
TelemetryService.prototype.configSvc;
|
|
4917
4922
|
TelemetryService.prototype.eventsSvc;
|