@kurtosys/udm_data_toolkit
TypeScript icon, indicating that this package has built-in type declarations

7.1.2 • Public • Published

UDM_DATA_TOOLKIT

Interface library for loading data into fund press.

Installing

Simply run npm install on the root folder of this project to install

BEFORE Publishing to npm: Building

For a dev build run npm run build

For a production build run npm run build:prod

Type definitions

This project has very experimental type definitions that attempts to document the functions for it. It doesn't cover the entire api so you can ignore large sections of it for now.

If you use vscode regardless if you use typescript or javascript you should get documentation built in and autocomplete.

Auto Complete

Project structure

/dist <-- Output Folder
/src  <-- Source Directory
    /utils
    index.js    <-- Entry Point
kDataToolkit.d.ts    <-- Type Definitions
webpack.config.js    <-- Build Configuration

Ftps changes

This is just to document the current changes with the ftps. A more thorough one will be done later. First there is the ftp folder you are pulling the files from it needs to be defined as ftpPath. This has been put on the LOADER_CONFIG object as ftpPath.

There are two functions syncFTPFolder and finalizeFTP.

Call syncFtpFolder with the remote path for the ftp it will return a promise that resolves with all the file names that have been copied. It syncs with your local ${globalRoot}/pending folder.

Once your loader is complete call finalizeFTP with the remote path this will archive all of the files into a zip clear the pending folder and clear the ftp folder.

import {
    LOADER_CONFIG,
    syncFTPFolder,
    finalizeFTP,
    registerLoaderStart,
    registerLoaderEnd,
    initDataToolkitConfig,
    login,
    getClient
} from "@kurtosys/udm_data_toolkit";
const manifest = require("rootDir/config/manifest");
const { ftpPath } = LOADER_CONFIG.ftp;

async function loadData() {
    let filesSynced = await syncFTPFolder(ftpPath); //Returns an array of files synced
    let token = await login();
    let client = await getClient();
    await registerLoaderStart();
    let isFilesToLoad = await loadFilesFromFolder("rootDir/pending", manifest);
    if (isFilesToLoad) {
        let [funds, timeSeries, ...otherStuff] = manifest;
        //Do your calls to load data
    }
    await finalizeFTP(ftpPath);
    await registerLoaderEnd(0, null, manifest);
    console.log("All Done");
}

initDataToolkitConfig("rootDir/", loadData);

Enviroment config changes

In the loaderConfig_[target].json file there is now a property called enviroment. Valid values for this is DEV, STAGING and PROD; this will target api-dev.fundpress.io, api-rel.fundpress.io and api.fundpress.io respectively.

Updating UDM Data Toolkit to a major version

Before updating this package to a major version, make sure that you first create a branch off master (without your changes) and name this branch "versions/{v#}" where {#} is the major version number. By doing this, we can easily maintain any version of this package

Example:

  • versions/v1
  • versions/v2

Readme

Keywords

none

Package Sidebar

Install

npm i @kurtosys/udm_data_toolkit

Weekly Downloads

1

Version

7.1.2

License

UNLICENSED

Unpacked Size

430 kB

Total Files

90

Last publish

Collaborators

  • npm