Skip to content

Commit 8f0859b

Browse files
committed
Initial commit
1 parent ae4c295 commit 8f0859b

6 files changed

Lines changed: 118 additions & 1 deletion

File tree

‎.vscode/launch.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Current TS File",
6+
"type": "node",
7+
"request": "launch",
8+
"args": ["${relativeFile}"],
9+
"runtimeArgs": ["-r", "ts-node/register"],
10+
"cwd": "${workspaceRoot}",
11+
"protocol": "inspector",
12+
"internalConsoleOptions": "openOnSessionStart",
13+
"sourceMaps": true,
14+
"outputCapture": "std"
15+
}
16+
]
17+
}

‎README.md‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
# Example.DataLibrary.TypeScript
1+
# TypeScript examples for the Refinitiv Data Library
2+
3+
## Summary
4+
5+
The following series of examples demonstrate how to programmatically access content residing within the Refinitiv Data Platform (RDP) using a single, ease of use API called the Refinitiv Data Library for TypeScript. The platform refers to the layer of data services providing both streaming and non-streaming content serving different clients, from the simple desktop interface to the enterprise application.
6+
7+
The Refinitiv Data Library is structured as a stack of interfaces and libraries designed to foster the adoption of our platform by both financial coders and professional developers to programmatically access financial content. Based on this stack of interfaces, the examples defined within this section have been organized as follows:
8+
9+
## Content
10+
11+
The Content examples target higher-level abstractions representing financial items like Pricing, News, Historical Data, etc. The Content layer can easily be used by both professional developers and financial coders. It provides great flexibility for commonly used financial objects.
12+
13+
14+
## Delivery
15+
16+
The Delivery examples target the interfaces defined within the lowest abstraction layer of the library. The examples provide core level services including logging and WebSocket customization. In addition, different delivery service examples such as Request/Reply data endpoints, real-time streaming and interfaces supporting queuing capabilities offered for news headlines, stories and research message services.

‎rdplibconfig.prod.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"logs": {
3+
"level": "warn",
4+
"filter": "*",
5+
"transports": {
6+
"console": {
7+
"enabled": true
8+
},
9+
"file": {
10+
"enabled": false,
11+
"name": "rdlib"
12+
}
13+
}
14+
}
15+
}

‎session.config.json‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"sessions": {
3+
"default": "platform",
4+
5+
"platform": {
6+
"rdpUser": "<RDP Machine ID>",
7+
"rdpPassword": "<RDP Password>",
8+
"appKey": "<RDP Application Key>"
9+
},
10+
11+
"desktop": {
12+
"appKey": "<Desktop Application Key>"
13+
},
14+
15+
"container": {
16+
"appKey": "<Application Key>"
17+
}
18+
}
19+
}

‎src/1.QuickStart/testSession.ts‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// tslint:disable: no-console
2+
// tslint:disable-next-line: no-implicit-dependencies
3+
import { logger } from '@refinitiv-data/data';
4+
import { getSession } from '../Common/session';
5+
// set Debugging=ON for the quick-start test of the session
6+
logger.setLevel(logger.levels.DEBUG);
7+
8+
// Create a session to connect to either 'platform', 'desktop' or 'container' sources
9+
// The user credentials to connect to each session type are read from the 'session.config.json' file
10+
// If the session type is not explicitly specified, then the default session in the config file is used
11+
12+
const session = getSession();
13+
//const session = getSession('platform');
14+
//const session = getSession('desktop');
15+
//const session = getSession('container');
16+
17+
// rest of the code remains unchanged for each session type
18+
(async () => {
19+
try {
20+
console.log('Opening the session...');
21+
22+
// open the session
23+
await session.open();
24+
25+
console.log('Session successfully opened');
26+
}
27+
catch (err) {
28+
console.log('Session failed to open !');
29+
console.log(err);
30+
}
31+
finally {
32+
console.log('Closing the session...');
33+
await session.close();
34+
}
35+
})();

‎tsconfig.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"strict": true,
5+
"esModuleInterop": true,
6+
"noEmitOnError": true,
7+
"noImplicitAny": true,
8+
"resolveJsonModule": true,
9+
"sourceMap": true
10+
},
11+
"exclude": [
12+
"node_modules",
13+
"**/node_modules/*"
14+
],
15+
"include": ["src/**/*"],
16+
}

0 commit comments

Comments
 (0)