diff --git a/package-lock.json b/package-lock.json index 24d9a01da..35ce07d7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "@firebolt-js/sdk", - "version": "0.6.1", + "version": "0.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@firebolt-js/sdk", - "version": "0.6.1", + "version": "0.7.0", "license": "Apache-2.0", "devDependencies": { - "@firebolt-js/openrpc": "rdkcentral/firebolt-openrpc#fix/bigint", - "@firebolt-js/schemas": "git://github.com/rdkcentral/firebolt-schemas.git", + "@firebolt-js/openrpc": "1.5.0", + "@firebolt-js/schemas": "0.2.0", "ajv": "^6.12.6", "jest": "^28.1.0", "mkdirp": "^0.5.6", @@ -510,10 +510,10 @@ "dev": true }, "node_modules/@firebolt-js/openrpc": { - "version": "1.4.1", - "resolved": "git+ssh://git@github.com/rdkcentral/firebolt-openrpc.git#61a50e9f14c2b9128119be79cf7c56f44c3d138b", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@firebolt-js/openrpc/-/openrpc-1.5.0.tgz", + "integrity": "sha512-6IqZQ433kL+LS9qbrnHVXkzH0N8lCRyzQFS7MTENcbbi7DeEbYFDntRvvnfqqA8yjHL/Njvoy2nPpt3stMQMeg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "ajv": "^8.3.0", "ajv-formats": "^2.1.0", @@ -7952,9 +7952,10 @@ "dev": true }, "@firebolt-js/openrpc": { - "version": "git+ssh://git@github.com/rdkcentral/firebolt-openrpc.git#61a50e9f14c2b9128119be79cf7c56f44c3d138b", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@firebolt-js/openrpc/-/openrpc-1.5.0.tgz", + "integrity": "sha512-6IqZQ433kL+LS9qbrnHVXkzH0N8lCRyzQFS7MTENcbbi7DeEbYFDntRvvnfqqA8yjHL/Njvoy2nPpt3stMQMeg==", "dev": true, - "from": "@firebolt-js/openrpc@rdkcentral/firebolt-openrpc#fix/bigint", "requires": { "ajv": "^8.3.0", "ajv-formats": "^2.1.0", @@ -7991,7 +7992,7 @@ "@firebolt-js/schemas": { "version": "git+ssh://git@github.com/rdkcentral/firebolt-schemas.git#09b2aea322efa80c425eb789a7f3c70943a69de9", "dev": true, - "from": "@firebolt-js/schemas@git://github.com/rdkcentral/firebolt-schemas.git", + "from": "@firebolt-js/schemas@0.2.0", "requires": { "ajv": "^8.0.0" }, diff --git a/package.json b/package.json index 9973b01b2..f56c2e6bf 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "dependencies": { }, "devDependencies": { - "@firebolt-js/openrpc": "git://github.com/rdkcentral/firebolt-openrpc.git", - "@firebolt-js/schemas": "git://github.com/rdkcentral/firebolt-schemas.git", + "@firebolt-js/openrpc": "1.5.0", + "@firebolt-js/schemas": "0.2.0", "ajv": "^6.12.6", "jest": "^28.1.0", "mkdirp": "^0.5.6", diff --git a/test/typescript/declarations.test.ts b/test/typescript/declarations.test.ts index 0c76120ea..9363388ab 100644 --- a/test/typescript/declarations.test.ts +++ b/test/typescript/declarations.test.ts @@ -32,3 +32,50 @@ test('purchaseContent', () => { expect(typeof result.totalCount).toBe('number') }) }) + +const result: Discovery.EntityInfoResult = { + entity: { + "entityType": "program", + "identifiers": { + "entityId": "123" + }, + "programType": "movie", + "title": "A title" + }, + "expires": "" +} + +test('entityInfo', () => { + + return Discovery.entityInfo(result).then(() => { + let result:Discovery.EntityInfoResult = sent.find(message => message.method === 'entityInfo').params.result + expect(result.entity.identifiers.entityId).toBe("123") + }) +}) + +test('entityInfo pull', () => { + let resolver + const p = new Promise((resolve, reject) => { + resolver = resolve + }) + + Discovery.entityInfo( (request: Discovery.EntityInfoParameters) => { + setTimeout( _ => { + resolver() + }, 1000) + + return Promise.resolve(result) + }) + + Setup.emit('discovery', 'pullEntityInfo', { + correlationId: '123', + parameters: { + entityId: '123' + } + }) + + let result:Discovery.EntityInfoResult = sent.find(message => message.method === 'entityInfo').params.result + expect(result.entity.identifiers.entityId).toBe("123") + + return p +}) \ No newline at end of file