{"id":18245576,"url":"https://github.com/countnazgul/qlik-saas","last_synced_at":"2025-04-08T18:53:18.069Z","repository":{"id":55082429,"uuid":"326452610","full_name":"countnazgul/qlik-saas","owner":"countnazgul","description":"NodeJS package to interact with Qlik Saas edition","archived":false,"fork":false,"pushed_at":"2021-01-12T09:14:47.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T03:16:05.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/countnazgul.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-03T16:38:01.000Z","updated_at":"2021-02-22T15:26:56.000Z","dependencies_parsed_at":"2022-08-14T11:30:41.453Z","dependency_job_id":null,"html_url":"https://github.com/countnazgul/qlik-saas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countnazgul%2Fqlik-saas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countnazgul%2Fqlik-saas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countnazgul%2Fqlik-saas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countnazgul%2Fqlik-saas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/countnazgul","download_url":"https://codeload.github.com/countnazgul/qlik-saas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247909134,"owners_count":21016475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:21:33.315Z","updated_at":"2025-04-08T18:53:18.029Z","avatar_url":"https://github.com/countnazgul.png","language":"JavaScript","funding_links":["https://ko-fi.com/T6T0148ZP"],"categories":[],"sub_categories":[],"readme":"[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/T6T0148ZP)\n\n## **UNDER DEVELOPMENT!**\n\n## Description\n\nNodeJS package to communicate with Qlik Sense Saas edition.\n\n\u003e **The official documentation about each endpoint parameters can be found on [qlik.dev](https://qlik.dev/apis#rest)**\n\n## Install\n\n`npm install qlik-saas`\n\n## Usage\n\nUsing the package is quite similar to [qrs-interact](https://github.com/jparis/qrs-interact)\n\nThe package expose 5 methods:\n\n- `Get`\n  - params\n    - `path` (string, mandatory) (`spaces`, `spaces/space-id` etc)\n- `Delete`\n  - params\n    - `path` (sting, mandatory)\n- `Patch`\n  - params\n    - TBA\n- `Post`\n  - params\n    - `path` (sting, mandatory) (`spaces`, `spaces/space-id` etc)\n    - `data` (json, mandatory) (see each endpoint for the required format)\n    - `contentType` (string, optional) (default is `application/json`)\n- `Put`\n  - params\n    - `path` (sting, mandatory) (`spaces`, `spaces/space-id` etc)\n    - `data` (json, mandatory) (see each endpoint for the required format)\n    - `contentType` (string, optional) (default is `application/json`)\n\nBefore usage the instance should be initialized:\n\n```javascript\nlet config = {\n  url: `tenant.eu.qlikcloud.com`,\n  token: `api-key-generated-from-the-admin-console `,\n  version: X, // optional. default is: 1\n};\n\nlet saasInstance = new qlikSaas(config);\n```\n\n### Get method\n\n```javascript\n// Get all available spaces\nlet allSpaces = await saasInstance.Get(\"spaces\");\n```\n\n### Delete method\n\n```javascript\n// Delete single space\nlet deletedSpace = await saasInstance.Delete(\"spaces/1a002233cdd44555566ee77f\");\n```\n\n### Patch method\n\n```javascript\n// TBA\n```\n\n### Post method\n\n```javascript\n// Create new space\nlet data = {\n  name: \"My new space\",\n  description: \"New space for more apps\",\n  type: \"shared\",\n};\n\nlet createSpace = await saasInstance.Post({\n  path: \"spaces\",\n  data: data,\n  contentType: \"application/json\",\n});\n```\n\n### Put method\n\n```javascript\n// Update space\nlet data = {\n  name: \"New name for old space\",\n};\n\nlet updateSpace = await saasInstance.Put({\n  path: `spaces/1a002233cdd44555566ee77f`,\n  data: data,\n  contentType: \"application/json\",\n});\n```\n\n## Paging\n\nWhen requesting data Qlik will page it by default (max 100 items can be returned in a single call). If there are more records to be returned, the package will extract them all before returning the result\n\n## Errors\n\n- Config - to prevent configuration errors just wrap the initialization in `try ... catch` block\n\n  ```javascript\n  let saasInstance;\n\n  try {\n    saasInstance = new qlikSaas(config);\n  } catch (e) {\n    console.log(e.message);\n  }\n  ```\n\n- Methods - once initialized each method returns `promise` and error handling can be done the usual way with `.catch()`\n\n  ```javascript\n  // Update space\n  let data = {\n    name: \"New name for old space\",\n  };\n\n  let updateSpace = await saasInstance\n    .Put({\n      path: `spaces/1a002233cdd44555566ee77f`,\n      data,\n      contentType: \"application/json\",\n    })\n    .catch(function (e) {\n      // do something with the error here\n      // if Qlik is raising the error then the format of the error will be { status: XXX, statusText: XXXXY, message: XXXXXXX }\n      // if Qlik is NOT raising the error then the format is: { message: XXXXXXX } (no status)\n    });\n  ```\n\n## Authentication\n\nAt the moment the package interact with Qlik only via `API keys`\n\n## To be added\n\n- [x] published to `npm`\n- [x] proper error handling\n- [ ] `patch` method\n- [ ] test cases (in progress)\n- [ ] more methods?\n- [ ] more testing with the paging functionality\n- [ ] support browser based authentication headers?\n- [ ] able to use the package in browsers?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcountnazgul%2Fqlik-saas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcountnazgul%2Fqlik-saas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcountnazgul%2Fqlik-saas/lists"}