Giter Site home page Giter Site logo

informatiqal / qlik-saas-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 5.46 MB

Interact with Qlik Sense SaaS REST APIs

Home Page: https://informatiqal.com/solutions/

License: MIT License

JavaScript 0.19% TypeScript 99.81%
api qlik qlik-sense qliksense rest rest-api saas saas-api

qlik-saas-api's People

Contributors

countnazgul avatar mikara89 avatar renovate-bot avatar renovate[bot] avatar

Watchers

 avatar  avatar

Forkers

mikara89

qlik-saas-api's Issues

Export/Download methods to return extra data

At the moment export/download methods are returning the raw data. This should be changed so the raw data to be returned under the file property and other extra information to be returned under additional properties.

For example app.export to return:

{
  "file": "Binary-data-here",
  "name": "qlik-app-name.qvf",
  "id": "123-123-123-123"
}

Passing arguments change

All public methods, that expect some arguments, should have their arguments passed as an object and not as named parameters. For example:

Current:

async update(name: string) {
...
}

To be:

async update(arg: { name: string }) {
...
}

The main reason for this is because of Automatiqal (CLI) package(s). Qlik Repo API package already uses the same approach as well

Oauth M2M authentication implementation

Qlik released OAuth authentication workflow. In general the authentication workflow will provide access_token that can be passed to the request to authenticate.

Have to allow the config to accept client_id and client_secret. If/when these two properties are passed then the logic should send request to oauth/token to receive the token details (the token itself and the expiration date).

The instance will hold the token and its expiration data and will try to re-use the token if not expired. If the token is expired then the instance will obtain a new one.

Blog post
Rest API examples

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • form-data ^4.0.0
  • qlik-rest-api ^1.8.3
  • @rollup/plugin-typescript ^11.1.6
  • @types/form-data ^2.5.0
  • @types/node 20.11.19
  • dotenv 16.4.4
  • esm ^3.2.25
  • nyc 15.1.0
  • rollup ^4.12.0
  • rollup-plugin-delete 2.0.0
  • ts-node 10.9.2
  • tslib ^2.6.2
  • typedoc 0.25.8
  • typescript 5.0.4
  • vitest ^0.34.6
  • node >=14.19.1

  • Check this box to trigger a request for Renovate to run again on this repository

Init to check for empty object

Its not major issue but the init method should check if details variable have any properties as well. At the moment the only check is if details is not defined

App id vs resourceId

Since apps information is extracted via the /items endpoint the data returned includes the item id under the id property and the app id under the resourceId property.

This works fine but the problem is that all specific app operations are using the resourceId value. Because of this there should be an optional option, when creating app instance, to swap id and resourceId values.

This is not mandatory but makes filtering easier - no need to remember that when dealing with app resourceId should be used instead of id

All create methods to return instance

Double check that all create methods are returning an instance of an entity instead of the old approach that was returning the response data.

Just noticed that webIntegrations.create is not returning instance of an object

Item vs App

The problem arises from the fact that in order to get a list of the apps the endpoint is /items?resourceType=app,qvapp,qlikview and the rest of the app related apis are through /apps endpoints. And /items returned data is different from /apps/import (for example) returned data. And we are in position where dealing with the same entity type but with two data formats.

In order to "unify" the data format all app methods should get their final data from the /items endpoints

apps.create - name ignored

When creating new app and passing name argument the created app's name is guid instead of the name provided.

Page size

For all getAll methods will be good to implement larger page size. By default Qlik will return the first 10 rows of data. But if the data is 100 rows (for example) then the rest client will have to make additional 10 requests (10 x 10 = 100) in order to get the full dataset. 50 items per page is probably ok?

The way to achieve this is to add limit=50 query parameter to the url for all getAll methods

Zod implementation

Just to not forget that at some points have to start using Zod as arguments validator tool

Additional "actions"?

Can see possibility of adding "actions" (is this a good name?) for some entities.

For example:
At the moment the methods for App entity reflect the API endpoints. But what about add additional methods under "actions" property. These additional methods are not part of the /apps endpoints but are related to the apps. For example - reload-task. When creating reload-task the API requires appId. Which means that there is a direct link between reload task and app. The action in this case will be (something like):

// create reload task directly from the app instance
const app = await saasApi.apps.get("1234-1234-1234-1234");
const reloadTask = await app.actions.createReloadTask({ "reload-task-details-here" });
// get reload tasks for the specified app from the app instance
const app = await saasApi.apps.get("1234-1234-1234-1234");
const reloadTasks = await app.actions.getReloadTasks();
// reloadTasks will contain only the reload tasks "linked" with the current app

Probably most of these actions (if not all) can be applied only to app instances.

The questions are:

  • any reason why not to?
  • what are the code implications of such implementation
  • (very wild question) if direct implementation will make the code unstable then what about implementing mixin/extension capability?!?!?!

Additional _actions

#77 added few _actions to the App instance. This issue is to track what other entities can benefit from having an _action methods as well

sort parameter for getAll

Add the optional sort parameter for all getAll methods. Similar to what is available for automationConnections.getAll() method.

And just in general ... what should be the approach for adding this? Extend the URLBuild class? or something simpler?

saasClient and id - do not expose?

At the moment saasClient and id class properties are public. These have to be made private (other way to not expose them?).

When public then the whole config is exposed - this will include any authentication information, that is used to communicate with Qlik API's

id ... not a big deal that is exposed but might be good to "hide" it as well.

Remove filter

removeFilter should be implemented similarly to #199 (and rename the existing removeFilter to removeFilterNative)

Inline variables with nested properties

When using inline variables and provide property name to extract it will not work when the value is nested in the object eg. $${Some task name#someProperty.anotherLevel.myValue}.

The function that is parsing the inline variables should respect that and should work with nested values

Filtering

The current implementation follows the available SaaS api specs.

Unfortunately not all methods provide filtering capability by themselves. In contrast Repo API have dedicated filtering endpoints which are quite useful.

This issue is to somehow bring the same filtering capabilities to the SaaS API package. Its not going to be real filtering at the end of the day - in the background the package will get all entities and will filter the data based on the provided filter

Always return instance or entiry

Majority of get/getAll/create etc methods should return instance of the entity, instead of the data/details for the entity. The rule is that if there are operations, that can be performed on the entity (like delete and update), the instance should be returned. And if there are no operations then data/response data is returned

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.