{"id":15998148,"url":"https://github.com/plouc/mozaik-ext-json","last_synced_at":"2025-03-17T15:32:30.278Z","repository":{"id":33116679,"uuid":"142225799","full_name":"plouc/mozaik-ext-json","owner":"plouc","description":"A Mozaïk extension providing generic widgets to be used to display remotely fetched json data","archived":false,"fork":false,"pushed_at":"2023-01-26T01:09:41.000Z","size":1216,"stargazers_count":4,"open_issues_count":20,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T03:38:56.660Z","etag":null,"topics":["dashboard","json","json-api","mozaik","widgets"],"latest_commit_sha":null,"homepage":"https://mozaik-json.herokuapp.com/","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/plouc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-25T00:17:15.000Z","updated_at":"2024-11-06T13:36:45.000Z","dependencies_parsed_at":"2023-02-14T13:02:35.495Z","dependency_job_id":null,"html_url":"https://github.com/plouc/mozaik-ext-json","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plouc%2Fmozaik-ext-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plouc%2Fmozaik-ext-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plouc%2Fmozaik-ext-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plouc%2Fmozaik-ext-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plouc","download_url":"https://codeload.github.com/plouc/mozaik-ext-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243869587,"owners_count":20361039,"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":["dashboard","json","json-api","mozaik","widgets"],"created_at":"2024-10-08T08:07:32.735Z","updated_at":"2025-03-17T15:32:29.938Z","avatar_url":"https://github.com/plouc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mozaïk remote json widgets\n\nThis extension contains generic widgets to be used to display remotely fetched json data.\n\n## Widgets\n\n- [JsonKeys](#jsonkeys)\n- [CustomJson](#customjson)\n- [JsonStatus](#jsonstatus)\n\n### JsonKeys\n\n\u003e Display a list of json keys/values.\n\n#### parameters\n\nkey       | required | description\n----------|----------|-----------------------------------------------------------------------\n`title`   | no       | *Override widget title, default to `url` value*\n`url`     | yes      | *The URL to use to fetch the json*\n`headers` | no       | *An optional object containing http headers to send with the request*\n\n### CustomJson\n\n\u003e Use a template to display json data.\n\n#### parameters\n\nkey        | required | description\n-----------|----------|-----------------------------------------------------------------------\n`title`    | no       | *Override widget title, default to `url` value*\n`url`      | yes      | *The URL to use to fetch the json*\n`headers`  | no       | *An optional object containing http headers to send with the request*\n`template` | yes      | *The template to be used to display json data*\n\n### JsonStatus\n\n\u003e Display a status depending on json data.\n\n#### parameters\n\nkey                  | required | description\n---------------------|----------|-----------------------------------------------------------------------\n`title`              | no       | *Override widget title, default to `url` value*\n`url`                | yes      | *The URL to use to fetch the json*\n`headers`            | no       | *An optional object containing http headers to send with the request*\n`template`           | yes      | *The template to be used to display json data*\n`statuses`           | yes      | *An array of rules used to define current status*\n`statuses[n].assert` | yes      | *The assertion to be made on fetched json data, see [format](#assertion-format)*\n`statuses[n].status` | yes      | *Resulting status if assertion is met, must be one of: `unknown`, `success`, `warning`, `error`*\n`statuses[n].label`  | no       | *An optional label to put under the status icon if assertion is met*\n\n#### assertion format\n\nAssertions support several types:\n\n##### equals\n\n\u003e checks that the resulting value strictly equals expectation\n\n```yaml\nstatuses:\n  - assert: equals(my_key, status_ok)\n    status: success\n```\n\nwill check that `my_key` equals `status_ok`.\n\n##### contains\n\n\u003e checks that the resulting value contains expectation\n\nusage:\n\n```yaml\nstatuses:\n  - assert: contains(my_key, ok)\n    status: success\n```\n\nwill check that `my_key` is contains `ok`.\n\n##### matches\n\n\u003e checks that the resulting value matches regexp\n\nusage:\n\n```yaml\nstatuses:\n  - assert: matches(my_key, (ok|success)$)\n    status: success\n```\n\nwill check that `my_key` is a matches regexp `/(ok|success)$/`.\n\n##### truthy\n\n\u003e checks that the value results in a truthy value\n\nusage:\n\n```yaml\nstatuses:\n  - assert: truthy(my_key)\n    status: success\n```\n\nwill check that `my_key` is a truthy value.\n\n##### falsy\n\n\u003e checks that the value results in a falsy value\n\nusage:\n\n```yaml\nstatuses:\n  - assert: falsy(my_key)\n    status: error\n```\n\nwill check that `my_key` is a falsy value.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplouc%2Fmozaik-ext-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplouc%2Fmozaik-ext-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplouc%2Fmozaik-ext-json/lists"}