{"id":20838478,"url":"https://github.com/reload/display-kk-integration-poc","last_synced_at":"2025-12-24T08:38:43.675Z","repository":{"id":42458697,"uuid":"475331401","full_name":"reload/display-kk-integration-poc","owner":"reload","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-24T10:53:12.000Z","size":1254,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-18T23:17:50.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reload.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-29T07:35:30.000Z","updated_at":"2022-03-30T10:46:56.000Z","dependencies_parsed_at":"2023-02-13T20:21:00.737Z","dependency_job_id":null,"html_url":"https://github.com/reload/display-kk-integration-poc","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/reload%2Fdisplay-kk-integration-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fdisplay-kk-integration-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fdisplay-kk-integration-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reload%2Fdisplay-kk-integration-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reload","download_url":"https://codeload.github.com/reload/display-kk-integration-poc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196618,"owners_count":20251857,"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-18T01:10:27.209Z","updated_at":"2025-12-24T08:38:43.644Z","avatar_url":"https://github.com/reload.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KK Display integration PoC\n\nBased on [Nest](https://github.com/nestjs/nest)\n\n## Running the app\n\nMake sure the api-server is up and running before you start. The simplest way\nto ensure this is to use the `api:reset` task of the [display-dev](https://github.com/reload/display-dev)\nsetup.\n\nThen:\n\n```bash\n# Start the server\n$ yarn install\n$ yarn start:dev\n\n# You should now be able to issues requests to the PoC server. Consult the\n# startup log-output for a list of endpoints\n\n# Verify the server is up\n$ curl localhost:3000/hello\n\n# The following endpoints are now available. They are independent of each other\n# eg. there is no need for calling authenticate before createTestPlayList.\n\n# Authenticate against the api (using hardcoded admin credentials) and output\n# the token-data returned by the api.\n$ curl localhost:3000/adminToken\n\n# Fetch a bind-key by calling the only api endpoint that does not require\n# authentication\n$ curl localhost:3000/bindKey\n\n# Fetch a list of playlists\n$ curl localhost:3000/playLists\n\n# Create a test playlist\n$ curl localhost:3000/createTestPlaylist\n```\n\n## PoC Notes\n\n### OpenApi generated client\n\nWe have a choice between multiple generators when it comes to creating typescript\nclients for the API. We currently opt for `typescript-axios` but there are\nthe following alternatives that could also be considered:\n\n* typescript-fetch\n* typescript-node\n* typescript-rxjs\n\nWe've tried and discarded the following:\n\n* typescript-nestjs (compile errors)\n\n### OpenApi client generation\n\nThe OpenApi spec is created via a mix of [api_platform auto-generation](https://github.com/os2display/display-api-service/blob/168d10d2019a161e02ed8ba83e21c5d2878abbcb/composer.json#L130)\n configured via [yaml-files](https://github.com/os2display/display-api-service/tree/168d10d2019a161e02ed8ba83e21c5d2878abbcb/config/api_platform),\nand a more handheld specification via a [factory](https://github.com/os2display/display-api-service/blob/168d10d2019a161e02ed8ba83e21c5d2878abbcb/src/OpenApi/OpenApiFactory.php)\n\nWe use the same spec to generate a typescript client via the `scripts/generate-client.sh`.\n\nThe Admin and Display projects also uses this API, albeit in a type unsafe\nmanner.\n\n### Invalid OpenAPI Spec\n\nNote that you so far must overwrite the specified InputJsonld (Types),\nsee an example here with SlideSlideInputJsonld\n\n```typescript\n async createTestSlide(): Promise\u003cvoid\u003e {\n    try {\n      const config = await this.getAuthenticatedConfig();\n      const slideApi = new SlidesApi(config);\n\n      // Generate a unique data object for the slide.\n      const timestamp = Date.now() + '';\n\n      const slideData: SlideSlideInputJsonld = {\n        title: 'Slide-' + timestamp,\n        theme: '',\n        description: '',\n        templateInfo: {\n          '@id': '/v1/templates/01FP2SNGFN0BZQH03KCBXHKYHG',\n          options: [],\n        },\n        duration: null,\n        content: {\n          title: 'Overskrift på slide' + timestamp,\n          text: '\u003cp\u003eTekst på slide\u003c/p\u003e',\n        },\n        media: [],\n        feed: null,\n        published: { from: null, to: null },\n      } as unknown;\n      await slideApi.createV1Slides(slideData);\n    } catch (error) {\n      console.log(error);\n    }\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fdisplay-kk-integration-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freload%2Fdisplay-kk-integration-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freload%2Fdisplay-kk-integration-poc/lists"}