Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pie-api/pie-api-live-components

Package Overview
Dependencies
Maintainers
2
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pie-api/pie-api-live-components - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

dist/pie-api-live/p-5f0bb0f5.entry.js

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [2.1.0](https://github.com/key-data-systems/pie-api-live-components/compare/v2.0.1...v2.1.0) (2021-04-08)
### Features
* watch both sessions and items, emit events when there is a new item or new session and populate fields where needed. BREAKING CHANGE: assignmentId is required ([ba03071](https://github.com/key-data-systems/pie-api-live-components/commit/ba03071021079032e0007185ce874fac8d5fd1dc))
## [2.0.1](https://github.com/key-data-systems/pie-api-live-components/compare/v2.0.0...v2.0.1) (2021-03-02)

@@ -2,0 +9,0 @@

2

dist/cjs/loader.cjs.js

@@ -10,3 +10,3 @@ 'use strict';

return index.patchEsm().then(() => {
return index.bootstrapLazy([["pie-live-session.cjs",[[1,"pie-live-session",{"sessionId":[513,"session-id"],"aggregateId":[513,"aggregate-id"],"loadingIndicator":[4,"loading-indicator"],"metadata":[16],"_itemData":[513,"_item-data"],"_sessionData":[513,"_session-data"],"sessionData":[32]}]]],["item-metadata.cjs",[[0,"item-metadata",{"_key":[1,"key"],"attribute":[1]}]]],["pie-aggregate.cjs",[[1,"pie-aggregate",{"aggregateId":[513,"aggregate-id"],"aggregateData":[32]},[[8,"itemAggregate","itemAggregateHandler"]]]]],["pie-api-live.cjs",[[0,"pie-api-live",{"token":[1],"host":[1],"liveUrl":[1,"live-url"],"assignmentId":[1,"assignment-id"],"loadingIndicator":[4,"loading-indicator"],"metadata":[16],"emitAggregates":[4,"emit-aggregates"],"gqlClient":[32]},[[8,"startSubscription","handleStartSubscription"],[0,"attachSession","handleLiveSessionAdded"],[8,"updateAggregate","handleUpdateAggregate"]]]]],["pie-response.cjs",[[1,"pie-response",{"sessionData":[8,"session-data"],"multiPart":[4,"multi-part"]}]]],["pie-response-cell.cjs",[[1,"pie-response-cell",{"sessionData":[8,"session-data"],"multiPart":[4,"multi-part"]}]]],["loading-indicator.cjs",[[1,"loading-indicator",{"progressAmount":[1,"progress-amount"],"progressColor":[1,"progress-color"]}]]]], options);
return index.bootstrapLazy([["pie-live-session.cjs",[[1,"pie-live-session",{"sessionId":[513,"session-id"],"aggregateId":[513,"aggregate-id"],"loadingIndicator":[4,"loading-indicator"],"metadata":[16],"_itemAndSessionData":[513,"_item-and-session-data"],"sessionData":[32]}]]],["item-metadata.cjs",[[0,"item-metadata",{"_key":[1,"key"],"attribute":[1]}]]],["pie-aggregate.cjs",[[1,"pie-aggregate",{"aggregateId":[513,"aggregate-id"],"aggregateData":[32]},[[8,"itemAggregate","itemAggregateHandler"]]]]],["pie-api-live.cjs",[[0,"pie-api-live",{"token":[1],"host":[1],"liveUrl":[1,"live-url"],"assignmentId":[1,"assignment-id"],"loadingIndicator":[4,"loading-indicator"],"metadata":[16],"emitAggregates":[4,"emit-aggregates"],"gqlClient":[32]},[[8,"startSubscription","handleStartSubscription"],[0,"attachSession","handleLiveSessionAdded"],[8,"updateAggregate","handleUpdateAggregate"]]]]],["pie-response.cjs",[[1,"pie-response",{"sessionData":[8,"session-data"],"multiPart":[4,"multi-part"]}]]],["pie-response-cell.cjs",[[1,"pie-response-cell",{"sessionData":[8,"session-data"],"multiPart":[4,"multi-part"]}]]],["loading-indicator.cjs",[[1,"loading-indicator",{"progressAmount":[1,"progress-amount"],"progressColor":[1,"progress-color"]}]]]], options);
});

@@ -13,0 +13,0 @@ };

@@ -6,3 +6,3 @@ 'use strict';

index.patchBrowser().then(options => {
return index.bootstrapLazy([["pie-live-session.cjs",[[1,"pie-live-session",{"sessionId":[513,"session-id"],"aggregateId":[513,"aggregate-id"],"loadingIndicator":[4,"loading-indicator"],"metadata":[16],"_itemData":[513,"_item-data"],"_sessionData":[513,"_session-data"],"sessionData":[32]}]]],["item-metadata.cjs",[[0,"item-metadata",{"_key":[1,"key"],"attribute":[1]}]]],["pie-aggregate.cjs",[[1,"pie-aggregate",{"aggregateId":[513,"aggregate-id"],"aggregateData":[32]},[[8,"itemAggregate","itemAggregateHandler"]]]]],["pie-api-live.cjs",[[0,"pie-api-live",{"token":[1],"host":[1],"liveUrl":[1,"live-url"],"assignmentId":[1,"assignment-id"],"loadingIndicator":[4,"loading-indicator"],"metadata":[16],"emitAggregates":[4,"emit-aggregates"],"gqlClient":[32]},[[8,"startSubscription","handleStartSubscription"],[0,"attachSession","handleLiveSessionAdded"],[8,"updateAggregate","handleUpdateAggregate"]]]]],["pie-response.cjs",[[1,"pie-response",{"sessionData":[8,"session-data"],"multiPart":[4,"multi-part"]}]]],["pie-response-cell.cjs",[[1,"pie-response-cell",{"sessionData":[8,"session-data"],"multiPart":[4,"multi-part"]}]]],["loading-indicator.cjs",[[1,"loading-indicator",{"progressAmount":[1,"progress-amount"],"progressColor":[1,"progress-color"]}]]]], options);
return index.bootstrapLazy([["pie-live-session.cjs",[[1,"pie-live-session",{"sessionId":[513,"session-id"],"aggregateId":[513,"aggregate-id"],"loadingIndicator":[4,"loading-indicator"],"metadata":[16],"_itemAndSessionData":[513,"_item-and-session-data"],"sessionData":[32]}]]],["item-metadata.cjs",[[0,"item-metadata",{"_key":[1,"key"],"attribute":[1]}]]],["pie-aggregate.cjs",[[1,"pie-aggregate",{"aggregateId":[513,"aggregate-id"],"aggregateData":[32]},[[8,"itemAggregate","itemAggregateHandler"]]]]],["pie-api-live.cjs",[[0,"pie-api-live",{"token":[1],"host":[1],"liveUrl":[1,"live-url"],"assignmentId":[1,"assignment-id"],"loadingIndicator":[4,"loading-indicator"],"metadata":[16],"emitAggregates":[4,"emit-aggregates"],"gqlClient":[32]},[[8,"startSubscription","handleStartSubscription"],[0,"attachSession","handleLiveSessionAdded"],[8,"updateAggregate","handleUpdateAggregate"]]]]],["pie-response.cjs",[[1,"pie-response",{"sessionData":[8,"session-data"],"multiPart":[4,"multi-part"]}]]],["pie-response-cell.cjs",[[1,"pie-response-cell",{"sessionData":[8,"session-data"],"multiPart":[4,"multi-part"]}]]],["loading-indicator.cjs",[[1,"loading-indicator",{"progressAmount":[1,"progress-amount"],"progressColor":[1,"progress-color"]}]]]], options);
});

@@ -37,2 +37,3 @@ 'use strict';

this.itemConfig = null;
this.updateItemInfoInProgress = true;
this.emitAttachSession();

@@ -46,10 +47,9 @@ this.emitStartSubscription();

}
watchItemData(newVal) {
this.itemConfig = newVal === null || newVal === void 0 ? void 0 : newVal.config;
this.metadataValues = newVal === null || newVal === void 0 ? void 0 : newVal.searchMetaData;
}
watchSessionData(newVal) {
const { createdAt, score, id, manualScore, autoScore } = newVal || {};
watchItemAndSessionData(newVal) {
const { item, session } = newVal || {};
this.itemConfig = item === null || item === void 0 ? void 0 : item.config;
this.metadataValues = item === null || item === void 0 ? void 0 : item.searchMetaData;
const { createdAt, score, id, manualScore, autoScore } = session || {};
if (this.sessionDataIsValid(createdAt)) {
this.sessionData = Object.assign(Object.assign(Object.assign({}, this.sessionData), newVal), { loaded: true, sessionId: id, score: score || manualScore || autoScore || undefined, itemConfig: this.itemConfig });
this.sessionData = Object.assign(Object.assign(Object.assign({}, this.sessionData), session), { loaded: true, sessionId: id, score: score || manualScore || autoScore || undefined, itemConfig: this.itemConfig });
this.emitUpdateAggregate();

@@ -91,3 +91,2 @@ }

if (this.sessionId) {
this.updateItemInfoInProgress = true;
this.startSubscription.emit({ sessionId: this.sessionId });

@@ -123,4 +122,3 @@ }

"aggregateId": ["watchAggregateId"],
"_itemData": ["watchItemData"],
"_sessionData": ["watchSessionData"]
"_itemAndSessionData": ["watchItemAndSessionData"]
}; }

@@ -127,0 +125,0 @@ }

@@ -16,8 +16,2 @@ import { Component, Prop, h, Watch, Host, Listen, Event, State, } from "@stencil/core";

};
const environmentGQLVariables = {
dev: process.env.GQL_DEV,
qa: process.env.GQL_QA,
stage: process.env.GQL_STAGE,
prod: process.env.GQL_PROD,
};
const watchAssignmentSessionsQuery = gql `

@@ -35,30 +29,44 @@ subscription watchAssignmentSessions($assignmentId: ID!){

`;
const watchAssignmentItemsQuery = gql `
subscription watchAssignmentItems($assignmentId: ID!){
watchAssignmentItems(assignmentId: $assignmentId) {
config
id
version { major, minor, patch }
}
}
`;
export class PieApiLive {
constructor() {
/**
* If loading indicator should show up while the item is loading.
*/
this.loadingIndicator = true;
/**
* Used to store targets to all pie-live-sessions in order to be able to pass proper data
*/
this._mapSessionIdsToSessionTargets = {};
/**
* If loading indicator should show up while the item is loading.
*/
this.loadingIndicator = true;
this.getItem = (items, contentItemId) => items && items.find(it => it && it.id && contentItemId && it.id === contentItemId);
this.setSessionData = s => {
this._mapSessionIdsToSessionTargets[s.id]._sessionData = s;
/** Used to store all the items that were received via watchAssignmentItems */
this._items = {};
/** Used to store all the sessions that were received via watchAssignmentSessions */
this._sessions = {};
/** Used to map the sessions with proper items */
this._mapSessionIdsToItemIds = {};
this.setItemAndSession = (target, session, item) => {
target._itemAndSessionData = {
item,
session
};
};
this.setItemData = (s, item) => {
this._mapSessionIdsToSessionTargets[s.id]._itemData = item;
};
this.setSessionDataOnTarget = (s) => {
if (this._mapSessionIdsToSessionTargets[s.id]) {
this.setSessionData(s);
this.setItemAndSessionData = (sessionId) => {
const target = this._mapSessionIdsToSessionTargets[sessionId];
const session = sessionId && this._sessions[sessionId];
const item = session && session.contentItemId && this._items[session.contentItemId];
if (target && item && session) {
this.setItemAndSession(target, session, item);
}
else {
console.log('Assignment has New Session ID:', s.id);
}
};
this.subscribeAssignment = () => {
if (!this._subscription) {
this._subscription = this.gqlClient.subscribe({
this.subscribeAssignmentSessions = () => {
if (!this._subscriptionForSessions) {
this._subscriptionForSessions = this.gqlClient.subscribe({
query: watchAssignmentSessionsQuery,

@@ -69,4 +77,12 @@ variables: { assignmentId: this.assignmentId },

const watchAssignmentSessions = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.watchAssignmentSessions;
this._sessions = watchAssignmentSessions;
(watchAssignmentSessions || []).forEach(this.setSessionDataOnTarget);
(watchAssignmentSessions || []).forEach((session) => {
const { id, contentItemId } = session;
this._mapSessionIdsToItemIds[id] = contentItemId;
if (!this._sessions[id]) {
this.newSessionInAssignment.emit({ session });
}
// always update the session with latest
this._sessions[id] = session;
this.setItemAndSessionData(id);
});
}, error => {

@@ -77,34 +93,33 @@ console.error(error.message);

};
this.setItemDataAndSessionDataOnTarget = (s) => {
const item = this.getItem(this._items, s.contentItemId);
if (this._mapSessionIdsToSessionTargets[s.id]) {
this.setItemData(s, item);
this.setSessionData(s);
this.subscribeAssignmentItems = () => {
if (!this._subscriptionForItems) {
this._subscriptionForItems = this.gqlClient.subscribe({
query: watchAssignmentItemsQuery,
variables: { assignmentId: this.assignmentId },
}).subscribe(result => {
var _a;
const watchAssignmentItems = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.watchAssignmentItems;
(watchAssignmentItems || []).forEach((item) => {
const { id } = item;
if (!this._items[id]) {
this.newItemInAssignment.emit({ item });
}
// always update the item with latest
this._items[id] = item;
Object.keys(this._mapSessionIdsToItemIds)
.filter(key => this._mapSessionIdsToItemIds[key] === id)
.forEach(this.setItemAndSessionData);
});
}, error => {
console.error(error.message);
});
}
else {
console.log('Assignment has New Session ID:', s.id);
}
};
this.loadAssignment = () => {
let gqlUri = `https://${environmentGQLVariables.prod}`;
// if host property is defined, determine live server using that value (default is production)
if (this.host) {
gqlUri = `https://${environmentGQLVariables[this.host]}`;
if (this.gqlClient && this.assignmentId) {
this.subscribeAssignmentItems();
this.subscribeAssignmentSessions();
}
if (this.assignmentId) {
fetch(`${gqlUri}/services/loadAssignment/${this.assignmentId}?token=${this.token}`)
.then((response) => response.json())
.then(response => {
const { items, sessions } = response || {};
this._items = items;
(sessions || []).forEach(this.setItemDataAndSessionDataOnTarget);
this.subscribeAssignment();
});
}
else {
console.error('NO assignmentId!');
}
};
this.addSessionId = (event) => {
// addSessionId
const { detail, target } = event || {};

@@ -114,10 +129,3 @@ const { sessionId } = detail || {};

this._mapSessionIdsToSessionTargets[sessionId] = target;
// if new sessions are added AFTER the loadAssignment finished, make sure item and session are set
if (this._mapSessionIdsToSessionTargets[sessionId] && this._sessions && this._items) {
const session = this._sessions.find(sess => sess.id === sessionId);
if (session) {
this._mapSessionIdsToSessionTargets[sessionId]._itemData = this.getItem(this._items, session.contentItemId);
this._mapSessionIdsToSessionTargets[sessionId]._sessionData = session;
}
}
this.setItemAndSessionData(sessionId);
}

@@ -377,2 +385,32 @@ };

}
}, {
"method": "newItemInAssignment",
"name": "newItemInAssignment",
"bubbles": true,
"cancelable": true,
"composed": true,
"docs": {
"tags": [],
"text": "Emitted when there's a new item in the assignment"
},
"complexType": {
"original": "any",
"resolved": "any",
"references": {}
}
}, {
"method": "newSessionInAssignment",
"name": "newSessionInAssignment",
"bubbles": true,
"cancelable": true,
"composed": true,
"docs": {
"tags": [],
"text": "Emitted when there's a new session in the assignment"
},
"complexType": {
"original": "any",
"resolved": "any",
"references": {}
}
}]; }

@@ -379,0 +417,0 @@ static get watchers() { return [{

@@ -27,2 +27,3 @@ import { Component, Prop, h, Watch, Event, State, Host, Element } from '@stencil/core';

this.itemConfig = null;
this.updateItemInfoInProgress = true;
this.emitAttachSession();

@@ -36,10 +37,9 @@ this.emitStartSubscription();

}
watchItemData(newVal) {
this.itemConfig = newVal === null || newVal === void 0 ? void 0 : newVal.config;
this.metadataValues = newVal === null || newVal === void 0 ? void 0 : newVal.searchMetaData;
}
watchSessionData(newVal) {
const { createdAt, score, id, manualScore, autoScore } = newVal || {};
watchItemAndSessionData(newVal) {
const { item, session } = newVal || {};
this.itemConfig = item === null || item === void 0 ? void 0 : item.config;
this.metadataValues = item === null || item === void 0 ? void 0 : item.searchMetaData;
const { createdAt, score, id, manualScore, autoScore } = session || {};
if (this.sessionDataIsValid(createdAt)) {
this.sessionData = Object.assign(Object.assign(Object.assign({}, this.sessionData), newVal), { loaded: true, sessionId: id, score: score || manualScore || autoScore || undefined, itemConfig: this.itemConfig });
this.sessionData = Object.assign(Object.assign(Object.assign({}, this.sessionData), session), { loaded: true, sessionId: id, score: score || manualScore || autoScore || undefined, itemConfig: this.itemConfig });
this.emitUpdateAggregate();

@@ -81,3 +81,2 @@ }

if (this.sessionId) {
this.updateItemInfoInProgress = true;
this.startSubscription.emit({ sessionId: this.sessionId });

@@ -187,3 +186,3 @@ }

},
"_itemData": {
"_itemAndSessionData": {
"type": "string",

@@ -203,26 +202,6 @@ "mutable": false,

}],
"text": "Used to set itemConfig"
"text": "Used to set itemConfig and sessionData"
},
"attribute": "_item-data",
"attribute": "_item-and-session-data",
"reflect": true
},
"_sessionData": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [{
"text": undefined,
"name": "internal"
}],
"text": "Used to set sessionData"
},
"attribute": "_session-data",
"reflect": true
}

@@ -308,8 +287,5 @@ }; }

}, {
"propName": "_itemData",
"methodName": "watchItemData"
}, {
"propName": "_sessionData",
"methodName": "watchSessionData"
"propName": "_itemAndSessionData",
"methodName": "watchItemAndSessionData"
}]; }
}

@@ -33,2 +33,3 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-19cb11a9.js';

this.itemConfig = null;
this.updateItemInfoInProgress = true;
this.emitAttachSession();

@@ -42,10 +43,9 @@ this.emitStartSubscription();

}
watchItemData(newVal) {
this.itemConfig = newVal === null || newVal === void 0 ? void 0 : newVal.config;
this.metadataValues = newVal === null || newVal === void 0 ? void 0 : newVal.searchMetaData;
}
watchSessionData(newVal) {
const { createdAt, score, id, manualScore, autoScore } = newVal || {};
watchItemAndSessionData(newVal) {
const { item, session } = newVal || {};
this.itemConfig = item === null || item === void 0 ? void 0 : item.config;
this.metadataValues = item === null || item === void 0 ? void 0 : item.searchMetaData;
const { createdAt, score, id, manualScore, autoScore } = session || {};
if (this.sessionDataIsValid(createdAt)) {
this.sessionData = Object.assign(Object.assign(Object.assign({}, this.sessionData), newVal), { loaded: true, sessionId: id, score: score || manualScore || autoScore || undefined, itemConfig: this.itemConfig });
this.sessionData = Object.assign(Object.assign(Object.assign({}, this.sessionData), session), { loaded: true, sessionId: id, score: score || manualScore || autoScore || undefined, itemConfig: this.itemConfig });
this.emitUpdateAggregate();

@@ -87,3 +87,2 @@ }

if (this.sessionId) {
this.updateItemInfoInProgress = true;
this.startSubscription.emit({ sessionId: this.sessionId });

@@ -119,4 +118,3 @@ }

"aggregateId": ["watchAggregateId"],
"_itemData": ["watchItemData"],
"_sessionData": ["watchSessionData"]
"_itemAndSessionData": ["watchItemAndSessionData"]
}; }

@@ -123,0 +121,0 @@ }

@@ -1,1 +0,1 @@

import{p as a,b as e}from"./p-a9582e3d.js";a().then(a=>e([["p-23ec2539",[[1,"pie-live-session",{sessionId:[513,"session-id"],aggregateId:[513,"aggregate-id"],loadingIndicator:[4,"loading-indicator"],metadata:[16],_itemData:[513,"_item-data"],_sessionData:[513,"_session-data"],sessionData:[32]}]]],["p-211628e3",[[0,"item-metadata",{_key:[1,"key"],attribute:[1]}]]],["p-b35a7649",[[1,"pie-aggregate",{aggregateId:[513,"aggregate-id"],aggregateData:[32]},[[8,"itemAggregate","itemAggregateHandler"]]]]],["p-76635aa9",[[0,"pie-api-live",{token:[1],host:[1],liveUrl:[1,"live-url"],assignmentId:[1,"assignment-id"],loadingIndicator:[4,"loading-indicator"],metadata:[16],emitAggregates:[4,"emit-aggregates"],gqlClient:[32]},[[8,"startSubscription","handleStartSubscription"],[0,"attachSession","handleLiveSessionAdded"],[8,"updateAggregate","handleUpdateAggregate"]]]]],["p-be7a6968",[[1,"pie-response",{sessionData:[8,"session-data"],multiPart:[4,"multi-part"]}]]],["p-be6b5090",[[1,"pie-response-cell",{sessionData:[8,"session-data"],multiPart:[4,"multi-part"]}]]],["p-af1db197",[[1,"loading-indicator",{progressAmount:[1,"progress-amount"],progressColor:[1,"progress-color"]}]]]],a));
import{p as e,b as a}from"./p-a9582e3d.js";e().then(e=>a([["p-68fa9d7b",[[1,"pie-live-session",{sessionId:[513,"session-id"],aggregateId:[513,"aggregate-id"],loadingIndicator:[4,"loading-indicator"],metadata:[16],_itemAndSessionData:[513,"_item-and-session-data"],sessionData:[32]}]]],["p-211628e3",[[0,"item-metadata",{_key:[1,"key"],attribute:[1]}]]],["p-b35a7649",[[1,"pie-aggregate",{aggregateId:[513,"aggregate-id"],aggregateData:[32]},[[8,"itemAggregate","itemAggregateHandler"]]]]],["p-5f0bb0f5",[[0,"pie-api-live",{token:[1],host:[1],liveUrl:[1,"live-url"],assignmentId:[1,"assignment-id"],loadingIndicator:[4,"loading-indicator"],metadata:[16],emitAggregates:[4,"emit-aggregates"],gqlClient:[32]},[[8,"startSubscription","handleStartSubscription"],[0,"attachSession","handleLiveSessionAdded"],[8,"updateAggregate","handleUpdateAggregate"]]]]],["p-be7a6968",[[1,"pie-response",{sessionData:[8,"session-data"],multiPart:[4,"multi-part"]}]]],["p-be6b5090",[[1,"pie-response-cell",{sessionData:[8,"session-data"],multiPart:[4,"multi-part"]}]]],["p-af1db197",[[1,"loading-indicator",{progressAmount:[1,"progress-amount"],progressColor:[1,"progress-color"]}]]]],e));

@@ -62,10 +62,6 @@ /* eslint-disable */

/**
* Used to set itemConfig
* Used to set itemConfig and sessionData
*/
"_itemData": string;
"_itemAndSessionData": string;
/**
* Used to set sessionData
*/
"_sessionData": string;
/**
* The Aggregate Id to use

@@ -208,2 +204,10 @@ */

/**
* Emitted when there's a new item in the assignment
*/
"onNewItemInAssignment"?: (event: CustomEvent<any>) => void;
/**
* Emitted when there's a new session in the assignment
*/
"onNewSessionInAssignment"?: (event: CustomEvent<any>) => void;
/**
* The api token for pie-api. The token must have the `live` scope.

@@ -210,0 +214,0 @@ */

@@ -8,15 +8,2 @@ import { EventEmitter } from "../../stencil-public-runtime";

/**
* Used to store all the items that were received via loadAssignment (for later usage)
*/
_items: any;
/**
* Used to store all the sessions that were received via loadAssignment (for later usage)
*/
_sessions: any;
_subscription: any;
/**
* Used to store targets to all pie-live-sessions in order to be able to pass proper data
*/
_mapSessionIdsToSessionTargets: Object;
/**
* The api token for pie-api.

@@ -73,11 +60,31 @@ * The token must have the `live` scope.

itemAggregate: EventEmitter;
/**
* Emitted when there's a new item in the assignment
*/
newItemInAssignment: EventEmitter;
/**
* Emitted when there's a new session in the assignment
*/
newSessionInAssignment: EventEmitter;
/** Subscription to watch sessions */
_subscriptionForSessions: any;
/** Subscription to watch items */
_subscriptionForItems: any;
/**
* Used to store targets to all pie-live-sessions in order to be able to pass proper data
*/
_mapSessionIdsToSessionTargets: Object;
/** Used to store all the items that were received via watchAssignmentItems */
_items: any;
/** Used to store all the sessions that were received via watchAssignmentSessions */
_sessions: any;
/** Used to map the sessions with proper items */
_mapSessionIdsToItemIds: any;
watchChange(): void;
watchMetadata(newVal: any, oldVal: any): void;
watchAssignmentId(newVal: any, oldVal: any): void;
getItem: (items: any, contentItemId: any) => any;
setSessionData: (s: any) => void;
setItemData: (s: any, item: any) => void;
setSessionDataOnTarget: (s: any) => void;
subscribeAssignment: () => void;
setItemDataAndSessionDataOnTarget: (s: any) => void;
setItemAndSession: (target: any, session: any, item: any) => void;
setItemAndSessionData: (sessionId: any) => void;
subscribeAssignmentSessions: () => void;
subscribeAssignmentItems: () => void;
loadAssignment: () => void;

@@ -84,0 +91,0 @@ connectedCallback(): void;

@@ -36,12 +36,7 @@ import { EventEmitter } from '../../stencil-public-runtime';

/**
* Used to set itemConfig
* Used to set itemConfig and sessionData
* @internal
*/
_itemData: string;
_itemAndSessionData: string;
/**
* Used to set sessionData
* @internal
*/
_sessionData: string;
/**
* Emitted when the element is first connected to the DOM.

@@ -66,4 +61,3 @@ */

watchAggregateId(aggId: any): void;
watchItemData(newVal: any): void;
watchSessionData(newVal: any): void;
watchItemAndSessionData(newVal: any): void;
sessionDataIsValid(timestamp: any): boolean;

@@ -70,0 +64,0 @@ getCorrectness(points: any, maxPoints: any): "correct" | "incorrect" | "partial";

{
"name": "@pie-api/pie-api-live-components",
"version": "2.0.1",
"version": "2.1.0",
"description": "Custom Elements that work with PIE Api Live services",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc